/* * ATTENTION: An "eval-source-map" devtool has been used. * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([["main"],{ /***/ "./node_modules/@swc/helpers/lib/_array_like_to_array.js": /*!***************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_array_like_to_array.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _arrayLikeToArray;\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}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fYXJyYXlfbGlrZV90b19hcnJheS5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBLDBDQUEwQyxTQUFTO0FBQ25EO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL0Bzd2MvaGVscGVycy9saWIvX2FycmF5X2xpa2VfdG9fYXJyYXkuanM/NWViMiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuZGVmYXVsdCA9IF9hcnJheUxpa2VUb0FycmF5O1xuZnVuY3Rpb24gX2FycmF5TGlrZVRvQXJyYXkoYXJyLCBsZW4pIHtcbiAgICBpZiAobGVuID09IG51bGwgfHwgbGVuID4gYXJyLmxlbmd0aCkgbGVuID0gYXJyLmxlbmd0aDtcbiAgICBmb3IodmFyIGkgPSAwLCBhcnIyID0gbmV3IEFycmF5KGxlbik7IGkgPCBsZW47IGkrKylhcnIyW2ldID0gYXJyW2ldO1xuICAgIHJldHVybiBhcnIyO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_array_like_to_array.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_array_with_holes.js": /*!************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_array_with_holes.js ***! \************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _arrayWithHoles;\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fYXJyYXlfd2l0aF9ob2xlcy5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL25vZGVfbW9kdWxlcy9Ac3djL2hlbHBlcnMvbGliL19hcnJheV93aXRoX2hvbGVzLmpzP2VjMDAiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgICB2YWx1ZTogdHJ1ZVxufSk7XG5leHBvcnRzLmRlZmF1bHQgPSBfYXJyYXlXaXRoSG9sZXM7XG5mdW5jdGlvbiBfYXJyYXlXaXRoSG9sZXMoYXJyKSB7XG4gICAgaWYgKEFycmF5LmlzQXJyYXkoYXJyKSkgcmV0dXJuIGFycjtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_array_with_holes.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_array_without_holes.js": /*!***************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_array_without_holes.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _arrayWithoutHoles;\nvar _arrayLikeToArrayMjs = _interopRequireDefault(__webpack_require__(/*! ./_array_like_to_array.js */ \"./node_modules/@swc/helpers/lib/_array_like_to_array.js\"));\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return (0, _arrayLikeToArrayMjs).default(arr);\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fYXJyYXlfd2l0aG91dF9ob2xlcy5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Ysa0RBQWtELG1CQUFPLENBQUMsMEZBQTJCO0FBQ3JGO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL0Bzd2MvaGVscGVycy9saWIvX2FycmF5X3dpdGhvdXRfaG9sZXMuanM/MmZmMiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuZGVmYXVsdCA9IF9hcnJheVdpdGhvdXRIb2xlcztcbnZhciBfYXJyYXlMaWtlVG9BcnJheU1qcyA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQocmVxdWlyZShcIi4vX2FycmF5X2xpa2VfdG9fYXJyYXkuanNcIikpO1xuZnVuY3Rpb24gX2FycmF5V2l0aG91dEhvbGVzKGFycikge1xuICAgIGlmIChBcnJheS5pc0FycmF5KGFycikpIHJldHVybiAoMCwgX2FycmF5TGlrZVRvQXJyYXlNanMpLmRlZmF1bHQoYXJyKTtcbn1cbmZ1bmN0aW9uIF9pbnRlcm9wUmVxdWlyZURlZmF1bHQob2JqKSB7XG4gICAgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHtcbiAgICAgICAgZGVmYXVsdDogb2JqXG4gICAgfTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_array_without_holes.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_assert_this_initialized.js": /*!*******************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_assert_this_initialized.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _assertThisInitialized;\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}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fYXNzZXJ0X3RoaXNfaW5pdGlhbGl6ZWQuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRixrQkFBZTtBQUNmO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fYXNzZXJ0X3RoaXNfaW5pdGlhbGl6ZWQuanM/NWFlZSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuZGVmYXVsdCA9IF9hc3NlcnRUaGlzSW5pdGlhbGl6ZWQ7XG5mdW5jdGlvbiBfYXNzZXJ0VGhpc0luaXRpYWxpemVkKHNlbGYpIHtcbiAgICBpZiAoc2VsZiA9PT0gdm9pZCAwKSB7XG4gICAgICAgIHRocm93IG5ldyBSZWZlcmVuY2VFcnJvcihcInRoaXMgaGFzbid0IGJlZW4gaW5pdGlhbGlzZWQgLSBzdXBlcigpIGhhc24ndCBiZWVuIGNhbGxlZFwiKTtcbiAgICB9XG4gICAgcmV0dXJuIHNlbGY7XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_assert_this_initialized.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_async_to_generator.js": /*!**************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_async_to_generator.js ***! \**************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _asyncToGenerator;\nfunction _asyncToGenerator(fn) {\n return function() {\n var self = this, args = arguments;\n return new Promise(function(resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fYXN5bmNfdG9fZ2VuZXJhdG9yLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0Ysa0JBQWU7QUFDZjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBTTtBQUNOO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxNQUFNO0FBQ047QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL25vZGVfbW9kdWxlcy9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ciBpbmZvID0gZ2VuW2tleV0oYXJnKTtcbiAgICAgICAgdmFyIHZhbHVlID0gaW5mby52YWx1ZTtcbiAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICByZXR1cm47XG4gICAgfVxuICAgIGlmIChpbmZvLmRvbmUpIHtcbiAgICAgICAgcmVzb2x2ZSh2YWx1ZSk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgUHJvbWlzZS5yZXNvbHZlKHZhbHVlKS50aGVuKF9uZXh0LCBfdGhyb3cpO1xuICAgIH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_async_to_generator.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_class_call_check.js": /*!************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_class_call_check.js ***! \************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _classCallCheck;\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fY2xhc3NfY2FsbF9jaGVjay5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fY2xhc3NfY2FsbF9jaGVjay5qcz9mZDM2Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7XG4gICAgdmFsdWU6IHRydWVcbn0pO1xuZXhwb3J0cy5kZWZhdWx0ID0gX2NsYXNzQ2FsbENoZWNrO1xuZnVuY3Rpb24gX2NsYXNzQ2FsbENoZWNrKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICAgIGlmICghKGluc3RhbmNlIGluc3RhbmNlb2YgQ29uc3RydWN0b3IpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gICAgfVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_class_call_check.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_construct.js": /*!*****************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_construct.js ***! \*****************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _construct;\nvar _setPrototypeOfMjs = _interopRequireDefault(__webpack_require__(/*! ./_set_prototype_of.js */ \"./node_modules/@swc/helpers/lib/_set_prototype_of.js\"));\nfunction _construct(Parent, args, Class) {\n return construct.apply(null, arguments);\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction construct(Parent1, args1, Class1) {\n if (isNativeReflectConstruct()) {\n construct = Reflect.construct;\n } else {\n construct = function construct(Parent, args, Class) {\n var a = [\n null\n ];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) (0, _setPrototypeOfMjs).default(instance, Class.prototype);\n return instance;\n };\n }\n return construct.apply(null, arguments);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fY29uc3RydWN0LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0Ysa0JBQWU7QUFDZixnREFBZ0QsbUJBQU8sQ0FBQyxvRkFBd0I7QUFDaEY7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSw4RUFBOEU7QUFDOUU7QUFDQSxNQUFNO0FBQ047QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBTTtBQUNOO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL25vZGVfbW9kdWxlcy9Ac3djL2hlbHBlcnMvbGliL19jb25zdHJ1Y3QuanM/ZTlkMSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuZGVmYXVsdCA9IF9jb25zdHJ1Y3Q7XG52YXIgX3NldFByb3RvdHlwZU9mTWpzID0gX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jdCA9IGZ1bmN0aW9uIGNvbnN0cnVjdChQYXJlbnQsIGFyZ3MsIENsYXNzKSB7XG4gICAgICAgICAgICB2YXIgYSA9IFtcbiAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICBdO1xuICAgICAgICAgICAgYS5wdXNoLmFwcGx5KGEsIGFyZ3MpO1xuICAgICAgICAgICAgdmFyIENvbnN0cnVjdG9yID0gRnVuY3Rpb24uYmluZC5hcHBseShQYXJlbnQsIGEpO1xuICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gbmV3IENvbnN0cnVjdG9yKCk7XG4gICAgICAgICAgICBpZiAoQ2xhc3MpICgwLCBfc2V0UHJvdG90eXBlT2ZNanMpLmRlZmF1bHQoaW5zdGFuY2UsIENsYXNzLnByb3RvdHlwZSk7XG4gICAgICAgICAgICByZXR1cm4gaW5zdGFuY2U7XG4gICAgICAgIH07XG4gICAgfVxuICAgIHJldHVybiBjb25zdHJ1Y3QuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_construct.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_create_class.js": /*!********************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_create_class.js ***! \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _createClass;\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\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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cy5sZW5ndGg7IGkrKyl7XG4gICAgICAgIHZhciBkZXNjcmlwdG9yID0gcHJvcHNbaV07XG4gICAgICAgIGRlc2NyaXB0b3IuZW51bWVyYWJsZSA9IGRlc2NyaXB0b3IuZW51bWVyYWJsZSB8fCBmYWxzZTtcbiAgICAgICAgZGVzY3JpcHRvci5jb25maWd1cmFibGUgPSB0cnVlO1xuICAgICAgICBpZiAoXCJ2YWx1ZVwiIGluIGRlc2NyaXB0b3IpIGRlc2NyaXB0b3Iud3JpdGFibGUgPSB0cnVlO1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGFyZ2V0LCBkZXNjcmlwdG9yLmtleSwgZGVzY3JpcHRvcik7XG4gICAgfVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_create_class.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_create_super.js": /*!********************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_create_super.js ***! \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _createSuper;\nvar _isNativeReflectConstructMjs = _interopRequireDefault(__webpack_require__(/*! ./_is_native_reflect_construct.js */ \"./node_modules/@swc/helpers/lib/_is_native_reflect_construct.js\"));\nvar _getPrototypeOfMjs = _interopRequireDefault(__webpack_require__(/*! ./_get_prototype_of.js */ \"./node_modules/@swc/helpers/lib/_get_prototype_of.js\"));\nvar _possibleConstructorReturnMjs = _interopRequireDefault(__webpack_require__(/*! ./_possible_constructor_return.js */ \"./node_modules/@swc/helpers/lib/_possible_constructor_return.js\"));\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = (0, _isNativeReflectConstructMjs).default();\n return function _createSuperInternal() {\n var Super = (0, _getPrototypeOfMjs).default(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = (0, _getPrototypeOfMjs).default(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return (0, _possibleConstructorReturnMjs).default(this, result);\n };\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fY3JlYXRlX3N1cGVyLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0Ysa0JBQWU7QUFDZiwwREFBMEQsbUJBQU8sQ0FBQywwR0FBbUM7QUFDckcsZ0RBQWdELG1CQUFPLENBQUMsb0ZBQXdCO0FBQ2hGLDJEQUEyRCxtQkFBTyxDQUFDLDBHQUFtQztBQUN0RztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFVBQVU7QUFDVjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fY3JlYXRlX3N1cGVyLmpzPzE3YWMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgICB2YWx1ZTogdHJ1ZVxufSk7XG5leHBvcnRzLmRlZmF1bHQgPSBfY3JlYXRlU3VwZXI7XG52YXIgX2lzTmF0aXZlUmVmbGVjdENvbnN0cnVjdE1qcyA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQocmVxdWlyZShcIi4vX2l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biAgICB9O1xufVxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHtcbiAgICByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDoge1xuICAgICAgICBkZWZhdWx0OiBvYmpcbiAgICB9O1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_create_super.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_extends.js": /*!***************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_extends.js ***! \***************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _extends;\nfunction _extends() {\n return extends_.apply(this, arguments);\n}\nfunction extends_() {\n extends_ = Object.assign || 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}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fZXh0ZW5kcy5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLHVCQUF1QixzQkFBc0I7QUFDN0M7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fZXh0ZW5kcy5qcz8zOThhIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7XG4gICAgdmFsdWU6IHRydWVcbn0pO1xuZXhwb3J0cy5kZWZhdWx0ID0gX2V4dGVuZHM7XG5mdW5jdGlvbiBfZXh0ZW5kcygpIHtcbiAgICByZXR1cm4gZXh0ZW5kc18uYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbn1cbmZ1bmN0aW9uIGV4dGVuZHNfKCkge1xuICAgIGV4dGVuZHNfID0gT2JqZWN0LmFzc2lnbiB8fCBmdW5jdGlvbih0YXJnZXQpIHtcbiAgICAgICAgZm9yKHZhciBpID0gMTsgaSA8IGFyZ3VtZW50cy5sZW5ndGg7IGkrKyl7XG4gICAgICAgICAgICB2YXIgc291cmNlID0gYXJndW1lbnRzW2ldO1xuICAgICAgICAgICAgZm9yKHZhciBrZXkgaW4gc291cmNlKXtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHNvdXJjZSwga2V5KSkge1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXRba2V5XSA9IHNvdXJjZVtrZXldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGFyZ2V0O1xuICAgIH07XG4gICAgcmV0dXJuIGV4dGVuZHNfLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_extends.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_get_prototype_of.js": /*!************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_get_prototype_of.js ***! \************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _getPrototypeOf;\nfunction _getPrototypeOf(o) {\n return getPrototypeOf(o);\n}\nfunction getPrototypeOf(o1) {\n getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return getPrototypeOf(o1);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fZ2V0X3Byb3RvdHlwZV9vZi5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL25vZGVfbW9kdWxlcy9Ac3djL2hlbHBlcnMvbGliL19nZXRfcHJvdG90eXBlX29mLmpzPzY4N2IiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgICB2YWx1ZTogdHJ1ZVxufSk7XG5leHBvcnRzLmRlZmF1bHQgPSBfZ2V0UHJvdG90eXBlT2Y7XG5mdW5jdGlvbiBfZ2V0UHJvdG90eXBlT2Yobykge1xuICAgIHJldHVybiBnZXRQcm90b3R5cGVPZihvKTtcbn1cbmZ1bmN0aW9uIGdldFByb3RvdHlwZU9mKG8xKSB7XG4gICAgZ2V0UHJvdG90eXBlT2YgPSBPYmplY3Quc2V0UHJvdG90eXBlT2YgPyBPYmplY3QuZ2V0UHJvdG90eXBlT2YgOiBmdW5jdGlvbiBnZXRQcm90b3R5cGVPZihvKSB7XG4gICAgICAgIHJldHVybiBvLl9fcHJvdG9fXyB8fCBPYmplY3QuZ2V0UHJvdG90eXBlT2Yobyk7XG4gICAgfTtcbiAgICByZXR1cm4gZ2V0UHJvdG90eXBlT2YobzEpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_get_prototype_of.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_inherits.js": /*!****************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_inherits.js ***! \****************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _inherits;\nvar _setPrototypeOfMjs = _interopRequireDefault(__webpack_require__(/*! ./_set_prototype_of.js */ \"./node_modules/@swc/helpers/lib/_set_prototype_of.js\"));\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) (0, _setPrototypeOfMjs).default(subClass, superClass);\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faW5oZXJpdHMuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRixrQkFBZTtBQUNmLGdEQUFnRCxtQkFBTyxDQUFDLG9GQUF3QjtBQUNoRjtBQUNBO0FBQ0E7QUF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pZiAoc3VwZXJDbGFzcykgKDAsIF9zZXRQcm90b3R5cGVPZk1qcykuZGVmYXVsdChzdWJDbGFzcywgc3VwZXJDbGFzcyk7XG59XG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikge1xuICAgIHJldHVybiBvYmogJiYgb2JqLl9fZXNNb2R1bGUgPyBvYmogOiB7XG4gICAgICAgIGRlZmF1bHQ6IG9ialxuICAgIH07XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_inherits.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_instanceof.js": /*!******************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_instanceof.js ***! \******************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _instanceof;\nfunction _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faW5zdGFuY2VvZi5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBO0FBQ0EsTUFBTTtBQUNOO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faW5zdGFuY2VvZi5qcz9kMDIxIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7XG4gICAgdmFsdWU6IHRydWVcbn0pO1xuZXhwb3J0cy5kZWZhdWx0ID0gX2luc3RhbmNlb2Y7XG5mdW5jdGlvbiBfaW5zdGFuY2VvZihsZWZ0LCByaWdodCkge1xuICAgIGlmIChyaWdodCAhPSBudWxsICYmIHR5cGVvZiBTeW1ib2wgIT09IFwidW5kZWZpbmVkXCIgJiYgcmlnaHRbU3ltYm9sLmhhc0luc3RhbmNlXSkge1xuICAgICAgICByZXR1cm4gISFyaWdodFtTeW1ib2wuaGFzSW5zdGFuY2VdKGxlZnQpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiBsZWZ0IGluc3RhbmNlb2YgcmlnaHQ7XG4gICAgfVxufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_instanceof.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_interop_require_default.js": /*!*******************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_interop_require_default.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _interopRequireDefault;\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faW50ZXJvcF9yZXF1aXJlX2RlZmF1bHQuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRixrQkFBZTtBQUNmO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL0Bzd2MvaGVscGVycy9saWIvX2ludGVyb3BfcmVxdWlyZV9kZWZhdWx0LmpzPzliN2MiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgICB2YWx1ZTogdHJ1ZVxufSk7XG5leHBvcnRzLmRlZmF1bHQgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0O1xuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHtcbiAgICByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDoge1xuICAgICAgICBkZWZhdWx0OiBvYmpcbiAgICB9O1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_interop_require_default.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_interop_require_wildcard.js": /*!********************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_interop_require_wildcard.js ***! \********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _interopRequireWildcard;\nfunction _interopRequireWildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) {\n return obj;\n }\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n var cache = _getRequireWildcardCache(nodeInterop);\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for(var key in obj){\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n newObj.default = obj;\n if (cache) {\n cache.set(obj, newObj);\n }\n return newObj;\n}\nfunction _getRequireWildcardCache(nodeInterop1) {\n if (typeof WeakMap !== \"function\") return null;\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop1);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faW50ZXJvcF9yZXF1aXJlX3dpbGRjYXJkLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0Ysa0JBQWU7QUFDZjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsY0FBYztBQUNkO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL25vZGVfbW9kdWxlcy9Ac3djL2hlbHBlcnMvbGliL19pbnRlcm9wX3JlcXVpcmVfd2lsZGNhcmQuanM/MDUxYiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZW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9yKG9iaiwga2V5KSA6IG51bGw7XG4gICAgICAgICAgICBpZiAoZGVzYyAmJiAoZGVzYy5nZXQgfHwgZGVzYy5zZXQpKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KG5ld09iaiwga2V5LCBkZXNjKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbmV3T2JqW2tleV0gPSBvYmpba2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBuZXdPYmouZGVmYXVsdCA9IG9iajtcbiAgICBpZiAoY2FjaGUpIHtcbiAgICAgICAgY2FjaGUuc2V0KG9iaiwgbmV3T2JqKTtcbiAgICB9XG4gICAgcmV0dXJuIG5ld09iajtcbn1cbmZ1bmN0aW9uIF9nZXRSZXF1aXJlV2lsZGNhcmRDYWNoZShub2RlSW50ZXJvcDEpIHtcbiAgICBpZiAodHlwZW9mIFdlYWtNYXAgIT09IFwiZnVuY3Rpb25cIikgcmV0dXJuIG51bGw7XG4gICAgdmFyIGNhY2hlQmFiZWxJbnRlcm9wID0gbmV3IFdlYWtNYXAoKTtcbiAgICB2YXIgY2FjaGVOb2RlSW50ZXJvcCA9IG5ldyBXZWFrTWFwKCk7XG4gICAgcmV0dXJuIChfZ2V0UmVxdWlyZVdpbGRjYXJkQ2FjaGUgPSBmdW5jdGlvbihub2RlSW50ZXJvcCkge1xuICAgICAgICByZXR1cm4gbm9kZUludGVyb3AgPyBjYWNoZU5vZGVJbnRlcm9wIDogY2FjaGVCYWJlbEludGVyb3A7XG4gICAgfSkobm9kZUludGVyb3AxKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_interop_require_wildcard.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_is_native_function.js": /*!**************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_is_native_function.js ***! \**************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _isNativeFunction;\nfunction _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faXNfbmF0aXZlX2Z1bmN0aW9uLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0Ysa0JBQWU7QUFDZjtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL0Bzd2MvaGVscGVycy9saWIvX2lzX25hdGl2ZV9mdW5jdGlvbi5qcz81ODgwIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7XG4gICAgdmFsdWU6IHRydWVcbn0pO1xuZXhwb3J0cy5kZWZhdWx0ID0gX2lzTmF0aXZlRnVuY3Rpb247XG5mdW5jdGlvbiBfaXNOYXRpdmVGdW5jdGlvbihmbikge1xuICAgIHJldHVybiBGdW5jdGlvbi50b1N0cmluZy5jYWxsKGZuKS5pbmRleE9mKFwiW25hdGl2ZSBjb2RlXVwiKSAhPT0gLTE7XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_is_native_function.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_is_native_reflect_construct.js": /*!***********************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_is_native_reflect_construct.js ***! \***********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _isNativeReflectConstruct;\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faXNfbmF0aXZlX3JlZmxlY3RfY29uc3RydWN0LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0Ysa0JBQWU7QUFDZjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsbUZBQW1GO0FBQ25GO0FBQ0EsTUFBTTtBQUNOO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faXNfbmF0aXZlX3JlZmxlY3RfY29uc3RydWN0LmpzPzA0M2IiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgICB2YWx1ZTogdHJ1ZVxufSk7XG5leHBvcnRzLmRlZmF1bHQgPSBfaXNOYXRpdmVSZWZsZWN0Q29uc3RydWN0O1xuZnVuY3Rpb24gX2lzTmF0aXZlUmVmbGVjdENvbnN0cnVjdCgpIHtcbiAgICBpZiAodHlwZW9mIFJlZmxlY3QgPT09IFwidW5kZWZpbmVkXCIgfHwgIVJlZmxlY3QuY29uc3RydWN0KSByZXR1cm4gZmFsc2U7XG4gICAgaWYgKFJlZmxlY3QuY29uc3RydWN0LnNoYW0pIHJldHVybiBmYWxzZTtcbiAgICBpZiAodHlwZW9mIFByb3h5ID09PSBcImZ1bmN0aW9uXCIpIHJldHVybiB0cnVlO1xuICAgIHRyeSB7XG4gICAgICAgIEJvb2xlYW4ucHJvdG90eXBlLnZhbHVlT2YuY2FsbChSZWZsZWN0LmNvbnN0cnVjdChCb29sZWFuLCBbXSwgZnVuY3Rpb24oKSB7fSkpO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_is_native_reflect_construct.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_iterable_to_array.js": /*!*************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_iterable_to_array.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _iterableToArray;\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faXRlcmFibGVfdG9fYXJyYXkuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRixrQkFBZTtBQUNmO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9faXRlcmFibGVfdG9fYXJyYXkuanM/MzIzZSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuZGVmYXVsdCA9IF9pdGVyYWJsZVRvQXJyYXk7XG5mdW5jdGlvbiBfaXRlcmFibGVUb0FycmF5KGl0ZXIpIHtcbiAgICBpZiAodHlwZW9mIFN5bWJvbCAhPT0gXCJ1bmRlZmluZWRcIiAmJiBpdGVyW1N5bWJvbC5pdGVyYXRvcl0gIT0gbnVsbCB8fCBpdGVyW1wiQEBpdGVyYXRvclwiXSAhPSBudWxsKSByZXR1cm4gQXJyYXkuZnJvbShpdGVyKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_iterable_to_array.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_non_iterable_rest.js": /*!*************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_non_iterable_rest.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _nonIterableRest;\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fbm9uX2l0ZXJhYmxlX3Jlc3QuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRixrQkFBZTtBQUNmO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fbm9uX2l0ZXJhYmxlX3Jlc3QuanM/OGE0NCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuZGVmYXVsdCA9IF9ub25JdGVyYWJsZVJlc3Q7XG5mdW5jdGlvbiBfbm9uSXRlcmFibGVSZXN0KCkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxcXFxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLlwiKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_non_iterable_rest.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_non_iterable_spread.js": /*!***************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_non_iterable_spread.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _nonIterableSpread;\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fbm9uX2l0ZXJhYmxlX3NwcmVhZC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL25vZGVfbW9kdWxlcy9Ac3djL2hlbHBlcnMvbGliL19ub25faXRlcmFibGVfc3ByZWFkLmpzPzE2NmYiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgICB2YWx1ZTogdHJ1ZVxufSk7XG5leHBvcnRzLmRlZmF1bHQgPSBfbm9uSXRlcmFibGVTcHJlYWQ7XG5mdW5jdGlvbiBfbm9uSXRlcmFibGVTcHJlYWQoKSB7XG4gICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcIkludmFsaWQgYXR0ZW1wdCB0byBzcHJlYWQgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxcXFxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLlwiKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_non_iterable_spread.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_object_without_properties_loose.js": /*!***************************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_object_without_properties_loose.js ***! \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _objectWithoutPropertiesLoose;\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fb2JqZWN0X3dpdGhvdXRfcHJvcGVydGllc19sb29zZS5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsdUJBQXVCO0FBQ3RDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fb2JqZWN0X3dpdGhvdXRfcHJvcGVydGllc19sb29zZS5qcz80Y2I5Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7XG4gICAgdmFsdWU6IHRydWVcbn0pO1xuZXhwb3J0cy5kZWZhdWx0ID0gX29iamVjdFdpdGhvdXRQcm9wZXJ0aWVzTG9vc2U7XG5mdW5jdGlvbiBfb2JqZWN0V2l0aG91dFByb3BlcnRpZXNMb29zZShzb3VyY2UsIGV4Y2x1ZGVkKSB7XG4gICAgaWYgKHNvdXJjZSA9PSBudWxsKSByZXR1cm4ge307XG4gICAgdmFyIHRhcmdldCA9IHt9O1xuICAgIHZhciBzb3VyY2VLZXlzID0gT2JqZWN0LmtleXMoc291cmNlKTtcbiAgICB2YXIga2V5LCBpO1xuICAgIGZvcihpID0gMDsgaSA8IHNvdXJjZUtleXMubGVuZ3RoOyBpKyspe1xuICAgICAgICBrZXkgPSBzb3VyY2VLZXlzW2ldO1xuICAgICAgICBpZiAoZXhjbHVkZWQuaW5kZXhPZihrZXkpID49IDApIGNvbnRpbnVlO1xuICAgICAgICB0YXJnZXRba2V5XSA9IHNvdXJjZVtrZXldO1xuICAgIH1cbiAgICByZXR1cm4gdGFyZ2V0O1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_object_without_properties_loose.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_possible_constructor_return.js": /*!***********************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_possible_constructor_return.js ***! \***********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _possibleConstructorReturn;\nvar _assertThisInitializedMjs = _interopRequireDefault(__webpack_require__(/*! ./_assert_this_initialized.js */ \"./node_modules/@swc/helpers/lib/_assert_this_initialized.js\"));\nvar _typeOfMjs = _interopRequireDefault(__webpack_require__(/*! ./_type_of.js */ \"./node_modules/@swc/helpers/lib/_type_of.js\"));\nfunction _possibleConstructorReturn(self, call) {\n if (call && ((0, _typeOfMjs).default(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n return (0, _assertThisInitializedMjs).default(self);\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base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kgPT09IFwib2JqZWN0XCIgfHwgdHlwZW9mIGNhbGwgPT09IFwiZnVuY3Rpb25cIikpIHtcbiAgICAgICAgcmV0dXJuIGNhbGw7XG4gICAgfVxuICAgIHJldHVybiAoMCwgX2Fzc2VydFRoaXNJbml0aWFsaXplZE1qcykuZGVmYXVsdChzZWxmKTtcbn1cbmZ1bmN0aW9uIF9pbnRlcm9wUmVxdWlyZURlZmF1bHQob2JqKSB7XG4gICAgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHtcbiAgICAgICAgZGVmYXVsdDogb2JqXG4gICAgfTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_possible_constructor_return.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_set_prototype_of.js": /*!************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_set_prototype_of.js ***! \************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _setPrototypeOf;\nfunction _setPrototypeOf(o, p) {\n return setPrototypeOf(o, p);\n}\nfunction setPrototypeOf(o1, p1) {\n setPrototypeOf = Object.setPrototypeOf || function setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return setPrototypeOf(o1, p1);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fc2V0X3Byb3RvdHlwZV9vZi5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL0Bzd2MvaGVscGVycy9saWIvX3NldF9wcm90b3R5cGVfb2YuanM/ZmViOSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuZGVmYXVsdCA9IF9zZXRQcm90b3R5cGVPZjtcbmZ1bmN0aW9uIF9zZXRQcm90b3R5cGVPZihvLCBwKSB7XG4gICAgcmV0dXJuIHNldFByb3RvdHlwZU9mKG8sIHApO1xufVxuZnVuY3Rpb24gc2V0UHJvdG90eXBlT2YobzEsIHAxKSB7XG4gICAgc2V0UHJvdG90eXBlT2YgPSBPYmplY3Quc2V0UHJvdG90eXBlT2YgfHwgZnVuY3Rpb24gc2V0UHJvdG90eXBlT2YobywgcCkge1xuICAgICAgICBvLl9fcHJvdG9fXyA9IHA7XG4gICAgICAgIHJldHVybiBvO1xuICAgIH07XG4gICAgcmV0dXJuIHNldFByb3RvdHlwZU9mKG8xLCBwMSk7XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_set_prototype_of.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_sliced_to_array.js": /*!***********************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_sliced_to_array.js ***! \***********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _slicedToArray;\nvar _arrayWithHolesMjs = _interopRequireDefault(__webpack_require__(/*! ./_array_with_holes.js */ \"./node_modules/@swc/helpers/lib/_array_with_holes.js\"));\nvar _iterableToArrayMjs = _interopRequireDefault(__webpack_require__(/*! ./_iterable_to_array.js */ \"./node_modules/@swc/helpers/lib/_iterable_to_array.js\"));\nvar _nonIterableRestMjs = _interopRequireDefault(__webpack_require__(/*! ./_non_iterable_rest.js */ \"./node_modules/@swc/helpers/lib/_non_iterable_rest.js\"));\nvar _unsupportedIterableToArrayMjs = _interopRequireDefault(__webpack_require__(/*! ./_unsupported_iterable_to_array.js */ \"./node_modules/@swc/helpers/lib/_unsupported_iterable_to_array.js\"));\nfunction _slicedToArray(arr, i) {\n return (0, _arrayWithHolesMjs).default(arr) || (0, _iterableToArrayMjs).default(arr, i) || (0, _unsupportedIterableToArrayMjs).default(arr, i) || (0, _nonIterableRestMjs).default();\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fc2xpY2VkX3RvX2FycmF5LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0Ysa0JBQWU7QUFDZixnREFBZ0QsbUJBQU8sQ0FBQyxvRkFBd0I7QUFDaEYsaURBQWlELG1CQUFPLENBQUMsc0ZBQXlCO0FBQ2xGLGlEQUFpRCxtQkFBTyxDQUFDLHNGQUF5QjtBQUNsRiw0REFBNEQsbUJBQU8sQ0FBQyw4R0FBcUM7QUFDekc7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fc2xpY2VkX3RvX2FycmF5LmpzPzk5MjAiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3R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gICBkZWZhdWx0OiBvYmpcbiAgICB9O1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_sliced_to_array.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_to_consumable_array.js": /*!***************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_to_consumable_array.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _toConsumableArray;\nvar _arrayWithoutHolesMjs = _interopRequireDefault(__webpack_require__(/*! ./_array_without_holes.js */ \"./node_modules/@swc/helpers/lib/_array_without_holes.js\"));\nvar _iterableToArrayMjs = _interopRequireDefault(__webpack_require__(/*! ./_iterable_to_array.js */ \"./node_modules/@swc/helpers/lib/_iterable_to_array.js\"));\nvar _nonIterableSpreadMjs = _interopRequireDefault(__webpack_require__(/*! ./_non_iterable_spread.js */ \"./node_modules/@swc/helpers/lib/_non_iterable_spread.js\"));\nvar _unsupportedIterableToArrayMjs = _interopRequireDefault(__webpack_require__(/*! ./_unsupported_iterable_to_array.js */ \"./node_modules/@swc/helpers/lib/_unsupported_iterable_to_array.js\"));\nfunction _toConsumableArray(arr) {\n return (0, _arrayWithoutHolesMjs).default(arr) || (0, _iterableToArrayMjs).default(arr) || (0, _unsupportedIterableToArrayMjs).default(arr) || (0, _nonIterableSpreadMjs).default();\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fdG9fY29uc3VtYWJsZV9hcnJheS5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztB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vX2FycmF5LmpzXCIpKTtcbmZ1bmN0aW9uIF90b0NvbnN1bWFibGVBcnJheShhcnIpIHtcbiAgICByZXR1cm4gKDAsIF9hcnJheVdpdGhvdXRIb2xlc01qcykuZGVmYXVsdChhcnIpIHx8ICgwLCBfaXRlcmFibGVUb0FycmF5TWpzKS5kZWZhdWx0KGFycikgfHwgKDAsIF91bnN1cHBvcnRlZEl0ZXJhYmxlVG9BcnJheU1qcykuZGVmYXVsdChhcnIpIHx8ICgwLCBfbm9uSXRlcmFibGVTcHJlYWRNanMpLmRlZmF1bHQoKTtcbn1cbmZ1bmN0aW9uIF9pbnRlcm9wUmVxdWlyZURlZmF1bHQob2JqKSB7XG4gICAgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHtcbiAgICAgICAgZGVmYXVsdDogb2JqXG4gICAgfTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_to_consumable_array.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_ts_generator.js": /*!********************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_ts_generator.js ***! \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"default\", ({\n enumerable: true,\n get: function() {\n return _tslib.__generator;\n }\n}));\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.mjs\");\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fdHNfZ2VuZXJhdG9yLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0YsMkNBQTBDO0FBQzFDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQyxFQUFDO0FBQ0YsYUFBYSxtQkFBTyxDQUFDLGlEQUFPIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL25vZGVfbW9kdWxlcy9Ac3djL2hlbHBlcnMvbGliL190c19nZW5lcmF0b3IuanM/YzU4ZCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcImRlZmF1bHRcIiwge1xuICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIF90c2xpYi5fX2dlbmVyYXRvcjtcbiAgICB9XG59KTtcbnZhciBfdHNsaWIgPSByZXF1aXJlKFwidHNsaWJcIik7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_ts_generator.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_type_of.js": /*!***************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_type_of.js ***! \***************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _typeof;\nfunction _typeof(obj) {\n \"@swc/helpers - typeof\";\n return obj && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\n;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fdHlwZV9vZi5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fdHlwZV9vZi5qcz82MjdlIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7XG4gICAgdmFsdWU6IHRydWVcbn0pO1xuZXhwb3J0cy5kZWZhdWx0ID0gX3R5cGVvZjtcbmZ1bmN0aW9uIF90eXBlb2Yob2JqKSB7XG4gICAgXCJAc3djL2hlbHBlcnMgLSB0eXBlb2ZcIjtcbiAgICByZXR1cm4gb2JqICYmIG9iai5jb25zdHJ1Y3RvciA9PT0gU3ltYm9sID8gXCJzeW1ib2xcIiA6IHR5cGVvZiBvYmo7XG59XG47XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_type_of.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_unsupported_iterable_to_array.js": /*!*************************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_unsupported_iterable_to_array.js ***! \*************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _unsupportedIterableToArray;\nvar _arrayLikeToArrayMjs = _interopRequireDefault(__webpack_require__(/*! ./_array_like_to_array.js */ \"./node_modules/@swc/helpers/lib/_array_like_to_array.js\"));\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return (0, _arrayLikeToArrayMjs).default(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(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0, _arrayLikeToArrayMjs).default(o, minLen);\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fdW5zdXBwb3J0ZWRfaXRlcmFibGVfdG9fYXJyYXkuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRixrQkFBZTtBQUNmLGtEQUFrRCxtQkFBTyxDQUFDLDBGQUEyQjtBQUNyRjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fdW5zdXBwb3J0ZWRfaXRlcmFibGVfdG9fYXJyYXkuanM/ZDQ5MiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuZGVmYXVsdCA9IF91bnN1cHBvcnRlZEl0ZXJhYmxlVG9BcnJheTtcbnZhciBfYXJyYXlMaWtlVG9BcnJheU1qcyA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQocmVxdWlyZShcIi4vX2FycmF5X2xpa2VfdG9fYXJyYXkuanNcIikpO1xuZnVuY3Rpb24gX3Vuc3VwcG9ydGVkSXRlcmFibGVUb0FycmF5KG8sIG1pbkxlbikge1xuICAgIGlmICghbykgcmV0dXJuO1xuICAgIGlmICh0eXBlb2YgbyA9PT0gXCJzdHJpbmdcIikgcmV0dXJuICgwLCBfYXJyYXlMaWtlVG9BcnJheU1qcykuZGVmYXVsdChvLCBtaW5MZW4pO1xuICAgIHZhciBuID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKG8pLnNsaWNlKDgsIC0xKTtcbiAgICBpZiAobiA9PT0gXCJPYmplY3RcIiAmJiBvLmNvbnN0cnVjdG9yKSBuID0gby5jb25zdHJ1Y3Rvci5uYW1lO1xuICAgIGlmIChuID09PSBcIk1hcFwiIHx8IG4gPT09IFwiU2V0XCIpIHJldHVybiBBcnJheS5mcm9tKG4pO1xuICAgIGlmIChuID09PSBcIkFyZ3VtZW50c1wiIHx8IC9eKD86VWl8SSludCg/Ojh8MTZ8MzIpKD86Q2xhbXBlZCk/QXJyYXkkLy50ZXN0KG4pKSByZXR1cm4gKDAsIF9hcnJheUxpa2VUb0FycmF5TWpzKS5kZWZhdWx0KG8sIG1pbkxlbik7XG59XG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikge1xuICAgIHJldHVybiBvYmogJiYgb2JqLl9fZXNNb2R1bGUgPyBvYmogOiB7XG4gICAgICAgIGRlZmF1bHQ6IG9ialxuICAgIH07XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_unsupported_iterable_to_array.js\n")); /***/ }), /***/ "./node_modules/@swc/helpers/lib/_wrap_native_super.js": /*!*************************************************************!*\ !*** ./node_modules/@swc/helpers/lib/_wrap_native_super.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _wrapNativeSuper;\nvar _constructMjs = _interopRequireDefault(__webpack_require__(/*! ./_construct.js */ \"./node_modules/@swc/helpers/lib/_construct.js\"));\nvar _isNativeFunctionMjs = _interopRequireDefault(__webpack_require__(/*! ./_is_native_function.js */ \"./node_modules/@swc/helpers/lib/_is_native_function.js\"));\nvar _getPrototypeOfMjs = _interopRequireDefault(__webpack_require__(/*! ./_get_prototype_of.js */ \"./node_modules/@swc/helpers/lib/_get_prototype_of.js\"));\nvar _setPrototypeOfMjs = _interopRequireDefault(__webpack_require__(/*! ./_set_prototype_of.js */ \"./node_modules/@swc/helpers/lib/_set_prototype_of.js\"));\nfunction _wrapNativeSuper(Class) {\n return wrapNativeSuper(Class);\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction wrapNativeSuper(Class1) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n wrapNativeSuper = function wrapNativeSuper(Class) {\n if (Class === null || !(0, _isNativeFunctionMjs).default(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return (0, _constructMjs).default(Class, arguments, (0, _getPrototypeOfMjs).default(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return (0, _setPrototypeOfMjs).default(Wrapper, Class);\n };\n return wrapNativeSuper(Class1);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQHN3Yy9oZWxwZXJzL2xpYi9fd3JhcF9uYXRpdmVfc3VwZXIuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Q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ybiBfY2FjaGUuZ2V0KENsYXNzKTtcbiAgICAgICAgICAgIF9jYWNoZS5zZXQoQ2xhc3MsIFdyYXBwZXIpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIFdyYXBwZXIoKSB7XG4gICAgICAgICAgICByZXR1cm4gKDAsIF9jb25zdHJ1Y3RNanMpLmRlZmF1bHQoQ2xhc3MsIGFyZ3VtZW50cywgKDAsIF9nZXRQcm90b3R5cGVPZk1qcykuZGVmYXVsdCh0aGlzKS5jb25zdHJ1Y3Rvcik7XG4gICAgICAgIH1cbiAgICAgICAgV3JhcHBlci5wcm90b3R5cGUgPSBPYmplY3QuY3JlYXRlKENsYXNzLnByb3RvdHlwZSwge1xuICAgICAgICAgICAgY29uc3RydWN0b3I6IHtcbiAgICAgICAgICAgICAgICB2YWx1ZTogV3JhcHBlcixcbiAgICAgICAgICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB3cml0YWJsZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiAoMCwgX3NldFByb3RvdHlwZU9mTWpzKS5kZWZhdWx0KFdyYXBwZXIsIENsYXNzKTtcbiAgICB9O1xuICAgIHJldHVybiB3cmFwTmF0aXZlU3VwZXIoQ2xhc3MxKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/@swc/helpers/lib/_wrap_native_super.js\n")); /***/ }), /***/ "./node_modules/next/dist/build/polyfills/polyfill-module.js": /*!*******************************************************************!*\ !*** ./node_modules/next/dist/build/polyfills/polyfill-module.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { eval(__webpack_require__.ts("\"trimStart\"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),\"trimEnd\"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),\"description\"in Symbol.prototype||Object.defineProperty(Symbol.prototype,\"description\",{configurable:!0,get:function(){var t=/\\((.*)\\)/.exec(this.toString());return t?t[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(t,r){return r=this.concat.apply([],this),t>1&&r.some(Array.isArray)?r.flat(t-1):r},Array.prototype.flatMap=function(t,r){return this.map(t,r).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(t){if(\"function\"!=typeof t)return this.then(t,t);var r=this.constructor||Promise;return this.then(function(o){return r.resolve(t()).then(function(){return o})},function(o){return r.resolve(t()).then(function(){throw o})})}),Object.fromEntries||(Object.fromEntries=function(t){return Array.from(t).reduce(function(t,r){return t[r[0]]=r[1],t},{})});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3BvbHlmaWxscy9wb2x5ZmlsbC1tb2R1bGUuanMuanMiLCJtYXBwaW5ncyI6IkFBQUEsbVFBQW1RLCtCQUErQix1Q0FBdUMsc0JBQXNCLDREQUE0RCw2RUFBNkUsdUNBQXVDLDRCQUE0QixvRUFBb0UsOENBQThDLGdDQUFnQyw2QkFBNkIsc0NBQXNDLFNBQVMsRUFBRSxhQUFhLHNDQUFzQyxRQUFRLEVBQUUsRUFBRSxzREFBc0QsMENBQTBDLHNCQUFzQixHQUFHLEVBQUUiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9idWlsZC9wb2x5ZmlsbHMvcG9seWZpbGwtbW9kdWxlLmpzPzY5YzgiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ0cmltU3RhcnRcImluIFN0cmluZy5wcm90b3R5cGV8fChTdHJpbmcucHJvdG90eXBlLnRyaW1TdGFydD1TdHJpbmcucHJvdG90eXBlLnRyaW1MZWZ0KS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KXtyZXR1cm4gQXJyYXkuZnJvbSh0KS5yZWR1Y2UoZnVuY3Rpb24odCxyKXtyZXR1cm4gdFtyWzBdXT1yWzFdLHR9LHt9KX0pO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/build/polyfills/polyfill-module.js\n")); /***/ }), /***/ "./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js": /*!********************************************************************************!*\ !*** ./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js ***! \********************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { eval(__webpack_require__.ts("var __dirname = \"/\";\n(function(){var e={211:function(e){\"use strict\";var n=function(){function defineProperties(e,n){for(var t=0;t]/gm,(function(e){return e==\"&\"?\"&\":e==\"<\"?\"<\":e==\">\"?\">\":\"\"}))}},{key:\"linkify\",value:function linkify(e){return e.replace(/(https?:\\/\\/[^\\s]+)/gm,(function(e){return''+e+\"\"}))}},{key:\"ansiToHtml\",value:function ansiToHtml(e,n){return this.process(e,n,true)}},{key:\"ansiToJson\",value:function ansiToJson(e,n){n=n||{};n.json=true;n.clearLine=false;return this.process(e,n,true)}},{key:\"ansiToText\",value:function ansiToText(e){return this.process(e,{},false)}},{key:\"process\",value:function process(e,n,t){var r=this;var a=this;var i=e.split(/\\033\\[/);var o=i.shift();if(n===undefined||n===null){n={}}n.clearLine=/\\r/.test(e);var l=i.map((function(e){return r.processChunk(e,n,t)}));if(n&&n.json){var s=a.processChunkJson(\"\");s.content=o;s.clearLine=n.clearLine;l.unshift(s);if(n.remove_empty){l=l.filter((function(e){return!e.isEmpty()}))}return l}else{l.unshift(o)}return l.join(\"\")}},{key:\"processChunkJson\",value:function processChunkJson(e,n,r){n=typeof n==\"undefined\"?{}:n;var a=n.use_classes=typeof n.use_classes!=\"undefined\"&&n.use_classes;var i=n.key=a?\"class\":\"color\";var o={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,clearLine:n.clearLine,decoration:null,was_processed:false,isEmpty:function isEmpty(){return!o.content}};var l=e.match(/^([!\\x3c-\\x3f]*)([\\d;]*)([\\x20-\\x2c]*[\\x40-\\x7e])([\\s\\S]*)/m);if(!l)return o;var s=o.content=l[4];var u=l[2].split(\";\");if(l[1]!==\"\"||l[3]!==\"m\"){return o}if(!r){return o}var c=this;c.decoration=null;while(u.length>0){var f=u.shift();var d=parseInt(f);if(isNaN(d)||d===0){c.fg=c.bg=c.decoration=null}else if(d===1){c.decoration=\"bold\"}else if(d===2){c.decoration=\"dim\"}else if(d==3){c.decoration=\"italic\"}else if(d==4){c.decoration=\"underline\"}else if(d==5){c.decoration=\"blink\"}else if(d===7){c.decoration=\"reverse\"}else if(d===8){c.decoration=\"hidden\"}else if(d===9){c.decoration=\"strikethrough\"}else if(d==39){c.fg=null}else if(d==49){c.bg=null}else if(d>=30&&d<38){c.fg=t[0][d%10][i]}else if(d>=90&&d<98){c.fg=t[1][d%10][i]}else if(d>=40&&d<48){c.bg=t[0][d%10][i]}else if(d>=100&&d<108){c.bg=t[1][d%10][i]}else if(d===38||d===48){var p=d===38;if(u.length>=1){var b=u.shift();if(b===\"5\"&&u.length>=1){var v=parseInt(u.shift());if(v>=0&&v<=255){if(!a){if(!this.PALETTE_COLORS){c.setupPalette()}if(p){c.fg=this.PALETTE_COLORS[v]}else{c.bg=this.PALETTE_COLORS[v]}}else{var m=v>=16?\"ansi-palette-\"+v:t[v>7?1:0][v%8][\"class\"];if(p){c.fg=m}else{c.bg=m}}}}else if(b===\"2\"&&u.length>=3){var g=parseInt(u.shift());var h=parseInt(u.shift());var y=parseInt(u.shift());if(g>=0&&g<=255&&h>=0&&h<=255&&y>=0&&y<=255){var x=g+\", \"+h+\", \"+y;if(!a){if(p){c.fg=x}else{c.bg=x}}else{if(p){c.fg=\"ansi-truecolor\";c.fg_truecolor=x}else{c.bg=\"ansi-truecolor\";c.bg_truecolor=x}}}}}}}if(c.fg===null&&c.bg===null&&c.decoration===null){return o}else{var w=[];var _=[];var E={};o.fg=c.fg;o.bg=c.bg;o.fg_truecolor=c.fg_truecolor;o.bg_truecolor=c.bg_truecolor;o.decoration=c.decoration;o.was_processed=true;return o}}},{key:\"processChunk\",value:function processChunk(e,n,t){var r=this;var a=this;n=n||{};var i=this.processChunkJson(e,n,t);if(n.json){return i}if(i.isEmpty()){return\"\"}if(!i.was_processed){return i.content}var o=n.use_classes;var l=[];var s=[];var u={};var c=function render_data(e){var n=[];var t=void 0;for(t in e){if(e.hasOwnProperty(t)){n.push(\"data-\"+t+'=\"'+r.escapeForHtml(e[t])+'\"')}}return n.length>0?\" \"+n.join(\" \"):\"\"};if(i.fg){if(o){s.push(i.fg+\"-fg\");if(i.fg_truecolor!==null){u[\"ansi-truecolor-fg\"]=i.fg_truecolor;i.fg_truecolor=null}}else{l.push(\"color:rgb(\"+i.fg+\")\")}}if(i.bg){if(o){s.push(i.bg+\"-bg\");if(i.bg_truecolor!==null){u[\"ansi-truecolor-bg\"]=i.bg_truecolor;i.bg_truecolor=null}}else{l.push(\"background-color:rgb(\"+i.bg+\")\")}}if(i.decoration){if(o){s.push(\"ansi-\"+i.decoration)}else if(i.decoration===\"bold\"){l.push(\"font-weight:bold\")}else if(i.decoration===\"dim\"){l.push(\"opacity:0.5\")}else if(i.decoration===\"italic\"){l.push(\"font-style:italic\")}else if(i.decoration===\"reverse\"){l.push(\"filter:invert(100%)\")}else if(i.decoration===\"hidden\"){l.push(\"visibility:hidden\")}else if(i.decoration===\"strikethrough\"){l.push(\"text-decoration:line-through\")}else{l.push(\"text-decoration:\"+i.decoration)}}if(o){return'\"+i.content+\"\"}else{return'\"+i.content+\"\"}}}]);return Anser}();e.exports=r},553:function(e){(function(n,t){if(true){e.exports=t(n)}else{}})(typeof __webpack_require__.g!=\"undefined\"?__webpack_require__.g:this,(function(e){if(e.CSS&&e.CSS.escape){return e.CSS.escape}var cssEscape=function(e){if(arguments.length==0){throw new TypeError(\"`CSS.escape` requires an argument.\")}var n=String(e);var t=n.length;var r=-1;var a;var i=\"\";var o=n.charCodeAt(0);while(++r=1&&a<=31||a==127||r==0&&a>=48&&a<=57||r==1&&a>=48&&a<=57&&o==45){i+=\"\\\\\"+a.toString(16)+\" \";continue}if(r==0&&t==1&&a==45){i+=\"\\\\\"+n.charAt(r);continue}if(a>=128||a==45||a==95||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122){i+=n.charAt(r);continue}i+=\"\\\\\"+n.charAt(r)}return i};if(!e.CSS){e.CSS={}}e.CSS.escape=cssEscape;return cssEscape}))},541:function(e,n,t){e=t.nmd(e);\n/*!\n * Platform.js v1.3.6\n * Copyright 2014-2020 Benjamin Tan\n * Copyright 2011-2013 John-David Dalton\n * Available under MIT license\n */(function(){\"use strict\";var t={function:true,object:true};var r=t[typeof window]&&window||this;var a=r;var i=t[typeof n]&&n;var o=t[\"object\"]&&e&&!e.nodeType&&e;var l=i&&o&&typeof __webpack_require__.g==\"object\"&&__webpack_require__.g;if(l&&(l.global===l||l.window===l||l.self===l)){r=l}var s=Math.pow(2,53)-1;var u=/\\bOpera/;var c=this;var f=Object.prototype;var d=f.hasOwnProperty;var p=f.toString;function capitalize(e){e=String(e);return e.charAt(0).toUpperCase()+e.slice(1)}function cleanupOS(e,n,t){var r={\"10.0\":\"10\",6.4:\"10 Technical Preview\",6.3:\"8.1\",6.2:\"8\",6.1:\"Server 2008 R2 / 7\",\"6.0\":\"Server 2008 / Vista\",5.2:\"Server 2003 / XP 64-bit\",5.1:\"XP\",5.01:\"2000 SP1\",\"5.0\":\"2000\",\"4.0\":\"NT\",\"4.90\":\"ME\"};if(n&&t&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(r=r[/[\\d.]+$/.exec(e)])){e=\"Windows \"+r}e=String(e);if(n&&t){e=e.replace(RegExp(n,\"i\"),t)}e=format(e.replace(/ ce$/i,\" CE\").replace(/\\bhpw/i,\"web\").replace(/\\bMacintosh\\b/,\"Mac OS\").replace(/_PowerPC\\b/i,\" OS\").replace(/\\b(OS X) [^ \\d]+/i,\"$1\").replace(/\\bMac (OS X)\\b/,\"$1\").replace(/\\/(\\d)/,\" $1\").replace(/_/g,\".\").replace(/(?: BePC|[ .]*fc[ \\d.]+)$/i,\"\").replace(/\\bx86\\.64\\b/gi,\"x86_64\").replace(/\\b(Windows Phone) OS\\b/,\"$1\").replace(/\\b(Chrome OS \\w+) [\\d.]+\\b/,\"$1\").split(\" on \")[0]);return e}function each(e,n){var t=-1,r=e?e.length:0;if(typeof r==\"number\"&&r>-1&&r<=s){while(++t3&&\"WebKit\"||/\\bOpera\\b/.test(A)&&(/\\bOPR\\b/.test(e)?\"Blink\":\"Presto\")||/\\b(?:Midori|Nook|Safari)\\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(P)&&\"WebKit\"||!P&&/\\bMSIE\\b/i.test(e)&&(z==\"Mac OS\"?\"Tasman\":\"Trident\")||P==\"WebKit\"&&/\\bPlayStation\\b(?! Vita\\b)/i.test(A)&&\"NetFront\"){P=[O]}if(A==\"IE\"&&(O=(/; *(?:XBLWP|ZuneWP)(\\d+)/i.exec(e)||0)[1])){A+=\" Mobile\";z=\"Windows Phone \"+(/\\+$/.test(O)?O:O+\".x\");j.unshift(\"desktop mode\")}else if(/\\bWPDesktop\\b/i.test(e)){A=\"IE Mobile\";z=\"Windows Phone 8.x\";j.unshift(\"desktop mode\");C||(C=(/\\brv:([\\d.]+)/.exec(e)||0)[1])}else if(A!=\"IE\"&&P==\"Trident\"&&(O=/\\brv:([\\d.]+)/.exec(e))){if(A){j.push(\"identifying as \"+A+(C?\" \"+C:\"\"))}A=\"IE\";C=O[1]}if(T){if(isHostType(n,\"global\")){if(g){O=g.lang.System;S=O.getProperty(\"os.arch\");z=z||O.getProperty(\"os.name\")+\" \"+O.getProperty(\"os.version\")}if(h){try{C=n.require(\"ringo/engine\").version.join(\".\");A=\"RingoJS\"}catch(e){if((O=n.system)&&O.global.system==n.system){A=\"Narwhal\";z||(z=O[0].os||null)}}if(!A){A=\"Rhino\"}}else if(typeof n.process==\"object\"&&!n.process.browser&&(O=n.process)){if(typeof O.versions==\"object\"){if(typeof O.versions.electron==\"string\"){j.push(\"Node \"+O.versions.node);A=\"Electron\";C=O.versions.electron}else if(typeof O.versions.nw==\"string\"){j.push(\"Chromium \"+C,\"Node \"+O.versions.node);A=\"NW.js\";C=O.versions.nw}}if(!A){A=\"Node.js\";S=O.arch;z=O.platform;C=/[\\d.]+/.exec(O.version);C=C?C[0]:null}}}else if(getClassOf(O=n.runtime)==d){A=\"Adobe AIR\";z=O.flash.system.Capabilities.os}else if(getClassOf(O=n.phantom)==m){A=\"PhantomJS\";C=(O=O.version||null)&&O.major+\".\"+O.minor+\".\"+O.patch}else if(typeof w.documentMode==\"number\"&&(O=/\\bTrident\\/(\\d+)/i.exec(e))){C=[C,w.documentMode];if((O=+O[1]+4)!=C[1]){j.push(\"IE \"+C[1]+\" mode\");P&&(P[1]=\"\");C[1]=O}C=A==\"IE\"?String(C[1].toFixed(1)):C[0]}else if(typeof w.documentMode==\"number\"&&/^(?:Chrome|Firefox)\\b/.test(A)){j.push(\"masking as \"+A+\" \"+C);A=\"IE\";C=\"11.0\";P=[\"Trident\"];z=\"Windows\"}z=z&&format(z)}if(C&&(O=/(?:[ab]|dp|pre|[ab]\\d+pre)(?:\\d+\\+?)?$/i.exec(C)||/(?:alpha|beta)(?: ?\\d)?/i.exec(e+\";\"+(T&&i.appMinorVersion))||/\\bMinefield\\b/i.test(e)&&\"a\")){k=/b/i.test(O)?\"beta\":\"alpha\";C=C.replace(RegExp(O+\"\\\\+?$\"),\"\")+(k==\"beta\"?x:y)+(/\\d+\\+?/.exec(O)||\"\")}if(A==\"Fennec\"||A==\"Firefox\"&&/\\b(?:Android|Firefox OS|KaiOS)\\b/.test(z)){A=\"Firefox Mobile\"}else if(A==\"Maxthon\"&&C){C=C.replace(/\\.[\\d.]+/,\".x\")}else if(/\\bXbox\\b/i.test(D)){if(D==\"Xbox 360\"){z=null}if(D==\"Xbox 360\"&&/\\bIEMobile\\b/.test(e)){j.unshift(\"mobile mode\")}}else if((/^(?:Chrome|IE|Opera)$/.test(A)||A&&!D&&!/Browser|Mobi/.test(A))&&(z==\"Windows CE\"||/Mobi/i.test(e))){A+=\" Mobile\"}else if(A==\"IE\"&&T){try{if(n.external===null){j.unshift(\"platform preview\")}}catch(e){j.unshift(\"embedded\")}}else if((/\\bBlackBerry\\b/.test(D)||/\\bBB10\\b/.test(e))&&(O=(RegExp(D.replace(/ +/g,\" *\")+\"/([.\\\\d]+)\",\"i\").exec(e)||0)[1]||C)){O=[O,/BB10/.test(e)];z=(O[1]?(D=null,N=\"BlackBerry\"):\"Device Software\")+\" \"+O[0];C=null}else if(this!=forOwn&&D!=\"Wii\"&&(T&&_||/Opera/.test(A)&&/\\b(?:MSIE|Firefox)\\b/i.test(e)||A==\"Firefox\"&&/\\bOS X (?:\\d+\\.){2,}/.test(z)||A==\"IE\"&&(z&&!/^Win/.test(z)&&C>5.5||/\\bWindows XP\\b/.test(z)&&C>8||C==8&&!/\\bTrident\\b/.test(e)))&&!u.test(O=parse.call(forOwn,e.replace(u,\"\")+\";\"))&&O.name){O=\"ing as \"+O.name+((O=O.version)?\" \"+O:\"\");if(u.test(A)){if(/\\bIE\\b/.test(O)&&z==\"Mac OS\"){z=null}O=\"identify\"+O}else{O=\"mask\"+O;if(E){A=format(E.replace(/([a-z])([A-Z])/g,\"$1 $2\"))}else{A=\"Opera\"}if(/\\bIE\\b/.test(O)){z=null}if(!T){C=null}}P=[\"Presto\"];j.push(O)}if(O=(/\\bAppleWebKit\\/([\\d.]+\\+?)/i.exec(e)||0)[1]){O=[parseFloat(O.replace(/\\.(\\d)$/,\".0$1\")),O];if(A==\"Safari\"&&O[1].slice(-1)==\"+\"){A=\"WebKit Nightly\";k=\"alpha\";C=O[1].slice(0,-1)}else if(C==O[1]||C==(O[2]=(/\\bSafari\\/([\\d.]+\\+?)/i.exec(e)||0)[1])){C=null}O[1]=(/\\b(?:Headless)?Chrome\\/([\\d.]+)/i.exec(e)||0)[1];if(O[0]==537.36&&O[2]==537.36&&parseFloat(O[1])>=28&&P==\"WebKit\"){P=[\"Blink\"]}if(!T||!s&&!O[1]){P&&(P[1]=\"like Safari\");O=(O=O[0],O<400?1:O<500?2:O<526?3:O<533?4:O<534?\"4+\":O<535?5:O<537?6:O<538?7:O<601?8:O<602?9:O<604?10:O<606?11:O<608?12:\"12\")}else{P&&(P[1]=\"like Chrome\");O=O[1]||(O=O[0],O<530?1:O<532?2:O<532.05?3:O<533?4:O<534.03?5:O<534.07?6:O<534.1?7:O<534.13?8:O<534.16?9:O<534.24?10:O<534.3?11:O<535.01?12:O<535.02?\"13+\":O<535.07?15:O<535.11?16:O<535.19?17:O<536.05?18:O<536.1?19:O<537.01?20:O<537.11?\"21+\":O<537.13?23:O<537.18?24:O<537.24?25:O<537.36?26:P!=\"Blink\"?\"27\":\"28\")}P&&(P[1]+=\" \"+(O+=typeof O==\"number\"?\".x\":/[.+]/.test(O)?\"\":\"+\"));if(A==\"Safari\"&&(!C||parseInt(C)>45)){C=O}else if(A==\"Chrome\"&&/\\bHeadlessChrome/i.test(e)){j.unshift(\"headless\")}}if(A==\"Opera\"&&(O=/\\bzbov|zvav$/.exec(z))){A+=\" \";j.unshift(\"desktop mode\");if(O==\"zvav\"){A+=\"Mini\";C=null}else{A+=\"Mobile\"}z=z.replace(RegExp(\" *\"+O+\"$\"),\"\")}else if(A==\"Safari\"&&/\\bChrome\\b/.exec(P&&P[1])){j.unshift(\"desktop mode\");A=\"Chrome Mobile\";C=null;if(/\\bOS X\\b/.test(z)){N=\"Apple\";z=\"iOS 4.3+\"}else{z=null}}else if(/\\bSRWare Iron\\b/.test(A)&&!C){C=getVersion(\"Chrome\")}if(C&&C.indexOf(O=/[\\d.]+$/.exec(z))==0&&e.indexOf(\"/\"+O+\"-\")>-1){z=trim(z.replace(O,\"\"))}if(z&&z.indexOf(A)!=-1&&!RegExp(A+\" OS\").test(z)){z=z.replace(RegExp(\" *\"+qualify(A)+\" *\"),\"\")}if(P&&!/\\b(?:Avant|Nook)\\b/.test(A)&&(/Browser|Lunascape|Maxthon/.test(A)||A!=\"Safari\"&&/^iOS/.test(z)&&/\\bSafari\\b/.test(P[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(A)&&P[1])){(O=P[P.length-1])&&j.push(O)}if(j.length){j=[\"(\"+j.join(\"; \")+\")\"]}if(N&&D&&D.indexOf(N)<0){j.push(\"on \"+N)}if(D){j.push((/^on /.test(j[j.length-1])?\"\":\"on \")+D)}if(z){O=/ ([\\d.+]+)$/.exec(z);M=O&&z.charAt(z.length-O[0].length-1)==\"/\";z={architecture:32,family:O&&!M?z.replace(O[0],\"\"):z,version:O?O[1]:null,toString:function(){var e=this.version;return this.family+(e&&!M?\" \"+e:\"\")+(this.architecture==64?\" 64-bit\":\"\")}}}if((O=/\\b(?:AMD|IA|Win|WOW|x86_|x)64\\b/i.exec(S))&&!/\\bi686\\b/i.test(S)){if(z){z.architecture=64;z.family=z.family.replace(RegExp(\" *\"+O),\"\")}if(A&&(/\\bWOW64\\b/i.test(e)||T&&/\\w(?:86|32)$/.test(i.cpuClass||i.platform)&&!/\\bWin64; x64\\b/i.test(e))){j.unshift(\"32-bit\")}}else if(z&&/^OS X/.test(z.family)&&A==\"Chrome\"&&parseFloat(C)>=39){z.architecture=64}e||(e=null);var I={};I.description=e;I.layout=P&&P[0];I.manufacturer=N;I.name=A;I.prerelease=k;I.product=D;I.ua=e;I.version=A&&C;I.os=z||{architecture:null,family:null,version:null,toString:function(){return\"null\"}};I.parse=parse;I.toString=toStringPlatform;if(I.version){j.unshift(C)}if(I.name){j.unshift(A)}if(z&&A&&!(z==String(z).split(\" \")[0]&&(z==A.split(\" \")[0]||D))){j.push(D?\"(\"+z+\")\":\"on \"+z)}if(j.length){I.description=j.join(\" \")}return I}var b=parse();if(i&&o){forOwn(b,(function(e,n){i[n]=e}))}else{r.platform=b}}).call(this)},777:function(e,n){\"use strict\";Object.defineProperty(n,\"__esModule\",{value:true});var t=\"\";function parse(e){var n=e.split(\"\\n\");return n.reduce((function(e,n){var t=parseChrome(n)||parseWinjs(n)||parseGecko(n)||parseNode(n)||parseJSC(n);if(t){e.push(t)}return e}),[])}var r=/^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;var a=/\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;function parseChrome(e){var n=r.exec(e);if(!n){return null}var i=n[2]&&n[2].indexOf(\"native\")===0;var o=n[2]&&n[2].indexOf(\"eval\")===0;var l=a.exec(n[2]);if(o&&l!=null){n[2]=l[1];n[3]=l[2];n[4]=l[3]}return{file:!i?n[2]:null,methodName:n[1]||t,arguments:i?[n[2]]:[],lineNumber:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}var i=/^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;function parseWinjs(e){var n=i.exec(e);if(!n){return null}return{file:n[2],methodName:n[1]||t,arguments:[],lineNumber:+n[3],column:n[4]?+n[4]:null}}var o=/^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;var l=/(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;function parseGecko(e){var n=o.exec(e);if(!n){return null}var r=n[3]&&n[3].indexOf(\" > eval\")>-1;var a=l.exec(n[3]);if(r&&a!=null){n[3]=a[1];n[4]=a[2];n[5]=null}return{file:n[3],methodName:n[1]||t,arguments:n[2]?n[2].split(\",\"):[],lineNumber:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}var s=/^\\s*(?:([^@]*)(?:\\((.*?)\\))?@)?(\\S.*?):(\\d+)(?::(\\d+))?\\s*$/i;function parseJSC(e){var n=s.exec(e);if(!n){return null}return{file:n[3],methodName:n[1]||t,arguments:[],lineNumber:+n[4],column:n[5]?+n[5]:null}}var u=/^\\s*at (?:((?:\\[object object\\])?[^\\\\/]+(?: \\[as \\S+\\])?) )?\\(?(.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;function parseNode(e){var n=u.exec(e);if(!n){return null}return{file:n[2],methodName:n[1]||t,arguments:[],lineNumber:+n[3],column:n[4]?+n[4]:null}}n.parse=parse},204:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};n.__esModule=true;n.onRefresh=n.unregister=n.register=n.onBuildError=n.onBuildOk=n.ReactDevOverlay=n.getServerError=n.getErrorByType=void 0;var o=i(t(851));var l=t(636);var s=false;var u=undefined;function onUnhandledError(e){var n=e===null||e===void 0?void 0:e.error;if(!n||!(n instanceof Error)||typeof n.stack!==\"string\"){return}if(n.message.match(/(hydration|content does not match|did not match)/i)){n.message+=\"\\n\\nSee more info here: https://nextjs.org/docs/messages/react-hydration-error\"}var t=n;o.emit({type:o.TYPE_UNHANDLED_ERROR,reason:n,frames:(0,l.parseStack)(t.stack)})}function onUnhandledRejection(e){var n=e===null||e===void 0?void 0:e.reason;if(!n||!(n instanceof Error)||typeof n.stack!==\"string\"){return}var t=n;o.emit({type:o.TYPE_UNHANDLED_REJECTION,reason:n,frames:(0,l.parseStack)(t.stack)})}function register(){if(s){return}s=true;try{var e=Error.stackTraceLimit;Error.stackTraceLimit=50;u=e}catch(e){}window.addEventListener(\"error\",onUnhandledError);window.addEventListener(\"unhandledrejection\",onUnhandledRejection)}n.register=register;function unregister(){if(!s){return}s=false;if(u!==undefined){try{Error.stackTraceLimit=u}catch(e){}u=undefined}window.removeEventListener(\"error\",onUnhandledError);window.removeEventListener(\"unhandledrejection\",onUnhandledRejection)}n.unregister=unregister;function onBuildOk(){o.emit({type:o.TYPE_BUILD_OK})}n.onBuildOk=onBuildOk;function onBuildError(e){o.emit({type:o.TYPE_BUILD_ERROR,message:e})}n.onBuildError=onBuildError;function onRefresh(){o.emit({type:o.TYPE_REFRESH})}n.onRefresh=onRefresh;var c=t(403);r(n,c,\"getErrorByType\");var f=t(233);r(n,f,\"getServerError\");var d=t(222);r(n,d,\"default\",\"ReactDevOverlay\")},790:function(e,n,t){\"use strict\";var r=this&&this.__extends||function(){var extendStatics=function(e,n){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))e[t]=n[t]};return extendStatics(e,n)};return function(e,n){if(typeof n!==\"function\"&&n!==null)throw new TypeError(\"Class extends value \"+String(n)+\" is not a constructor or null\");extendStatics(e,n);function __(){this.constructor=e}e.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=true;n.ErrorBoundary=void 0;var i=a(t(522));var o=function(e){r(ErrorBoundary,e);function ErrorBoundary(){var n=e!==null&&e.apply(this,arguments)||this;n.state={error:null};return n}ErrorBoundary.getDerivedStateFromError=function(e){return{error:e}};ErrorBoundary.prototype.componentDidCatch=function(e,n){this.props.onError(e,(n===null||n===void 0?void 0:n.componentStack)||null);if(!this.props.globalOverlay){this.setState({error:e})}};ErrorBoundary.prototype.render=function(){return this.state.error||this.props.globalOverlay&&this.props.isMounted?this.props.globalOverlay?i[\"default\"].createElement(\"html\",null,i[\"default\"].createElement(\"head\",null),i[\"default\"].createElement(\"body\",null)):null:this.props.children};return ErrorBoundary}(i[\"default\"].PureComponent);n.ErrorBoundary=o},222:function(e,n,t){\"use strict\";var r=this&&this.__assign||function(){r=Object.assign||function(e){for(var n,t=1,r=arguments.length;t0)&&!(a=r.next()).done)i.push(a.value)}catch(e){o={error:e}}finally{try{if(a&&!a.done&&(t=r[\"return\"]))t.call(r)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,n,t){if(t||arguments.length===2)for(var r=0,a=n.length,i;r? +\\d+ +\\| [ ]+/.exec((0,c[\"default\"])(e))===null?null:/^>? +\\d+ +\\| ( *)/.exec((0,c[\"default\"])(e))})).filter(Boolean).map((function(e){return e.pop()})).reduce((function(e,n){return isNaN(e)?n.length:Math.min(e,n.length)}),NaN);if(n>1){var r=\" \".repeat(n);return e.map((function(e,n){return~(n=e.indexOf(\"|\"))?e.substring(0,n)+e.substring(n).replace(r,\"\"):e})).join(\"\\n\")}return e.join(\"\\n\")}),[t]);var i=u.useMemo((function(){return s[\"default\"].ansiToJson(a,{json:true,use_classes:true,remove_empty:true})}),[a]);var o=u.useCallback((function(){var e;var t=new URLSearchParams;for(var r in n){t.append(r,((e=n[r])!==null&&e!==void 0?e:\"\").toString())}self.fetch(\"\".concat( false||\"\",\"/__nextjs_launch-editor?\").concat(t.toString())).then((function(){}),(function(){console.error(\"There was an issue opening this code in your editor.\")}))}),[n]);return u.createElement(\"div\",{\"data-nextjs-codeframe\":true},u.createElement(\"div\",null,u.createElement(\"p\",{role:\"link\",onClick:o,tabIndex:1,title:\"Click to open in your editor\"},u.createElement(\"span\",null,(0,f.getFrameSource)(n),\" @ \",n.methodName),u.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"},u.createElement(\"path\",{d:\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"}),u.createElement(\"polyline\",{points:\"15 3 21 3 21 9\"}),u.createElement(\"line\",{x1:\"10\",y1:\"14\",x2:\"21\",y2:\"3\"})))),u.createElement(\"pre\",null,i.map((function(e,n){return u.createElement(\"span\",{key:\"frame-\".concat(n),style:r({color:e.fg?\"var(--color-\".concat(e.fg,\")\"):undefined},e.decoration===\"bold\"?{fontWeight:800}:e.decoration===\"italic\"?{fontStyle:\"italic\"}:undefined)},e.content)}))))};n.CodeFrame=d},413:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});n.__esModule=true;n.CodeFrame=void 0;var a=t(987);r(n,a,\"CodeFrame\")},399:function(e,n,t){\"use strict\";var r=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,\"raw\",{value:n})}else{e.raw=n}return e};n.__esModule=true;n.styles=void 0;var a=t(910);var i=(0,a.noop)(o||(o=r([\"\\n [data-nextjs-codeframe] {\\n overflow: auto;\\n border-radius: var(--size-gap-half);\\n background-color: var(--color-ansi-bg);\\n color: var(--color-ansi-fg);\\n }\\n [data-nextjs-codeframe]::selection,\\n [data-nextjs-codeframe] *::selection {\\n background-color: var(--color-ansi-selection);\\n }\\n [data-nextjs-codeframe] * {\\n color: inherit;\\n background-color: transparent;\\n font-family: var(--font-stack-monospace);\\n }\\n\\n [data-nextjs-codeframe] > * {\\n margin: 0;\\n padding: calc(var(--size-gap) + var(--size-gap-half))\\n calc(var(--size-gap-double) + var(--size-gap-half));\\n }\\n [data-nextjs-codeframe] > div {\\n display: inline-block;\\n width: auto;\\n min-width: 100%;\\n border-bottom: 1px solid var(--color-ansi-bright-black);\\n }\\n [data-nextjs-codeframe] > div > p {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n cursor: pointer;\\n margin: 0;\\n }\\n [data-nextjs-codeframe] > div > p:hover {\\n text-decoration: underline dotted;\\n }\\n [data-nextjs-codeframe] div > p > svg {\\n width: auto;\\n height: 1em;\\n margin-left: 8px;\\n }\\n [data-nextjs-codeframe] div > pre {\\n overflow: hidden;\\n display: inline-block;\\n }\\n\"],[\"\\n [data-nextjs-codeframe] {\\n overflow: auto;\\n border-radius: var(--size-gap-half);\\n background-color: var(--color-ansi-bg);\\n color: var(--color-ansi-fg);\\n }\\n [data-nextjs-codeframe]::selection,\\n [data-nextjs-codeframe] *::selection {\\n background-color: var(--color-ansi-selection);\\n }\\n [data-nextjs-codeframe] * {\\n color: inherit;\\n background-color: transparent;\\n font-family: var(--font-stack-monospace);\\n }\\n\\n [data-nextjs-codeframe] > * {\\n margin: 0;\\n padding: calc(var(--size-gap) + var(--size-gap-half))\\n calc(var(--size-gap-double) + var(--size-gap-half));\\n }\\n [data-nextjs-codeframe] > div {\\n display: inline-block;\\n width: auto;\\n min-width: 100%;\\n border-bottom: 1px solid var(--color-ansi-bright-black);\\n }\\n [data-nextjs-codeframe] > div > p {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n cursor: pointer;\\n margin: 0;\\n }\\n [data-nextjs-codeframe] > div > p:hover {\\n text-decoration: underline dotted;\\n }\\n [data-nextjs-codeframe] div > p > svg {\\n width: auto;\\n height: 1em;\\n margin-left: 8px;\\n }\\n [data-nextjs-codeframe] div > pre {\\n overflow: hidden;\\n display: inline-block;\\n }\\n\"])));n.styles=i;var o},616:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};var o=this&&this.__rest||function(e,n){var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0)t[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols===\"function\")for(var a=0,r=Object.getOwnPropertySymbols(e);a0)&&!(a=r.next()).done)i.push(a.value)}catch(e){o={error:e}}finally{try{if(a&&!a.done&&(t=r[\"return\"]))t.call(r)}finally{if(o)throw o.error}}return i};n.__esModule=true;n.Dialog=void 0;var s=i(t(522));var u=t(169);var c=function Dialog(e){var n=e.children,t=e.type,r=e.onClose,a=o(e,[\"children\",\"type\",\"onClose\"]);var i=l(s.useState(null),2),c=i[0],f=i[1];var d=s.useCallback((function(e){f(e)}),[]);(0,u.useOnClickOutside)(c,r);s.useEffect((function(){if(c==null){return}var e=c.getRootNode();if(!(e instanceof ShadowRoot)){return}var n=e;function handler(e){var t=n.activeElement;if(e.key===\"Enter\"&&t instanceof HTMLElement&&t.getAttribute(\"role\")===\"link\"){e.preventDefault();e.stopPropagation();t.click()}}n.addEventListener(\"keydown\",handler);return function(){return n.removeEventListener(\"keydown\",handler)}}),[c]);return s.createElement(\"div\",{ref:d,\"data-nextjs-dialog\":true,tabIndex:-1,role:\"dialog\",\"aria-labelledby\":a[\"aria-labelledby\"],\"aria-describedby\":a[\"aria-describedby\"],\"aria-modal\":\"true\"},s.createElement(\"div\",{\"data-nextjs-dialog-banner\":true,className:\"banner-\".concat(t)}),n)};n.Dialog=c},11:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};n.__esModule=true;n.DialogBody=void 0;var o=i(t(522));var l=function DialogBody(e){var n=e.children,t=e.className;return o.createElement(\"div\",{\"data-nextjs-dialog-body\":true,className:t},n)};n.DialogBody=l},991:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};n.__esModule=true;n.DialogContent=void 0;var o=i(t(522));var l=function DialogContent(e){var n=e.children,t=e.className;return o.createElement(\"div\",{\"data-nextjs-dialog-content\":true,className:t},n)};n.DialogContent=l},342:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};n.__esModule=true;n.DialogHeader=void 0;var o=i(t(522));var l=function DialogHeader(e){var n=e.children,t=e.className;return o.createElement(\"div\",{\"data-nextjs-dialog-header\":true,className:t},n)};n.DialogHeader=l},651:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});n.__esModule=true;n.styles=n.DialogHeader=n.DialogContent=n.DialogBody=n.Dialog=void 0;var a=t(616);r(n,a,\"Dialog\");var i=t(11);r(n,i,\"DialogBody\");var o=t(991);r(n,o,\"DialogContent\");var l=t(342);r(n,l,\"DialogHeader\");var s=t(213);r(n,s,\"styles\")},213:function(e,n,t){\"use strict\";var r=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,\"raw\",{value:n})}else{e.raw=n}return e};n.__esModule=true;n.styles=void 0;var a=t(910);var i=(0,a.noop)(o||(o=r([\"\\n [data-nextjs-dialog] {\\n display: flex;\\n flex-direction: column;\\n width: 100%;\\n margin-right: auto;\\n margin-left: auto;\\n outline: none;\\n background: white;\\n border-radius: var(--size-gap);\\n box-shadow: 0 var(--size-gap-half) var(--size-gap-double)\\n rgba(0, 0, 0, 0.25);\\n max-height: calc(100% - 56px);\\n overflow-y: hidden;\\n }\\n\\n @media (max-height: 812px) {\\n [data-nextjs-dialog-overlay] {\\n max-height: calc(100% - 15px);\\n }\\n }\\n\\n @media (min-width: 576px) {\\n [data-nextjs-dialog] {\\n max-width: 540px;\\n box-shadow: 0 var(--size-gap) var(--size-gap-quad) rgba(0, 0, 0, 0.25);\\n }\\n }\\n\\n @media (min-width: 768px) {\\n [data-nextjs-dialog] {\\n max-width: 720px;\\n }\\n }\\n\\n @media (min-width: 992px) {\\n [data-nextjs-dialog] {\\n max-width: 960px;\\n }\\n }\\n\\n [data-nextjs-dialog-banner] {\\n position: relative;\\n }\\n [data-nextjs-dialog-banner].banner-warning {\\n border-color: var(--color-ansi-yellow);\\n }\\n [data-nextjs-dialog-banner].banner-error {\\n border-color: var(--color-ansi-red);\\n }\\n\\n [data-nextjs-dialog-banner]::after {\\n z-index: 2;\\n content: '';\\n position: absolute;\\n top: 0;\\n right: 0;\\n width: 100%;\\n /* banner width: */\\n border-top-width: var(--size-gap-half);\\n border-bottom-width: 0;\\n border-top-style: solid;\\n border-bottom-style: solid;\\n border-top-color: inherit;\\n border-bottom-color: transparent;\\n }\\n\\n [data-nextjs-dialog-content] {\\n overflow-y: auto;\\n border: none;\\n margin: 0;\\n /* calc(padding + banner width offset) */\\n padding: calc(var(--size-gap-double) + var(--size-gap-half))\\n var(--size-gap-double);\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n }\\n [data-nextjs-dialog-content] > [data-nextjs-dialog-header] {\\n flex-shrink: 0;\\n margin-bottom: var(--size-gap-double);\\n }\\n [data-nextjs-dialog-content] > [data-nextjs-dialog-body] {\\n position: relative;\\n flex: 1 1 auto;\\n }\\n\"],[\"\\n [data-nextjs-dialog] {\\n display: flex;\\n flex-direction: column;\\n width: 100%;\\n margin-right: auto;\\n margin-left: auto;\\n outline: none;\\n background: white;\\n border-radius: var(--size-gap);\\n box-shadow: 0 var(--size-gap-half) var(--size-gap-double)\\n rgba(0, 0, 0, 0.25);\\n max-height: calc(100% - 56px);\\n overflow-y: hidden;\\n }\\n\\n @media (max-height: 812px) {\\n [data-nextjs-dialog-overlay] {\\n max-height: calc(100% - 15px);\\n }\\n }\\n\\n @media (min-width: 576px) {\\n [data-nextjs-dialog] {\\n max-width: 540px;\\n box-shadow: 0 var(--size-gap) var(--size-gap-quad) rgba(0, 0, 0, 0.25);\\n }\\n }\\n\\n @media (min-width: 768px) {\\n [data-nextjs-dialog] {\\n max-width: 720px;\\n }\\n }\\n\\n @media (min-width: 992px) {\\n [data-nextjs-dialog] {\\n max-width: 960px;\\n }\\n }\\n\\n [data-nextjs-dialog-banner] {\\n position: relative;\\n }\\n [data-nextjs-dialog-banner].banner-warning {\\n border-color: var(--color-ansi-yellow);\\n }\\n [data-nextjs-dialog-banner].banner-error {\\n border-color: var(--color-ansi-red);\\n }\\n\\n [data-nextjs-dialog-banner]::after {\\n z-index: 2;\\n content: '';\\n position: absolute;\\n top: 0;\\n right: 0;\\n width: 100%;\\n /* banner width: */\\n border-top-width: var(--size-gap-half);\\n border-bottom-width: 0;\\n border-top-style: solid;\\n border-bottom-style: solid;\\n border-top-color: inherit;\\n border-bottom-color: transparent;\\n }\\n\\n [data-nextjs-dialog-content] {\\n overflow-y: auto;\\n border: none;\\n margin: 0;\\n /* calc(padding + banner width offset) */\\n padding: calc(var(--size-gap-double) + var(--size-gap-half))\\n var(--size-gap-double);\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n }\\n [data-nextjs-dialog-content] > [data-nextjs-dialog-header] {\\n flex-shrink: 0;\\n margin-bottom: var(--size-gap-double);\\n }\\n [data-nextjs-dialog-content] > [data-nextjs-dialog-body] {\\n position: relative;\\n flex: 1 1 auto;\\n }\\n\"])));n.styles=i;var o},831:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};var o=this&&this.__read||function(e,n){var t=typeof Symbol===\"function\"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),a,i=[],o;try{while((n===void 0||n-- >0)&&!(a=r.next()).done)i.push(a.value)}catch(e){o={error:e}}finally{try{if(a&&!a.done&&(t=r[\"return\"]))t.call(r)}finally{if(o)throw o.error}}return i};n.__esModule=true;n.LeftRightDialogHeader=void 0;var l=i(t(522));var s=t(865);var u=function LeftRightDialogHeader(e){var n=e.children,t=e.className,r=e.previous,a=e.next,i=e.close;var u=l.useRef(null);var c=l.useRef(null);var f=l.useRef(null);var d=o(l.useState(null),2),p=d[0],b=d[1];var v=l.useCallback((function(e){b(e)}),[]);l.useEffect((function(){if(p==null){return}var e=p.getRootNode();var n=self.document;function handler(n){if(n.key===\"ArrowLeft\"){n.stopPropagation();if(u.current){u.current.focus()}r&&r()}else if(n.key===\"ArrowRight\"){n.stopPropagation();if(c.current){c.current.focus()}a&&a()}else if(n.key===\"Escape\"){n.stopPropagation();if(e instanceof ShadowRoot){var t=e.activeElement;if(t&&t!==f.current&&t instanceof HTMLElement){t.blur();return}}if(i){i()}}}e.addEventListener(\"keydown\",handler);if(e!==n){n.addEventListener(\"keydown\",handler)}return function(){e.removeEventListener(\"keydown\",handler);if(e!==n){n.removeEventListener(\"keydown\",handler)}}}),[i,p,a,r]);l.useEffect((function(){if(p==null){return}var e=p.getRootNode();if(e instanceof ShadowRoot){var n=e.activeElement;if(r==null){if(u.current&&n===u.current){u.current.blur()}}else if(a==null){if(c.current&&n===c.current){c.current.blur()}}}}),[p,a,r]);return l.createElement(\"div\",{\"data-nextjs-dialog-left-right\":true,className:t},l.createElement(\"nav\",{ref:v},l.createElement(\"button\",{ref:u,type:\"button\",disabled:r==null?true:undefined,\"aria-disabled\":r==null?true:undefined,onClick:r!==null&&r!==void 0?r:undefined},l.createElement(\"svg\",{viewBox:\"0 0 14 14\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},l.createElement(\"path\",{d:\"M6.99996 1.16666L1.16663 6.99999L6.99996 12.8333M12.8333 6.99999H1.99996H12.8333Z\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}))),l.createElement(\"button\",{ref:c,type:\"button\",disabled:a==null?true:undefined,\"aria-disabled\":a==null?true:undefined,onClick:a!==null&&a!==void 0?a:undefined},l.createElement(\"svg\",{viewBox:\"0 0 14 14\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},l.createElement(\"path\",{d:\"M6.99996 1.16666L12.8333 6.99999L6.99996 12.8333M1.16663 6.99999H12H1.16663Z\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}))),\" \",n),i?l.createElement(\"button\",{\"data-nextjs-errors-dialog-left-right-close-button\":true,ref:f,type:\"button\",onClick:i,\"aria-label\":\"Close\"},l.createElement(\"span\",{\"aria-hidden\":\"true\"},l.createElement(s.CloseIcon,null))):null)};n.LeftRightDialogHeader=u},732:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});n.__esModule=true;n.styles=n.LeftRightDialogHeader=void 0;var a=t(831);r(n,a,\"LeftRightDialogHeader\");var i=t(543);r(n,i,\"styles\")},543:function(e,n,t){\"use strict\";var r=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,\"raw\",{value:n})}else{e.raw=n}return e};n.__esModule=true;n.styles=void 0;var a=t(910);var i=(0,a.noop)(o||(o=r([\"\\n [data-nextjs-dialog-left-right] {\\n display: flex;\\n flex-direction: row;\\n align-content: center;\\n align-items: center;\\n justify-content: space-between;\\n }\\n [data-nextjs-dialog-left-right] > nav > button {\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n\\n width: calc(var(--size-gap-double) + var(--size-gap));\\n height: calc(var(--size-gap-double) + var(--size-gap));\\n font-size: 0;\\n border: none;\\n background-color: rgba(255, 85, 85, 0.1);\\n color: var(--color-ansi-red);\\n cursor: pointer;\\n transition: background-color 0.25s ease;\\n }\\n [data-nextjs-dialog-left-right] > nav > button > svg {\\n width: auto;\\n height: calc(var(--size-gap) + var(--size-gap-half));\\n }\\n [data-nextjs-dialog-left-right] > nav > button:hover {\\n background-color: rgba(255, 85, 85, 0.2);\\n }\\n [data-nextjs-dialog-left-right] > nav > button:disabled {\\n background-color: rgba(255, 85, 85, 0.1);\\n color: rgba(255, 85, 85, 0.4);\\n cursor: not-allowed;\\n }\\n\\n [data-nextjs-dialog-left-right] > nav > button:first-of-type {\\n border-radius: var(--size-gap-half) 0 0 var(--size-gap-half);\\n margin-right: 1px;\\n }\\n [data-nextjs-dialog-left-right] > nav > button:last-of-type {\\n border-radius: 0 var(--size-gap-half) var(--size-gap-half) 0;\\n }\\n\\n [data-nextjs-dialog-left-right] > button:last-of-type {\\n border: 0;\\n padding: 0;\\n\\n background-color: transparent;\\n appearance: none;\\n\\n opacity: 0.4;\\n transition: opacity 0.25s ease;\\n }\\n [data-nextjs-dialog-left-right] > button:last-of-type:hover {\\n opacity: 0.7;\\n }\\n\"],[\"\\n [data-nextjs-dialog-left-right] {\\n display: flex;\\n flex-direction: row;\\n align-content: center;\\n align-items: center;\\n justify-content: space-between;\\n }\\n [data-nextjs-dialog-left-right] > nav > button {\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n\\n width: calc(var(--size-gap-double) + var(--size-gap));\\n height: calc(var(--size-gap-double) + var(--size-gap));\\n font-size: 0;\\n border: none;\\n background-color: rgba(255, 85, 85, 0.1);\\n color: var(--color-ansi-red);\\n cursor: pointer;\\n transition: background-color 0.25s ease;\\n }\\n [data-nextjs-dialog-left-right] > nav > button > svg {\\n width: auto;\\n height: calc(var(--size-gap) + var(--size-gap-half));\\n }\\n [data-nextjs-dialog-left-right] > nav > button:hover {\\n background-color: rgba(255, 85, 85, 0.2);\\n }\\n [data-nextjs-dialog-left-right] > nav > button:disabled {\\n background-color: rgba(255, 85, 85, 0.1);\\n color: rgba(255, 85, 85, 0.4);\\n cursor: not-allowed;\\n }\\n\\n [data-nextjs-dialog-left-right] > nav > button:first-of-type {\\n border-radius: var(--size-gap-half) 0 0 var(--size-gap-half);\\n margin-right: 1px;\\n }\\n [data-nextjs-dialog-left-right] > nav > button:last-of-type {\\n border-radius: 0 var(--size-gap-half) var(--size-gap-half) 0;\\n }\\n\\n [data-nextjs-dialog-left-right] > button:last-of-type {\\n border: 0;\\n padding: 0;\\n\\n background-color: transparent;\\n appearance: none;\\n\\n opacity: 0.4;\\n transition: opacity 0.25s ease;\\n }\\n [data-nextjs-dialog-left-right] > button:last-of-type:hover {\\n opacity: 0.7;\\n }\\n\"])));n.styles=i;var o},17:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};var o=this&&this.__read||function(e,n){var t=typeof Symbol===\"function\"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),a,i=[],o;try{while((n===void 0||n-- >0)&&!(a=r.next()).done)i.push(a.value)}catch(e){o={error:e}}finally{try{if(a&&!a.done&&(t=r[\"return\"]))t.call(r)}finally{if(o)throw o.error}}return i};var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=true;n.Overlay=void 0;var s=l(t(975));var u=i(t(522));var c=t(800);var f=function Overlay(e){var n=e.className,t=e.children,r=e.fixed;u.useEffect((function(){(0,c.lock)();return function(){(0,c.unlock)()}}),[]);var a=o(u.useState(null),2),i=a[0],l=a[1];var f=u.useCallback((function(e){l(e)}),[]);u.useEffect((function(){if(i==null){return}var e=(0,s[\"default\"])({context:i});return function(){e.disengage()}}),[i]);return u.createElement(\"div\",{\"data-nextjs-dialog-overlay\":true,className:n,ref:f},u.createElement(\"div\",{\"data-nextjs-dialog-backdrop\":true,\"data-nextjs-dialog-backdrop-fixed\":r?true:undefined}),t)};n.Overlay=f},800:function(e,n){\"use strict\";n.__esModule=true;n.unlock=n.lock=void 0;var t;var r;var a=0;function lock(){setTimeout((function(){if(a++>0){return}var e=window.innerWidth-document.documentElement.clientWidth;if(e>0){t=document.body.style.paddingRight;document.body.style.paddingRight=\"\".concat(e,\"px\")}r=document.body.style.overflow;document.body.style.overflow=\"hidden\"}))}n.lock=lock;function unlock(){setTimeout((function(){if(a===0||--a!==0){return}if(t!==undefined){document.body.style.paddingRight=t;t=undefined}if(r!==undefined){document.body.style.overflow=r;r=undefined}}))}n.unlock=unlock},278:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});n.__esModule=true;n.Overlay=void 0;var a=t(17);r(n,a,\"Overlay\")},975:function(e,n,t){\"use strict\";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=true;var a=r(t(541));var i=r(t(553));function nodeArray(e){if(!e){return[]}if(Array.isArray(e)){return e}if(e.nodeType!==undefined){return[e]}if(typeof e===\"string\"){e=document.querySelectorAll(e)}if(e.length!==undefined){return[].slice.call(e,0)}throw new TypeError(\"unexpected input \"+String(e))}function contextToElement(e){var n=e.context,t=e.label,r=t===undefined?\"context-to-element\":t,a=e.resolveDocument,i=e.defaultToDocument;var o=nodeArray(n)[0];if(a&&o&&o.nodeType===Node.DOCUMENT_NODE){o=o.documentElement}if(!o&&i){return document.documentElement}if(!o){throw new TypeError(r+\" requires valid options.context\")}if(o.nodeType!==Node.ELEMENT_NODE&&o.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){throw new TypeError(r+\" requires options.context to be an Element\")}return o}function getShadowHost(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context;var t=contextToElement({label:\"get/shadow-host\",context:n});var r=null;while(t){r=t;t=t.parentNode}if(r.nodeType===r.DOCUMENT_FRAGMENT_NODE&&r.host){return r.host}return null}function getDocument(e){if(!e){return document}if(e.nodeType===Node.DOCUMENT_NODE){return e}return e.ownerDocument||document}function isActiveElement(e){var n=contextToElement({label:\"is/active-element\",resolveDocument:true,context:e});var t=getDocument(n);if(t.activeElement===n){return true}var r=getShadowHost({context:n});if(r&&r.shadowRoot.activeElement===n){return true}return false}function getParents(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context;var t=[];var r=contextToElement({label:\"get/parents\",context:n});while(r){t.push(r);r=r.parentNode;if(r&&r.nodeType!==Node.ELEMENT_NODE){r=null}}return t}var o=[\"matches\",\"webkitMatchesSelector\",\"mozMatchesSelector\",\"msMatchesSelector\"];var l=null;function findMethodName(e){o.some((function(n){if(!e[n]){return false}l=n;return true}))}function elementMatches(e,n){if(!l){findMethodName(e)}return e[l](n)}var s=JSON.parse(JSON.stringify(a[\"default\"]));var u=s.os.family||\"\";var c=u===\"Android\";var f=u.slice(0,7)===\"Windows\";var d=u===\"OS X\";var p=u===\"iOS\";var b=s.layout===\"Blink\";var v=s.layout===\"Gecko\";var m=s.layout===\"Trident\";var g=s.layout===\"EdgeHTML\";var h=s.layout===\"WebKit\";var y=parseFloat(s.version);var x=Math.floor(y);s.majorVersion=x;s.is={ANDROID:c,WINDOWS:f,OSX:d,IOS:p,BLINK:b,GECKO:v,TRIDENT:m,EDGE:g,WEBKIT:h,IE9:m&&x===9,IE10:m&&x===10,IE11:m&&x===11};function before(){var e={activeElement:document.activeElement,windowScrollTop:window.scrollTop,windowScrollLeft:window.scrollLeft,bodyScrollTop:document.body.scrollTop,bodyScrollLeft:document.body.scrollLeft};var n=document.createElement(\"iframe\");n.setAttribute(\"style\",\"position:absolute; position:fixed; top:0; left:-2px; width:1px; height:1px; overflow:hidden;\");n.setAttribute(\"aria-live\",\"off\");n.setAttribute(\"aria-busy\",\"true\");n.setAttribute(\"aria-hidden\",\"true\");document.body.appendChild(n);var t=n.contentWindow;var r=t.document;r.open();r.close();var a=r.createElement(\"div\");r.body.appendChild(a);e.iframe=n;e.wrapper=a;e.window=t;e.document=r;return e}function test(e,n){e.wrapper.innerHTML=\"\";var t=typeof n.element===\"string\"?e.document.createElement(n.element):n.element(e.wrapper,e.document);var r=n.mutate&&n.mutate(t,e.wrapper,e.document);if(!r&&r!==false){r=t}!t.parentNode&&e.wrapper.appendChild(t);r&&r.focus&&r.focus();return n.validate?n.validate(t,r,e.document):e.document.activeElement===r}function after(e){if(e.activeElement===document.body){document.activeElement&&document.activeElement.blur&&document.activeElement.blur();if(s.is.IE10){document.body.focus()}}else{e.activeElement&&e.activeElement.focus&&e.activeElement.focus()}document.body.removeChild(e.iframe);window.scrollTop=e.windowScrollTop;window.scrollLeft=e.windowScrollLeft;document.body.scrollTop=e.bodyScrollTop;document.body.scrollLeft=e.bodyScrollLeft}function detectFocus(e){var n=before();var t={};Object.keys(e).map((function(r){t[r]=test(n,e[r])}));after(n);return t}var w=\"1.4.1\";function readLocalStorage(e){var n=void 0;try{n=window.localStorage&&window.localStorage.getItem(e);n=n?JSON.parse(n):{}}catch(e){n={}}return n}function writeLocalStorage(e,n){if(!document.hasFocus()){try{window.localStorage&&window.localStorage.removeItem(e)}catch(e){}return}try{window.localStorage&&window.localStorage.setItem(e,JSON.stringify(n))}catch(e){}}var _=typeof window!==\"undefined\"&&window.navigator.userAgent||\"\";var E=\"ally-supports-cache\";var O=readLocalStorage(E);if(O.userAgent!==_||O.version!==w){O={}}O.userAgent=_;O.version=w;var S={get:function get(){return O},set:function set(e){Object.keys(e).forEach((function(n){O[n]=e[n]}));O.time=(new Date).toISOString();writeLocalStorage(E,O)}};function cssShadowPiercingDeepCombinator(){var e=void 0;try{document.querySelector(\"html >>> :first-child\");e=\">>>\"}catch(n){try{document.querySelector(\"html /deep/ :first-child\");e=\"/deep/\"}catch(n){e=\"\"}}return e}var j=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";var k={element:\"div\",mutate:function mutate(e){e.innerHTML=''+''+'\"\"';return e.querySelector(\"area\")}};var T={element:\"div\",mutate:function mutate(e){e.innerHTML=''+''+'\"\"';return false},validate:function validate(e,n,t){if(s.is.GECKO){return true}var r=e.querySelector(\"area\");r.focus();return t.activeElement===r}};var C={element:\"div\",mutate:function mutate(e){e.innerHTML=''+''+'\"\"';return e.querySelector(\"area\")},validate:function validate(e,n,t){if(s.is.GECKO){return true}return t.activeElement===n}};var M={name:\"can-focus-audio-without-controls\",element:\"audio\",mutate:function mutate(e){try{e.setAttribute(\"src\",j)}catch(e){}}};var P=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\";var A={element:\"div\",mutate:function mutate(e){e.innerHTML=''+'\"\"';return e.querySelector(\"area\")}};var D={element:\"div\",mutate:function mutate(e){e.setAttribute(\"tabindex\",\"-1\");e.setAttribute(\"style\",\"display: -webkit-flex; display: -ms-flexbox; display: flex;\");e.innerHTML='hello';return e.querySelector(\"span\")}};var N={element:\"fieldset\",mutate:function mutate(e){e.setAttribute(\"tabindex\",0);e.setAttribute(\"disabled\",\"disabled\")}};var z={element:\"fieldset\",mutate:function mutate(e){e.innerHTML=\"legend

content

\"}};var I={element:\"span\",mutate:function mutate(e){e.setAttribute(\"style\",\"display: -webkit-flex; display: -ms-flexbox; display: flex;\");e.innerHTML='hello'}};var R={element:\"form\",mutate:function mutate(e){e.setAttribute(\"tabindex\",0);e.setAttribute(\"disabled\",\"disabled\")}};var F={element:\"a\",mutate:function mutate(e){e.href=\"#void\";e.innerHTML='\"\"';return e.querySelector(\"img\")}};var L={element:\"div\",mutate:function mutate(e){e.innerHTML=''+'\"\"';return e.querySelector(\"img\")}};var B={element:function element(e,n){var t=n.createElement(\"iframe\");e.appendChild(t);var r=t.contentWindow.document;r.open();r.close();return t},mutate:function mutate(e){e.style.visibility=\"hidden\";var n=e.contentWindow.document;var t=n.createElement(\"input\");n.body.appendChild(t);return t},validate:function validate(e){var n=e.contentWindow.document;var t=n.querySelector(\"input\");return n.activeElement===t}};var H=!s.is.WEBKIT;function focusInZeroDimensionObject(){return H}var W={element:\"div\",mutate:function mutate(e){e.setAttribute(\"tabindex\",\"invalid-value\")}};var q={element:\"label\",mutate:function mutate(e){e.setAttribute(\"tabindex\",\"-1\")},validate:function validate(e,n,t){var r=e.offsetHeight;e.focus();return t.activeElement===e}};var G=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtb\"+\"G5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBpZD0ic3ZnIj48dGV4dCB4PSIxMCIgeT0iMjAiIGlkPSJ\"+\"zdmctbGluay10ZXh0Ij50ZXh0PC90ZXh0Pjwvc3ZnPg==\";var U={element:\"object\",mutate:function mutate(e){e.setAttribute(\"type\",\"image/svg+xml\");e.setAttribute(\"data\",G);e.setAttribute(\"width\",\"200\");e.setAttribute(\"height\",\"50\");e.style.visibility=\"hidden\"}};var V={name:\"can-focus-object-svg\",element:\"object\",mutate:function mutate(e){e.setAttribute(\"type\",\"image/svg+xml\");e.setAttribute(\"data\",G);e.setAttribute(\"width\",\"200\");e.setAttribute(\"height\",\"50\")},validate:function validate(e,n,t){if(s.is.GECKO){return true}return t.activeElement===e}};var K=!s.is.IE9;function focusObjectSwf(){return K}var Z={element:\"div\",mutate:function mutate(e){e.innerHTML=''+'\"\"';return e.querySelector(\"img\")},validate:function validate(e,n,t){var r=e.querySelector(\"area\");return t.activeElement===r}};var $={element:\"fieldset\",mutate:function mutate(e){e.innerHTML='legend';return false},validate:function validate(e,n,t){var r=e.querySelector('input[tabindex=\"-1\"]');var a=e.querySelector('input[tabindex=\"0\"]');e.focus();e.querySelector(\"legend\").focus();return t.activeElement===r&&\"focusable\"||t.activeElement===a&&\"tabbable\"||\"\"}};var X={element:\"div\",mutate:function mutate(e){e.setAttribute(\"style\",\"width: 100px; height: 50px; overflow: auto;\");e.innerHTML='
scrollable content
';return e.querySelector(\"div\")}};var J={element:\"div\",mutate:function mutate(e){e.setAttribute(\"style\",\"width: 100px; height: 50px;\");e.innerHTML='
scrollable content
'}};var Y={element:\"div\",mutate:function mutate(e){e.setAttribute(\"style\",\"width: 100px; height: 50px; overflow: auto;\");e.innerHTML='
scrollable content
'}};var Q={element:\"details\",mutate:function mutate(e){e.innerHTML=\"foo

content

\";return e.firstElementChild}};function makeFocusableForeignObject(){var e=document.createElementNS(\"http://www.w3.org/2000/svg\",\"foreignObject\");e.width.baseVal.value=30;e.height.baseVal.value=30;e.appendChild(document.createElement(\"input\"));e.lastChild.type=\"text\";return e}function focusSvgForeignObjectHack(e){var n=e.ownerSVGElement||e.nodeName.toLowerCase()===\"svg\";if(!n){return false}var t=makeFocusableForeignObject();e.appendChild(t);var r=t.querySelector(\"input\");r.focus();r.disabled=true;e.removeChild(t);return true}function generate(e){return''+e+\"\"}function focus(e){if(e.focus){return}try{HTMLElement.prototype.focus.call(e)}catch(n){focusSvgForeignObjectHack(e)}}function validate(e,n,t){focus(n);return t.activeElement===n}var ee={element:\"div\",mutate:function mutate(e){e.innerHTML=generate('a');return e.querySelector(\"text\")},validate:validate};var ne={element:\"div\",mutate:function mutate(e){e.innerHTML=generate('a');return e.querySelector(\"text\")},validate:validate};var te={element:\"div\",mutate:function mutate(e){e.innerHTML=generate('a');return e.querySelector(\"text\")},validate:validate};var re={element:\"div\",mutate:function mutate(e){e.innerHTML=generate(['link',''].join(\"\"));return e.querySelector(\"use\")},validate:validate};var ae={element:\"div\",mutate:function mutate(e){e.innerHTML=generate('');return e.querySelector(\"foreignObject\")||e.getElementsByTagName(\"foreignObject\")[0]},validate:validate};var ie=Boolean(s.is.GECKO&&typeof SVGElement!==\"undefined\"&&SVGElement.prototype.focus);function focusSvgInIframe(){return ie}var oe={element:\"div\",mutate:function mutate(e){e.innerHTML=generate(\"\");return e.firstChild},validate:validate};var le={element:\"div\",mutate:function mutate(e){e.setAttribute(\"tabindex\",\"3x\")}};var se={element:\"table\",mutate:function mutate(e,n,t){var r=t.createDocumentFragment();r.innerHTML=\"cell\";e.appendChild(r)}};var ue={element:\"video\",mutate:function mutate(e){try{e.setAttribute(\"src\",j)}catch(e){}}};var ce=s.is.GECKO||s.is.TRIDENT||s.is.EDGE;function tabsequenceAreaAtImgPosition(){return ce}var fe={cssShadowPiercingDeepCombinator:cssShadowPiercingDeepCombinator,focusInZeroDimensionObject:focusInZeroDimensionObject,focusObjectSwf:focusObjectSwf,focusSvgInIframe:focusSvgInIframe,tabsequenceAreaAtImgPosition:tabsequenceAreaAtImgPosition};var de={focusAreaImgTabindex:k,focusAreaTabindex:T,focusAreaWithoutHref:C,focusAudioWithoutControls:M,focusBrokenImageMap:A,focusChildrenOfFocusableFlexbox:D,focusFieldsetDisabled:N,focusFieldset:z,focusFlexboxContainer:I,focusFormDisabled:R,focusImgIsmap:F,focusImgUsemapTabindex:L,focusInHiddenIframe:B,focusInvalidTabindex:W,focusLabelTabindex:q,focusObjectSvg:V,focusObjectSvgHidden:U,focusRedirectImgUsemap:Z,focusRedirectLegend:$,focusScrollBody:X,focusScrollContainerWithoutOverflow:J,focusScrollContainer:Y,focusSummary:Q,focusSvgFocusableAttribute:ee,focusSvgTabindexAttribute:ne,focusSvgNegativeTabindexAttribute:te,focusSvgUseTabindex:re,focusSvgForeignobjectTabindex:ae,focusSvg:oe,focusTabindexTrailingCharacters:le,focusTable:se,focusVideoWithoutControls:ue};function executeTests(){var e=detectFocus(de);Object.keys(fe).forEach((function(n){e[n]=fe[n]()}));return e}var pe=null;function _supports(){if(pe){return pe}pe=S.get();if(!pe.time){S.set(executeTests());pe=S.get()}return pe}var be=void 0;var ve=/^\\s*(-|\\+)?[0-9]+\\s*$/;var me=/^\\s*(-|\\+)?[0-9]+.*$/;function isValidTabindex(e){if(!be){be=_supports()}var n=be.focusTabindexTrailingCharacters?me:ve;var t=contextToElement({label:\"is/valid-tabindex\",resolveDocument:true,context:e});var r=t.hasAttribute(\"tabindex\");var a=t.hasAttribute(\"tabIndex\");if(!r&&!a){return false}var i=t.ownerSVGElement||t.nodeName.toLowerCase()===\"svg\";if(i&&!be.focusSvgTabindexAttribute){return false}if(be.focusInvalidTabindex){return true}var o=t.getAttribute(r?\"tabindex\":\"tabIndex\");if(o===\"-32768\"){return false}return Boolean(o&&n.test(o))}function tabindexValue(e){if(!isValidTabindex(e)){return null}var n=e.hasAttribute(\"tabindex\");var t=n?\"tabindex\":\"tabIndex\";var r=parseInt(e.getAttribute(t),10);return isNaN(r)?-1:r}function isUserModifyWritable(e){var n=e.webkitUserModify||\"\";return Boolean(n&&n.indexOf(\"write\")!==-1)}function hasCssOverflowScroll(e){return[e.getPropertyValue(\"overflow\"),e.getPropertyValue(\"overflow-x\"),e.getPropertyValue(\"overflow-y\")].some((function(e){return e===\"auto\"||e===\"scroll\"}))}function hasCssDisplayFlex(e){return e.display.indexOf(\"flex\")>-1}function isScrollableContainer(e,n,t,r){if(n!==\"div\"&&n!==\"span\"){return false}if(t&&t!==\"div\"&&t!==\"span\"&&!hasCssOverflowScroll(r)){return false}return e.offsetHeight0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.except,r=t===undefined?{flexbox:false,scrollable:false,shadow:false}:t;if(!ge){ge=_supports()}var a=contextToElement({label:\"is/focus-relevant\",resolveDocument:true,context:n});if(!r.shadow&&a.shadowRoot){return true}var i=a.nodeName.toLowerCase();if(i===\"input\"&&a.type===\"hidden\"){return false}if(i===\"input\"||i===\"select\"||i===\"button\"||i===\"textarea\"){return true}if(i===\"legend\"&&ge.focusRedirectLegend){return true}if(i===\"label\"){return true}if(i===\"area\"){return true}if(i===\"a\"&&a.hasAttribute(\"href\")){return true}if(i===\"object\"&&a.hasAttribute(\"usemap\")){return false}if(i===\"object\"){var o=a.getAttribute(\"type\");if(!ge.focusObjectSvg&&o===\"image/svg+xml\"){return false}else if(!ge.focusObjectSwf&&o===\"application/x-shockwave-flash\"){return false}}if(i===\"iframe\"||i===\"object\"){return true}if(i===\"embed\"||i===\"keygen\"){return true}if(a.hasAttribute(\"contenteditable\")){return true}if(i===\"audio\"&&(ge.focusAudioWithoutControls||a.hasAttribute(\"controls\"))){return true}if(i===\"video\"&&(ge.focusVideoWithoutControls||a.hasAttribute(\"controls\"))){return true}if(ge.focusSummary&&i===\"summary\"){return true}var l=isValidTabindex(a);if(i===\"img\"&&a.hasAttribute(\"usemap\")){return l&&ge.focusImgUsemapTabindex||ge.focusRedirectImgUsemap}if(ge.focusTable&&(i===\"table\"||i===\"td\")){return true}if(ge.focusFieldset&&i===\"fieldset\"){return true}var s=i===\"svg\";var u=a.ownerSVGElement;var c=a.getAttribute(\"focusable\");var f=tabindexValue(a);if(i===\"use\"&&f!==null&&!ge.focusSvgUseTabindex){return false}if(i===\"foreignobject\"){return f!==null&&ge.focusSvgForeignobjectTabindex}if(elementMatches(a,\"svg a\")&&a.hasAttribute(\"xlink:href\")){return true}if((s||u)&&a.focus&&!ge.focusSvgNegativeTabindexAttribute&&f<0){return false}if(s){return l||ge.focusSvg||ge.focusSvgInIframe||Boolean(ge.focusSvgFocusableAttribute&&c&&c===\"true\")}if(u){if(ge.focusSvgTabindexAttribute&&l){return true}if(ge.focusSvgFocusableAttribute){return c===\"true\"}}if(l){return true}var d=window.getComputedStyle(a,null);if(isUserModifyWritable(d)){return true}if(ge.focusImgIsmap&&i===\"img\"&&a.hasAttribute(\"ismap\")){var p=getParents({context:a}).some((function(e){return e.nodeName.toLowerCase()===\"a\"&&e.hasAttribute(\"href\")}));if(p){return true}}if(!r.scrollable&&ge.focusScrollContainer){if(ge.focusScrollContainerWithoutOverflow){if(isScrollableContainer(a,i)){return true}}else if(hasCssOverflowScroll(d)){return true}}if(!r.flexbox&&ge.focusFlexboxContainer&&hasCssDisplayFlex(d)){return true}var b=a.parentElement;if(!r.scrollable&&b){var v=b.nodeName.toLowerCase();var m=window.getComputedStyle(b,null);if(ge.focusScrollBody&&isScrollableContainer(b,i,v,m)){return true}if(ge.focusChildrenOfFocusableFlexbox){if(hasCssDisplayFlex(m)){return true}}}return false}isFocusRelevantRules.except=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=function isFocusRelevant(n){return isFocusRelevantRules({context:n,except:e})};n.rules=isFocusRelevantRules;return n};var he=isFocusRelevantRules.except({});function findIndex(e,n){if(e.findIndex){return e.findIndex(n)}var t=e.length;if(t===0){return-1}for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.except,r=t===undefined?{notRendered:false,cssDisplay:false,cssVisibility:false,detailsElement:false,browsingContext:false}:t;var a=contextToElement({label:\"is/visible\",resolveDocument:true,context:n});var i=a.nodeName.toLowerCase();if(!r.notRendered&&we.test(i)){return true}var o=getParents({context:a});var l=i===\"audio\"&&!a.hasAttribute(\"controls\");if(!r.cssDisplay&¬Displayed(l?o.slice(1):o)){return false}if(!r.cssVisibility&¬Visible(o)){return false}if(!r.detailsElement&&collapsedParent(o)){return false}if(!r.browsingContext){var s=getFrameElement(a);var u=isVisibleRules.except(r);if(s&&!u(s)){return false}}return true}isVisibleRules.except=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=function isVisible(n){return isVisibleRules({context:n,except:e})};n.rules=isVisibleRules;return n};var _e=isVisibleRules.except({});function getMapByName(e,n){var t=n.querySelector('map[name=\"'+(0,i[\"default\"])(e)+'\"]');return t||null}function getImageOfArea(e){var n=e.parentElement;if(!n.name||n.nodeName.toLowerCase()!==\"map\"){return null}var t=getDocument(e);return t.querySelector('img[usemap=\"#'+(0,i[\"default\"])(n.name)+'\"]')||null}var Ee=void 0;function isValidArea(e){if(!Ee){Ee=_supports()}var n=contextToElement({label:\"is/valid-area\",context:e});var t=n.nodeName.toLowerCase();if(t!==\"area\"){return false}var r=n.hasAttribute(\"tabindex\");if(!Ee.focusAreaTabindex&&r){return false}var a=getImageOfArea(n);if(!a||!_e(a)){return false}if(!Ee.focusBrokenImageMap&&(!a.complete||!a.naturalHeight||a.offsetWidth<=0||a.offsetHeight<=0)){return false}if(!Ee.focusAreaWithoutHref&&!n.href){return Ee.focusAreaTabindex&&r||Ee.focusAreaImgTabindex&&a.hasAttribute(\"tabindex\")}var i=getParents({context:a}).slice(1).some((function(e){var n=e.nodeName.toLowerCase();return n===\"button\"||n===\"a\"}));if(i){return false}return true}var Oe=void 0;var Se=void 0;var je={input:true,select:true,textarea:true,button:true,fieldset:true,form:true};function isNativeDisabledSupported(e){if(!Oe){Oe=_supports();if(Oe.focusFieldsetDisabled){delete je.fieldset}if(Oe.focusFormDisabled){delete je.form}Se=new RegExp(\"^(\"+Object.keys(je).join(\"|\")+\")$\")}var n=contextToElement({label:\"is/native-disabled-supported\",context:e});var t=n.nodeName.toLowerCase();return Boolean(Se.test(t))}var ke=void 0;function isDisabledFieldset(e){var n=e.nodeName.toLowerCase();return n===\"fieldset\"&&e.disabled}function isDisabledForm(e){var n=e.nodeName.toLowerCase();return n===\"form\"&&e.disabled}function isDisabled(e){if(!ke){ke=_supports()}var n=contextToElement({label:\"is/disabled\",context:e});if(n.hasAttribute(\"data-ally-disabled\")){return true}if(!isNativeDisabledSupported(n)){return false}if(n.disabled){return true}var t=getParents({context:n});if(t.some(isDisabledFieldset)){return true}if(!ke.focusFormDisabled&&t.some(isDisabledForm)){return true}return false}function isOnlyTabbableRules(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.except,r=t===undefined?{onlyFocusableBrowsingContext:false,visible:false}:t;var a=contextToElement({label:\"is/only-tabbable\",resolveDocument:true,context:n});if(!r.visible&&!_e(a)){return false}if(!r.onlyFocusableBrowsingContext&&(s.is.GECKO||s.is.TRIDENT||s.is.EDGE)){var i=getFrameElement(a);if(i){if(tabindexValue(i)<0){return false}}}var o=a.nodeName.toLowerCase();var l=tabindexValue(a);if(o===\"label\"&&s.is.GECKO){return l!==null&&l>=0}if(s.is.GECKO&&a.ownerSVGElement&&!a.focus){if(o===\"a\"&&a.hasAttribute(\"xlink:href\")){if(s.is.GECKO){return true}}}return false}isOnlyTabbableRules.except=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=function isOnlyTabbable(n){return isOnlyTabbableRules({context:n,except:e})};n.rules=isOnlyTabbableRules;return n};var Te=isOnlyTabbableRules.except({});var Ce=void 0;function isOnlyFocusRelevant(e){var n=e.nodeName.toLowerCase();if(n===\"embed\"||n===\"keygen\"){return true}var t=tabindexValue(e);if(e.shadowRoot&&t===null){return true}if(n===\"label\"){return!Ce.focusLabelTabindex||t===null}if(n===\"legend\"){return t===null}if(Ce.focusSvgFocusableAttribute&&(e.ownerSVGElement||n===\"svg\")){var r=e.getAttribute(\"focusable\");return r&&r===\"false\"}if(n===\"img\"&&e.hasAttribute(\"usemap\")){return t===null||!Ce.focusImgUsemapTabindex}if(n===\"area\"){return!isValidArea(e)}return false}function isFocusableRules(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.except,r=t===undefined?{disabled:false,visible:false,onlyTabbable:false}:t;if(!Ce){Ce=_supports()}var a=Te.rules.except({onlyFocusableBrowsingContext:true,visible:r.visible});var i=contextToElement({label:\"is/focusable\",resolveDocument:true,context:n});var o=he.rules({context:i,except:r});if(!o||isOnlyFocusRelevant(i)){return false}if(!r.disabled&&isDisabled(i)){return false}if(!r.onlyTabbable&&a(i)){return false}if(!r.visible){var l={context:i,except:{}};if(Ce.focusInHiddenIframe){l.except.browsingContext=true}if(Ce.focusObjectSvgHidden){var s=i.nodeName.toLowerCase();if(s===\"object\"){l.except.cssVisibility=true}}if(!_e.rules(l)){return false}}var u=getFrameElement(i);if(u){var c=u.nodeName.toLowerCase();if(c===\"object\"&&!Ce.focusInZeroDimensionObject){if(!u.offsetWidth||!u.offsetHeight){return false}}}var f=i.nodeName.toLowerCase();if(f===\"svg\"&&Ce.focusSvgInIframe&&!u&&i.getAttribute(\"tabindex\")===null){return false}return true}isFocusableRules.except=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=function isFocusable(n){return isFocusableRules({context:n,except:e})};n.rules=isFocusableRules;return n};var Me=isFocusableRules.except({});function createFilter(e){var n=function filter(n){if(n.shadowRoot){return NodeFilter.FILTER_ACCEPT}if(e(n)){return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP};n.acceptNode=n;return n}var Pe=createFilter(he);function queryFocusableStrict(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.includeContext,r=e.includeOnlyTabbable,a=e.strategy;if(!n){n=document.documentElement}var i=Me.rules.except({onlyTabbable:r});var o=getDocument(n);var l=o.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,a===\"all\"?Pe:createFilter(i),false);var s=[];while(l.nextNode()){if(l.currentNode.shadowRoot){if(i(l.currentNode)){s.push(l.currentNode)}s=s.concat(queryFocusableStrict({context:l.currentNode.shadowRoot,includeOnlyTabbable:r,strategy:a}))}else{s.push(l.currentNode)}}if(t){if(a===\"all\"){if(he(n)){s.unshift(n)}}else if(i(n)){s.unshift(n)}}return s}var Ae=void 0;var De=void 0;function selector$2(){if(!Ae){Ae=_supports()}if(typeof De===\"string\"){return De}De=\"\"+(Ae.focusTable?\"table, td,\":\"\")+(Ae.focusFieldset?\"fieldset,\":\"\")+\"svg a,\"+\"a[href],\"+\"area[href],\"+\"input, select, textarea, button,\"+\"iframe, object, embed,\"+\"keygen,\"+(Ae.focusAudioWithoutControls?\"audio,\":\"audio[controls],\")+(Ae.focusVideoWithoutControls?\"video,\":\"video[controls],\")+(Ae.focusSummary?\"summary,\":\"\")+\"[tabindex],\"+\"[contenteditable]\";De=selectInShadows(De);return De}function queryFocusableQuick(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.includeContext,r=e.includeOnlyTabbable;var a=selector$2();var i=n.querySelectorAll(a);var o=Me.rules.except({onlyTabbable:r});var l=[].filter.call(i,o);if(t&&o(n)){l.unshift(n)}return l}function queryFocusable(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.includeContext,r=e.includeOnlyTabbable,a=e.strategy,i=a===undefined?\"quick\":a;var o=contextToElement({label:\"query/focusable\",resolveDocument:true,defaultToDocument:true,context:n});var l={context:o,includeContext:t,includeOnlyTabbable:r,strategy:i};if(i===\"quick\"){return queryFocusableQuick(l)}else if(i===\"strict\"||i===\"all\"){return queryFocusableStrict(l)}throw new TypeError('query/focusable requires option.strategy to be one of [\"quick\", \"strict\", \"all\"]')}var Ne=void 0;var ze=/^(fieldset|table|td|body)$/;function isTabbableRules(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.except,r=t===undefined?{flexbox:false,scrollable:false,shadow:false,visible:false,onlyTabbable:false}:t;if(!Ne){Ne=_supports()}var a=contextToElement({label:\"is/tabbable\",resolveDocument:true,context:n});if(s.is.BLINK&&s.is.ANDROID&&s.majorVersion>42){return false}var i=getFrameElement(a);if(i){if(s.is.WEBKIT&&s.is.IOS){return false}if(tabindexValue(i)<0){return false}if(!r.visible&&(s.is.BLINK||s.is.WEBKIT)&&!_e(i)){return false}var o=i.nodeName.toLowerCase();if(o===\"object\"){var l=s.name===\"Chrome\"&&s.majorVersion>=54||s.name===\"Opera\"&&s.majorVersion>=41;if(s.is.WEBKIT||s.is.BLINK&&!l){return false}}}var u=a.nodeName.toLowerCase();var c=tabindexValue(a);var f=c===null?null:c>=0;if(s.is.EDGE&&s.majorVersion>=14&&i&&a.ownerSVGElement&&c<0){return true}var d=f!==false;var p=c!==null&&c>=0;if(a.hasAttribute(\"contenteditable\")){return d}if(ze.test(u)&&f!==true){return false}if(s.is.WEBKIT&&s.is.IOS){var b=u===\"input\"&&a.type===\"text\"||a.type===\"password\"||u===\"select\"||u===\"textarea\"||a.hasAttribute(\"contenteditable\");if(!b){var v=window.getComputedStyle(a,null);b=isUserModifyWritable(v)}if(!b){return false}}if(u===\"use\"&&c!==null){if(s.is.BLINK||s.is.WEBKIT&&s.majorVersion===9){return true}}if(elementMatches(a,\"svg a\")&&a.hasAttribute(\"xlink:href\")){if(d){return true}if(a.focus&&!Ne.focusSvgNegativeTabindexAttribute){return true}}if(u===\"svg\"&&Ne.focusSvgInIframe&&d){return true}if(s.is.TRIDENT||s.is.EDGE){if(u===\"svg\"){if(Ne.focusSvg){return true}return a.hasAttribute(\"focusable\")||p}if(a.ownerSVGElement){if(Ne.focusSvgTabindexAttribute&&p){return true}return a.hasAttribute(\"focusable\")}}if(a.tabIndex===undefined){return Boolean(r.onlyTabbable)}if(u===\"audio\"){if(!a.hasAttribute(\"controls\")){return false}else if(s.is.BLINK){return true}}if(u===\"video\"){if(!a.hasAttribute(\"controls\")){if(s.is.TRIDENT||s.is.EDGE){return false}}else if(s.is.BLINK||s.is.GECKO){return true}}if(u===\"object\"){if(s.is.BLINK||s.is.WEBKIT){return false}}if(u===\"iframe\"){return false}if(!r.scrollable&&s.is.GECKO){var m=window.getComputedStyle(a,null);if(hasCssOverflowScroll(m)){return d}}if(s.is.TRIDENT||s.is.EDGE){if(u===\"area\"){var g=getImageOfArea(a);if(g&&tabindexValue(g)<0){return false}}var h=window.getComputedStyle(a,null);if(isUserModifyWritable(h)){return a.tabIndex>=0}if(!r.flexbox&&hasCssDisplayFlex(h)){if(c!==null){return p}return Ie(a)&&Re(a)}if(isScrollableContainer(a,u)){return false}var y=a.parentElement;if(y){var x=y.nodeName.toLowerCase();var w=window.getComputedStyle(y,null);if(isScrollableContainer(y,u,x,w)){return false}if(hasCssDisplayFlex(w)){return p}}}return a.tabIndex>=0}isTabbableRules.except=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=function isTabbable(n){return isTabbableRules({context:n,except:e})};n.rules=isTabbableRules;return n};var Ie=he.rules.except({flexbox:true});var Re=isTabbableRules.except({flexbox:true});var Fe=isTabbableRules.except({});function queryTabbable(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.includeContext,r=e.includeOnlyTabbable,a=e.strategy;var i=Fe.rules.except({onlyTabbable:r});return queryFocusable({context:n,includeContext:t,includeOnlyTabbable:r,strategy:a}).filter(i)}function compareDomPosition(e,n){return e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function sortDomOrder(e){return e.sort(compareDomPosition)}function getFirstSuccessorOffset(e,n){return findIndex(e,(function(e){return n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING}))}function findInsertionOffsets(e,n,t){var r=[];n.forEach((function(n){var a=true;var i=e.indexOf(n);if(i===-1){i=getFirstSuccessorOffset(e,n);a=false}if(i===-1){i=e.length}var o=nodeArray(t?t(n):n);if(!o.length){return}r.push({offset:i,replace:a,elements:o})}));return r}function insertElementsAtOffsets(e,n){var t=0;n.sort((function(e,n){return e.offset-n.offset}));n.forEach((function(n){var r=n.replace?1:0;var a=[n.offset+t,r].concat(n.elements);e.splice.apply(e,a);t+=n.elements.length-r}))}function mergeInDomOrder(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.list,t=e.elements,r=e.resolveElement;var a=n.slice(0);var i=nodeArray(t).slice(0);sortDomOrder(i);var o=findInsertionOffsets(a,i,r);insertElementsAtOffsets(a,o);return a}var Le=function(){function defineProperties(e,n){for(var t=0;t-1){return[e].concat(n)}return n}},{key:\"_cleanup\",value:function _cleanup(){Object.keys(this.hosts).forEach((function(e){delete this.hosts[e]._sortingId}),this)}}]);return Shadows}();function sortShadowed(e,n,t){var r=new We(n,t);var a=r.extractElements(e);if(a.length===e.length){return t(e)}return r.sort(a)}function sortTabindex(e){var n={};var t=[];var r=e.filter((function(e){var r=e.tabIndex;if(r===undefined){r=tabindexValue(e)}if(r<=0||r===null||r===undefined){return true}if(!n[r]){n[r]=[];t.push(r)}n[r].push(e);return false}));var a=t.sort().map((function(e){return n[e]})).reduceRight((function(e,n){return n.concat(e)}),r);return a}var qe=void 0;function moveContextToBeginning(e,n){var t=e.indexOf(n);if(t>0){var r=e.splice(t,1);return r.concat(e)}return e}function sortElements(e,n){if(qe.tabsequenceAreaAtImgPosition){e=sortArea(e,n)}e=sortTabindex(e);return e}function queryTabsequence(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.context,t=e.includeContext,r=e.includeOnlyTabbable,a=e.strategy;if(!qe){qe=_supports()}var i=nodeArray(n)[0]||document.documentElement;var o=queryTabbable({context:i,includeContext:t,includeOnlyTabbable:r,strategy:a});if(document.body.createShadowRoot&&s.is.BLINK){o=sortShadowed(o,i,sortElements)}else{o=sortElements(o,i)}if(t){o=moveContextToBeginning(o,i)}return o}var Ge={tab:9,left:37,up:38,right:39,down:40,pageUp:33,\"page-up\":33,pageDown:34,\"page-down\":34,end:35,home:36,enter:13,escape:27,space:32,shift:16,capsLock:20,\"caps-lock\":20,ctrl:17,alt:18,meta:91,pause:19,insert:45,delete:46,backspace:8,_alias:{91:[92,93,224]}};for(var Ue=1;Ue<26;Ue++){Ge[\"f\"+Ue]=Ue+111}for(var Ve=0;Ve<10;Ve++){var Ke=Ve+48;var Ze=Ve+96;Ge[Ve]=Ke;Ge[\"num-\"+Ve]=Ze;Ge._alias[Ke]=[Ze]}for(var $e=0;$e<26;$e++){var Xe=$e+65;var Je=String.fromCharCode(Xe).toLowerCase();Ge[Je]=Xe}var Ye={alt:\"altKey\",ctrl:\"ctrlKey\",meta:\"metaKey\",shift:\"shiftKey\"};var Qe=Object.keys(Ye).map((function(e){return Ye[e]}));function createExpectedModifiers(e){var n=e?null:false;return{altKey:n,ctrlKey:n,metaKey:n,shiftKey:n}}function resolveModifiers(e){var n=e.indexOf(\"*\")!==-1;var t=createExpectedModifiers(n);e.forEach((function(e){if(e===\"*\"){return}var n=true;var r=e.slice(0,1);if(r===\"?\"){n=null}else if(r===\"!\"){n=false}if(n!==true){e=e.slice(1)}var a=Ye[e];if(!a){throw new TypeError('Unknown modifier \"'+e+'\"')}t[a]=n}));return t}function resolveKey(e){var n=Ge[e]||parseInt(e,10);if(!n||typeof n!==\"number\"||isNaN(n)){throw new TypeError('Unknown key \"'+e+'\"')}return[n].concat(Ge._alias[n]||[])}function matchModifiers(e,n){return!Qe.some((function(t){return typeof e[t]===\"boolean\"&&Boolean(n[t])!==e[t]}))}function keyBinding(e){return e.split(/\\s+/).map((function(e){var n=e.split(\"+\");var t=resolveModifiers(n.slice(0,-1));var r=resolveKey(n.slice(-1));return{keyCodes:r,modifiers:t,matchModifiers:matchModifiers.bind(null,t)}}))}function getParentComparator(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=e.parent,t=e.element,r=e.includeSelf;if(n){return function isChildOf(e){return Boolean(r&&e===n||n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)}}else if(t){return function isParentOf(e){return Boolean(r&&t===e||e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)}}throw new TypeError(\"util/compare-position#getParentComparator required either options.parent or options.element\")}function whenKey(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n={};var t=nodeArray(e.context)[0]||document.documentElement;delete e.context;var r=nodeArray(e.filter);delete e.filter;var a=Object.keys(e);if(!a.length){throw new TypeError(\"when/key requires at least one option key\")}var i=function registerBinding(e){e.keyCodes.forEach((function(t){if(!n[t]){n[t]=[]}n[t].push(e)}))};a.forEach((function(n){if(typeof e[n]!==\"function\"){throw new TypeError('when/key requires option[\"'+n+'\"] to be a function')}var t=function addCallback(t){t.callback=e[n];return t};keyBinding(n).map(t).forEach(i)}));var o=function handleKeyDown(e){if(e.defaultPrevented){return}if(r.length){var a=getParentComparator({element:e.target,includeSelf:true});if(r.some(a)){return}}var i=e.keyCode||e.which;if(!n[i]){return}n[i].forEach((function(n){if(!n.matchModifiers(e)){return}n.callback.call(t,e,l)}))};t.addEventListener(\"keydown\",o,false);var l=function disengage(){t.removeEventListener(\"keydown\",o,false)};return{disengage:l}}function default_1(e){var n=e===void 0?{}:e,t=n.context;if(!t){t=document.documentElement}queryTabsequence();return whenKey({\"?alt+?shift+tab\":function altShiftTab(e){e.preventDefault();var n=queryTabsequence({context:t});var r=e.shiftKey;var a=n[0];var i=n[n.length-1];var o=r?a:i;var l=r?i:a;if(isActiveElement(o)){l.focus();return}var s=void 0;var u=n.some((function(e,n){if(!isActiveElement(e)){return false}s=n;return true}));if(!u){a.focus();return}var c=r?-1:1;n[s+c].focus()}})}n[\"default\"]=default_1},993:function(e,n,t){\"use strict\";var r=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,\"raw\",{value:n})}else{e.raw=n}return e};n.__esModule=true;n.styles=void 0;var a=t(910);var i=(0,a.noop)(o||(o=r([\"\\n [data-nextjs-dialog-overlay] {\\n position: fixed;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n overflow: auto;\\n z-index: 9000;\\n\\n display: flex;\\n align-content: center;\\n align-items: center;\\n flex-direction: column;\\n padding: 10vh 15px 0;\\n }\\n\\n @media (max-height: 812px) {\\n [data-nextjs-dialog-overlay] {\\n padding: 15px 15px 0;\\n }\\n }\\n\\n [data-nextjs-dialog-backdrop] {\\n position: fixed;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n background-color: rgba(17, 17, 17, 0.2);\\n pointer-events: all;\\n z-index: -1;\\n }\\n\\n [data-nextjs-dialog-backdrop-fixed] {\\n cursor: not-allowed;\\n -webkit-backdrop-filter: blur(8px);\\n backdrop-filter: blur(8px);\\n }\\n\"],[\"\\n [data-nextjs-dialog-overlay] {\\n position: fixed;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n overflow: auto;\\n z-index: 9000;\\n\\n display: flex;\\n align-content: center;\\n align-items: center;\\n flex-direction: column;\\n padding: 10vh 15px 0;\\n }\\n\\n @media (max-height: 812px) {\\n [data-nextjs-dialog-overlay] {\\n padding: 15px 15px 0;\\n }\\n }\\n\\n [data-nextjs-dialog-backdrop] {\\n position: fixed;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n background-color: rgba(17, 17, 17, 0.2);\\n pointer-events: all;\\n z-index: -1;\\n }\\n\\n [data-nextjs-dialog-backdrop-fixed] {\\n cursor: not-allowed;\\n -webkit-backdrop-filter: blur(8px);\\n backdrop-filter: blur(8px);\\n }\\n\"])));n.styles=i;var o},338:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};var o=this&&this.__read||function(e,n){var t=typeof Symbol===\"function\"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),a,i=[],o;try{while((n===void 0||n-- >0)&&!(a=r.next()).done)i.push(a.value)}catch(e){o={error:e}}finally{try{if(a&&!a.done&&(t=r[\"return\"]))t.call(r)}finally{if(o)throw o.error}}return i};n.__esModule=true;n.ShadowPortal=void 0;var l=i(t(522));var s=t(255);var u=function Portal(e){var n=e.children,t=e.globalOverlay;var r=l.useRef(null);var a=l.useRef(null);var i=l.useRef(null);var u=o(l.useState(),2),c=u[1];l.useLayoutEffect((function(){var e=t?document:r.current.ownerDocument;a.current=e.createElement(\"nextjs-portal\");i.current=a.current.attachShadow({mode:\"open\"});e.body.appendChild(a.current);c({});return function(){if(a.current&&a.current.ownerDocument){a.current.ownerDocument.body.removeChild(a.current)}}}),[t]);return i.current?(0,s.createPortal)(n,i.current):t?null:l.createElement(\"span\",{ref:r})};n.ShadowPortal=u},215:function(e,n,t){\"use strict\";var r=this&&this.__assign||function(){r=Object.assign||function(e){for(var n,t=1,r=arguments.length;t * {\\n margin: 0;\\n padding: calc(var(--size-gap) + var(--size-gap-half))\\n calc(var(--size-gap-double) + var(--size-gap-half));\\n }\\n\\n [data-nextjs-terminal] pre {\\n white-space: pre-wrap;\\n word-break: break-word;\\n }\\n\"],[\"\\n [data-nextjs-terminal] {\\n border-radius: var(--size-gap-half);\\n background-color: var(--color-ansi-bg);\\n color: var(--color-ansi-fg);\\n }\\n [data-nextjs-terminal]::selection,\\n [data-nextjs-terminal] *::selection {\\n background-color: var(--color-ansi-selection);\\n }\\n [data-nextjs-terminal] * {\\n color: inherit;\\n background-color: transparent;\\n font-family: var(--font-stack-monospace);\\n }\\n [data-nextjs-terminal] > * {\\n margin: 0;\\n padding: calc(var(--size-gap) + var(--size-gap-half))\\n calc(var(--size-gap-double) + var(--size-gap-half));\\n }\\n\\n [data-nextjs-terminal] pre {\\n white-space: pre-wrap;\\n word-break: break-word;\\n }\\n\"])));n.styles=i;var o},683:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var a=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))r(n,e,t);a(n,e);return n};n.__esModule=true;n.Toast=void 0;var o=i(t(522));var l=function Toast(e){var n=e.onClick,t=e.children,r=e.className;return o.createElement(\"div\",{\"data-nextjs-toast\":true,onClick:n,className:r},o.createElement(\"div\",{\"data-nextjs-toast-wrapper\":true},t))};n.Toast=l},120:function(e,n,t){\"use strict\";var r=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});n.__esModule=true;n.Toast=n.styles=void 0;var a=t(69);r(n,a,\"styles\");var i=t(683);r(n,i,\"Toast\")},69:function(e,n,t){\"use strict\";var r=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,\"raw\",{value:n})}else{e.raw=n}return e};n.__esModule=true;n.styles=void 0;var a=t(910);var i=(0,a.noop)(o||(o=r([\"\\n [data-nextjs-toast] {\\n position: fixed;\\n bottom: var(--size-gap-double);\\n left: var(--size-gap-double);\\n max-width: 420px;\\n z-index: 9000;\\n }\\n\\n @media (max-width: 440px) {\\n [data-nextjs-toast] {\\n max-width: 90vw;\\n left: 5vw;\\n }\\n }\\n\\n [data-nextjs-toast-wrapper] {\\n padding: 16px;\\n border-radius: var(--size-gap-half);\\n font-weight: 500;\\n color: var(--color-ansi-bright-white);\\n background-color: var(--color-ansi-red);\\n box-shadow: 0px var(--size-gap-double) var(--size-gap-quad)\\n rgba(0, 0, 0, 0.25);\\n }\\n\"],[\"\\n [data-nextjs-toast] {\\n position: fixed;\\n bottom: var(--size-gap-double);\\n left: var(--size-gap-double);\\n max-width: 420px;\\n z-index: 9000;\\n }\\n\\n @media (max-width: 440px) {\\n [data-nextjs-toast] {\\n max-width: 90vw;\\n left: 5vw;\\n }\\n }\\n\\n [data-nextjs-toast-wrapper] {\\n padding: 16px;\\n border-radius: var(--size-gap-half);\\n font-weight: 500;\\n color: var(--color-ansi-bright-white);\\n background-color: var(--color-ansi-red);\\n box-shadow: 0px var(--size-gap-double) var(--size-gap-quad)\\n rgba(0, 0, 0, 0.25);\\n }\\n\"])));n.styles=i;var o},936:function(e,n,t){\"use strict\";var r=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,\"raw\",{value:n})}else{e.raw=n}return e};var a=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var i=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))a(n,e,t);i(n,e);return n};n.__esModule=true;n.styles=n.BuildError=void 0;var l=o(t(522));var s=t(651);var u=t(278);var c=t(236);var f=t(910);var d=function BuildError(e){var n=e.message;var t=l.useCallback((function(){}),[]);return l.createElement(u.Overlay,{fixed:true},l.createElement(s.Dialog,{type:\"error\",\"aria-labelledby\":\"nextjs__container_build_error_label\",\"aria-describedby\":\"nextjs__container_build_error_desc\",onClose:t},l.createElement(s.DialogContent,null,l.createElement(s.DialogHeader,{className:\"nextjs-container-build-error-header\"},l.createElement(\"h4\",{id:\"nextjs__container_build_error_label\"},\"Failed to compile\")),l.createElement(s.DialogBody,{className:\"nextjs-container-build-error-body\"},l.createElement(c.Terminal,{content:n}),l.createElement(\"footer\",null,l.createElement(\"p\",{id:\"nextjs__container_build_error_desc\"},l.createElement(\"small\",null,\"This error occurred during the build process and can only be dismissed by fixing the error.\")))))))};n.BuildError=d;n.styles=(0,f.noop)(p||(p=r([\"\\n .nextjs-container-build-error-header > h4 {\\n line-height: 1.5;\\n margin: 0;\\n padding: 0;\\n }\\n\\n .nextjs-container-build-error-body footer {\\n margin-top: var(--size-gap);\\n }\\n .nextjs-container-build-error-body footer p {\\n margin: 0;\\n }\\n\\n .nextjs-container-build-error-body small {\\n color: #757575;\\n }\\n\"],[\"\\n .nextjs-container-build-error-header > h4 {\\n line-height: 1.5;\\n margin: 0;\\n padding: 0;\\n }\\n\\n .nextjs-container-build-error-body footer {\\n margin-top: var(--size-gap);\\n }\\n .nextjs-container-build-error-body footer p {\\n margin: 0;\\n }\\n\\n .nextjs-container-build-error-body small {\\n color: #757575;\\n }\\n\"])));var p},355:function(e,n,t){\"use strict\";var r=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,\"raw\",{value:n})}else{e.raw=n}return e};var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var n,t=1,r=arguments.length;t0)&&!(a=r.next()).done)i.push(a.value)}catch(e){o={error:e}}finally{try{if(a&&!a.done&&(t=r[\"return\"]))t.call(r)}finally{if(o)throw o.error}}return i};n.__esModule=true;n.styles=n.Errors=void 0;var u=l(t(522));var c=t(851);var f=t(651);var d=t(732);var p=t(278);var b=t(120);var v=t(403);var m=t(233);var g=t(910);var h=t(865);var y=t(484);function getErrorSignature(e){var n=e.event;switch(n.type){case c.TYPE_UNHANDLED_ERROR:case c.TYPE_UNHANDLED_REJECTION:{return\"\".concat(n.reason.name,\"::\").concat(n.reason.message,\"::\").concat(n.reason.stack)}default:{}}var t=n;return\"\"}var x=function HotlinkedText(e){var n=e.text;var t=/https?:\\/\\/[^\\s/$.?#].[^\\s\"]*/i;return u.createElement(u.Fragment,null,t.test(n)?n.split(\" \").map((function(e,n,r){if(t.test(e)){return u.createElement(u.Fragment,{key:\"link-\".concat(n)},u.createElement(\"a\",{href:e},e),n===r.length-1?\"\":\" \")}return n===r.length-1?u.createElement(u.Fragment,{key:\"text-\".concat(n)},e):u.createElement(u.Fragment,{key:\"text-\".concat(n)},e,\" \")})):n)};var w=function Errors(e){var n=e.errors;var t=s(u.useState({}),2),r=t[0],i=t[1];var o=s(u.useMemo((function(){var e=[];var t=null;for(var a=0;a0){var l=n[a-1];if(getErrorSignature(l)===getErrorSignature(i)){continue}}t=i;break}return[e,t]}),[n,r]),2),l=o[0],c=o[1];var g=u.useMemo((function(){return l.length<1&&Boolean(n.length)}),[n.length,l.length]);u.useEffect((function(){if(c==null){return}var e=true;(0,v.getErrorByType)(c).then((function(n){if(e){i((function(e){var t;return a(a({},e),(t={},t[n.id]=n,t))}))}}),(function(){}));return function(){e=false}}),[c]);var w=s(u.useState(\"fullscreen\"),2),_=w[0],E=w[1];var O=s(u.useState(0),2),S=O[0],j=O[1];var k=u.useCallback((function(e){e===null||e===void 0?void 0:e.preventDefault();j((function(e){return Math.max(0,e-1)}))}),[]);var T=u.useCallback((function(e){e===null||e===void 0?void 0:e.preventDefault();j((function(e){return Math.max(0,Math.min(l.length-1,e+1))}))}),[l.length]);var C=u.useMemo((function(){var e;return(e=l[S])!==null&&e!==void 0?e:null}),[S,l]);u.useEffect((function(){if(n.length<1){i({});E(\"hidden\");j(0)}}),[n.length]);var M=u.useCallback((function(e){e===null||e===void 0?void 0:e.preventDefault();E(\"minimized\")}),[]);var P=u.useCallback((function(e){e===null||e===void 0?void 0:e.preventDefault();E(\"hidden\")}),[]);var A=u.useCallback((function(e){e===null||e===void 0?void 0:e.preventDefault();E(\"fullscreen\")}),[]);if(n.length<1||C==null){return null}if(g){return u.createElement(p.Overlay,null)}if(_===\"hidden\"){return null}if(_===\"minimized\"){return u.createElement(b.Toast,{className:\"nextjs-toast-errors-parent\",onClick:A},u.createElement(\"div\",{className:\"nextjs-toast-errors\"},u.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"},u.createElement(\"circle\",{cx:\"12\",cy:\"12\",r:\"10\"}),u.createElement(\"line\",{x1:\"12\",y1:\"8\",x2:\"12\",y2:\"12\"}),u.createElement(\"line\",{x1:\"12\",y1:\"16\",x2:\"12.01\",y2:\"16\"})),u.createElement(\"span\",null,l.length,\" error\",l.length>1?\"s\":\"\"),u.createElement(\"button\",{\"data-nextjs-toast-errors-hide-button\":true,className:\"nextjs-toast-errors-hide-button\",type:\"button\",onClick:function(e){e.stopPropagation();P()},\"aria-label\":\"Hide Errors\"},u.createElement(h.CloseIcon,null))))}var D=[\"server\",\"edge-server\"].includes((0,m.getErrorSource)(C.error)||\"\");return u.createElement(p.Overlay,null,u.createElement(f.Dialog,{type:\"error\",\"aria-labelledby\":\"nextjs__container_errors_label\",\"aria-describedby\":\"nextjs__container_errors_desc\",onClose:D?undefined:M},u.createElement(f.DialogContent,null,u.createElement(f.DialogHeader,{className:\"nextjs-container-errors-header\"},u.createElement(d.LeftRightDialogHeader,{previous:S>0?k:null,next:S h1 {\\n font-size: var(--size-font-big);\\n line-height: var(--size-font-bigger);\\n font-weight: bold;\\n margin: 0;\\n margin-top: calc(var(--size-gap-double) + var(--size-gap-half));\\n }\\n .nextjs-container-errors-header small {\\n font-size: var(--size-font-small);\\n color: var(--color-accents-1);\\n margin-left: var(--size-gap-double);\\n }\\n .nextjs-container-errors-header small > span {\\n font-family: var(--font-stack-monospace);\\n }\\n .nextjs-container-errors-header > p {\\n font-family: var(--font-stack-monospace);\\n font-size: var(--size-font-small);\\n line-height: var(--size-font-big);\\n font-weight: bold;\\n margin: 0;\\n margin-top: var(--size-gap-half);\\n color: var(--color-ansi-red);\\n white-space: pre-wrap;\\n }\\n .nextjs-container-errors-header > div > small {\\n margin: 0;\\n margin-top: var(--size-gap-half);\\n }\\n .nextjs-container-errors-header > p > a {\\n color: var(--color-ansi-red);\\n }\\n\\n .nextjs-container-errors-body > h5:not(:first-child) {\\n margin-top: calc(var(--size-gap-double) + var(--size-gap));\\n }\\n .nextjs-container-errors-body > h5 {\\n margin-bottom: var(--size-gap);\\n }\\n\\n .nextjs-toast-errors-parent {\\n cursor: pointer;\\n transition: transform 0.2s ease;\\n }\\n .nextjs-toast-errors-parent:hover {\\n transform: scale(1.1);\\n }\\n .nextjs-toast-errors {\\n display: flex;\\n align-items: center;\\n justify-content: flex-start;\\n }\\n .nextjs-toast-errors > svg {\\n margin-right: var(--size-gap);\\n }\\n .nextjs-toast-errors-hide-button {\\n margin-left: var(--size-gap-triple);\\n border: none;\\n background: none;\\n color: var(--color-ansi-bright-white);\\n padding: 0;\\n transition: opacity 0.25s ease;\\n opacity: 0.7;\\n }\\n .nextjs-toast-errors-hide-button:hover {\\n opacity: 1;\\n }\\n\"],[\"\\n .nextjs-container-errors-header > h1 {\\n font-size: var(--size-font-big);\\n line-height: var(--size-font-bigger);\\n font-weight: bold;\\n margin: 0;\\n margin-top: calc(var(--size-gap-double) + var(--size-gap-half));\\n }\\n .nextjs-container-errors-header small {\\n font-size: var(--size-font-small);\\n color: var(--color-accents-1);\\n margin-left: var(--size-gap-double);\\n }\\n .nextjs-container-errors-header small > span {\\n font-family: var(--font-stack-monospace);\\n }\\n .nextjs-container-errors-header > p {\\n font-family: var(--font-stack-monospace);\\n font-size: var(--size-font-small);\\n line-height: var(--size-font-big);\\n font-weight: bold;\\n margin: 0;\\n margin-top: var(--size-gap-half);\\n color: var(--color-ansi-red);\\n white-space: pre-wrap;\\n }\\n .nextjs-container-errors-header > div > small {\\n margin: 0;\\n margin-top: var(--size-gap-half);\\n }\\n .nextjs-container-errors-header > p > a {\\n color: var(--color-ansi-red);\\n }\\n\\n .nextjs-container-errors-body > h5:not(:first-child) {\\n margin-top: calc(var(--size-gap-double) + var(--size-gap));\\n }\\n .nextjs-container-errors-body > h5 {\\n margin-bottom: var(--size-gap);\\n }\\n\\n .nextjs-toast-errors-parent {\\n cursor: pointer;\\n transition: transform 0.2s ease;\\n }\\n .nextjs-toast-errors-parent:hover {\\n transform: scale(1.1);\\n }\\n .nextjs-toast-errors {\\n display: flex;\\n align-items: center;\\n justify-content: flex-start;\\n }\\n .nextjs-toast-errors > svg {\\n margin-right: var(--size-gap);\\n }\\n .nextjs-toast-errors-hide-button {\\n margin-left: var(--size-gap-triple);\\n border: none;\\n background: none;\\n color: var(--color-ansi-bright-white);\\n padding: 0;\\n transition: opacity 0.25s ease;\\n opacity: 0.7;\\n }\\n .nextjs-toast-errors-hide-button:hover {\\n opacity: 1;\\n }\\n\"])));var _},484:function(e,n,t){\"use strict\";var r=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,\"raw\",{value:n})}else{e.raw=n}return e};var a=this&&this.__createBinding||(Object.create?function(e,n,t,r){if(r===undefined)r=t;var a=Object.getOwnPropertyDescriptor(n,t);if(!a||(\"get\"in a?!n.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return n[t]}}}Object.defineProperty(e,r,a)}:function(e,n,t,r){if(r===undefined)r=t;e[r]=n[t]});var i=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,\"default\",{enumerable:true,value:n})}:function(e,n){e[\"default\"]=n});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)if(t!==\"default\"&&Object.prototype.hasOwnProperty.call(e,t))a(n,e,t);i(n,e);return n};var l=this&&this.__read||function(e,n){var t=typeof Symbol===\"function\"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),a,i=[],o;try{while((n===void 0||n-- >0)&&!(a=r.next()).done)i.push(a.value)}catch(e){o={error:e}}finally{try{if(a&&!a.done&&(t=r[\"return\"]))t.call(r)}finally{if(o)throw o.error}}return i};n.__esModule=true;n.RuntimeError=n.styles=void 0;var s=o(t(522));var u=t(413);var c=t(910);var f=t(504);var d=function CallStackFrame(e){var n;var t=e.frame;var r=(n=t.originalStackFrame)!==null&&n!==void 0?n:t.sourceStackFrame;var a=Boolean(t.originalCodeFrame);var i=s.useCallback((function(){var e;if(!a)return;var n=new URLSearchParams;for(var t in r){n.append(t,((e=r[t])!==null&&e!==void 0?e:\"\").toString())}self.fetch(\"\".concat( false||\"\",\"/__nextjs_launch-editor?\").concat(n.toString())).then((function(){}),(function(){console.error(\"There was an issue opening this code in your editor.\")}))}),[a,r]);return s.createElement(\"div\",{\"data-nextjs-call-stack-frame\":true},s.createElement(\"h6\",{\"data-nextjs-frame-expanded\":Boolean(t.expanded)},r.methodName),s.createElement(\"div\",{\"data-has-source\":a?\"true\":undefined,tabIndex:a?10:undefined,role:a?\"link\":undefined,onClick:i,title:a?\"Click to open in your editor\":undefined},s.createElement(\"span\",null,(0,f.getFrameSource)(r)),s.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"},s.createElement(\"path\",{d:\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"}),s.createElement(\"polyline\",{points:\"15 3 21 3 21 9\"}),s.createElement(\"line\",{x1:\"10\",y1:\"14\",x2:\"21\",y2:\"3\"}))))};var p=function RuntimeError(e){var n=e.error;var t=s.useMemo((function(){return n.frames.findIndex((function(e){return e.expanded&&Boolean(e.originalCodeFrame)&&Boolean(e.originalStackFrame)}))}),[n.frames]);var r=s.useMemo((function(){var e;return(e=n.frames[t])!==null&&e!==void 0?e:null}),[n.frames,t]);var a=s.useMemo((function(){return t<0?[]:n.frames.slice(0,t)}),[n.frames,t]);var i=l(s.useState(r==null),2),o=i[0],c=i[1];var f=s.useCallback((function(){c((function(e){return!e}))}),[]);var p=s.useMemo((function(){return a.filter((function(e){return e.expanded||o}))}),[o,a]);var b=s.useMemo((function(){return n.frames.slice(t+1)}),[n.frames,t]);var v=s.useMemo((function(){return b.filter((function(e){return e.expanded||o}))}),[o,b]);var m=s.useMemo((function(){return b.length!==v.length||o&&r!=null}),[o,b.length,r,v.length]);return s.createElement(s.Fragment,null,r?s.createElement(s.Fragment,null,s.createElement(\"h5\",null,\"Source\"),p.map((function(e,n){return s.createElement(d,{key:\"leading-frame-\".concat(n,\"-\").concat(o),frame:e})})),s.createElement(u.CodeFrame,{stackFrame:r.originalStackFrame,codeFrame:r.originalCodeFrame})):undefined,v.length?s.createElement(s.Fragment,null,s.createElement(\"h5\",null,\"Call Stack\"),v.map((function(e,n){return s.createElement(d,{key:\"call-stack-\".concat(n,\"-\").concat(o),frame:e})}))):undefined,m?s.createElement(s.Fragment,null,s.createElement(\"button\",{tabIndex:10,\"data-nextjs-data-runtime-error-collapsed-action\":true,type:\"button\",onClick:f},o?\"Hide\":\"Show\",\" collapsed frames\")):undefined)};n.RuntimeError=p;n.styles=(0,c.noop)(b||(b=r([\"\\n button[data-nextjs-data-runtime-error-collapsed-action] {\\n background: none;\\n border: none;\\n padding: 0;\\n font-size: var(--size-font-small);\\n line-height: var(--size-font-bigger);\\n color: var(--color-accents-3);\\n }\\n\\n [data-nextjs-call-stack-frame]:not(:last-child) {\\n margin-bottom: var(--size-gap-double);\\n }\\n\\n [data-nextjs-call-stack-frame] > h6 {\\n margin-top: 0;\\n margin-bottom: var(--size-gap);\\n font-family: var(--font-stack-monospace);\\n color: #222;\\n }\\n [data-nextjs-call-stack-frame] > h6[data-nextjs-frame-expanded='false'] {\\n color: #666;\\n }\\n [data-nextjs-call-stack-frame] > div {\\n display: flex;\\n align-items: center;\\n padding-left: calc(var(--size-gap) + var(--size-gap-half));\\n font-size: var(--size-font-small);\\n color: #999;\\n }\\n [data-nextjs-call-stack-frame] > div > svg {\\n width: auto;\\n height: var(--size-font-small);\\n margin-left: var(--size-gap);\\n\\n display: none;\\n }\\n\\n [data-nextjs-call-stack-frame] > div[data-has-source] {\\n cursor: pointer;\\n }\\n [data-nextjs-call-stack-frame] > div[data-has-source]:hover {\\n text-decoration: underline dotted;\\n }\\n [data-nextjs-call-stack-frame] > div[data-has-source] > svg {\\n display: unset;\\n }\\n\"],[\"\\n button[data-nextjs-data-runtime-error-collapsed-action] {\\n background: none;\\n border: none;\\n padding: 0;\\n font-size: var(--size-font-small);\\n line-height: var(--size-font-bigger);\\n color: var(--color-accents-3);\\n }\\n\\n [data-nextjs-call-stack-frame]:not(:last-child) {\\n margin-bottom: var(--size-gap-double);\\n }\\n\\n [data-nextjs-call-stack-frame] > h6 {\\n margin-top: 0;\\n margin-bottom: var(--size-gap);\\n font-family: var(--font-stack-monospace);\\n color: #222;\\n }\\n [data-nextjs-call-stack-frame] > h6[data-nextjs-frame-expanded='false'] {\\n color: #666;\\n }\\n [data-nextjs-call-stack-frame] > div {\\n display: flex;\\n align-items: center;\\n padding-left: calc(var(--size-gap) + var(--size-gap-half));\\n font-size: var(--size-font-small);\\n color: #999;\\n }\\n [data-nextjs-call-stack-frame] > div > svg {\\n width: auto;\\n height: var(--size-font-small);\\n margin-left: var(--size-gap);\\n\\n display: none;\\n }\\n\\n [data-nextjs-call-stack-frame] > div[data-has-source] {\\n cursor: pointer;\\n }\\n [data-nextjs-call-stack-frame] > div[data-has-source]:hover {\\n text-decoration: underline dotted;\\n }\\n [data-nextjs-call-stack-frame] > div[data-has-source] > svg {\\n display: unset;\\n }\\n\"])));var b},403:function(e,n,t){\"use strict\";var r=this&&this.__awaiter||function(e,n,t,r){function adopt(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,a){function fulfilled(e){try{step(r.next(e))}catch(e){a(e)}}function rejected(e){try{step(r[\"throw\"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,n||[])).next())}))};var a=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol===\"function\"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(n){return step([e,n])}}function step(o){if(r)throw new TypeError(\"Generator is already executing.\");while(t)try{if(r=1,a&&(i=o[0]&2?a[\"return\"]:o[0]?a[\"throw\"]||((i=a[\"return\"])&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;if(a=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;a=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1] 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){\n args[_key - 1] = arguments[_key];\n }\n if (false) { var _instance; }\n return path;\n};\nexports.addLocale = addLocale;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=add-locale.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9hZGQtbG9jYWxlLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhOzs7OztBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELGlCQUFpQixHQUFHLEtBQUssQ0FBQyxDQUFDO0FBQzNCLElBQUlHLHVCQUF1QixHQUFHQyxtQkFBTyxDQUFDLCtGQUE0QixDQUFDO0FBQ25FLElBQU1GLFNBQVMsR0FBRyxTQUFDRyxJQUFJLEVBQVk7cUNBQVBDLElBQUk7UUFBSkEsSUFBSTs7SUFDNUIsSUFBSUMsS0FBK0IsRUFBRSxrQkFFcEM7SUFDRCxPQUFPRixJQUFJLENBQUM7QUFDaEIsQ0FBQztBQUNETCxpQkFBaUIsR0FBR0UsU0FBUyxDQUFDO0FBRTlCLElBQUksQ0FBQyxPQUFPRixPQUFPLENBQUNXLE9BQU8sS0FBSyxVQUFVLElBQUssT0FBT1gsT0FBTyxDQUFDVyxPQUFPLEtBQUssUUFBUSxJQUFJWCxPQUFPLENBQUNXLE9BQU8sS0FBSyxJQUFJLENBQUMsSUFBSyxPQUFPWCxPQUFPLENBQUNXLE9BQU8sQ0FBQ0MsVUFBVSxLQUFLLFdBQVcsRUFBRTtJQUNyS2QsTUFBTSxDQUFDQyxjQUFjLENBQUNDLE9BQU8sQ0FBQ1csT0FBTyxFQUFFLFlBQVksRUFBRTtRQUFFVixLQUFLLEVBQUUsSUFBSTtLQUFFLENBQUMsQ0FBQztJQUN0RUgsTUFBTSxDQUFDZSxNQUFNLENBQUNiLE9BQU8sQ0F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gJiYgdHlwZW9mIGV4cG9ydHMuZGVmYXVsdC5fX2VzTW9kdWxlID09PSAndW5kZWZpbmVkJykge1xuICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cy5kZWZhdWx0LCAnX19lc01vZHVsZScsIHsgdmFsdWU6IHRydWUgfSk7XG4gIE9iamVjdC5hc3NpZ24oZXhwb3J0cy5kZWZhdWx0LCBleHBvcnRzKTtcbiAgbW9kdWxlLmV4cG9ydHMgPSBleHBvcnRzLmRlZmF1bHQ7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWFkZC1sb2NhbGUuanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiYWRkTG9jYWxlIiwiX25vcm1hbGl6ZVRyYWlsaW5nU2xhc2giLCJyZXF1aXJlIiwicGF0aCIsImFyZ3MiLCJwcm9jZXNzIiwiZW52IiwiX19ORVhUX0kxOE5fU1VQUE9SVCIsIm5vcm1hbGl6ZVBhdGhUcmFpbGluZ1NsYXNoIiwiZGVmYXVsdCIsIl9fZXNNb2R1bGUiLCJhc3NpZ24iLCJtb2R1bGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/add-locale.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/detect-domain-locale.js": /*!***************************************************************!*\ !*** ./node_modules/next/dist/client/detect-domain-locale.js ***! \***************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _toConsumableArray = (__webpack_require__(/*! @swc/helpers/lib/_to_consumable_array.js */ \"./node_modules/@swc/helpers/lib/_to_consumable_array.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.detectDomainLocale = void 0;\nvar detectDomainLocale = function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n if (false) { var _instance; }\n};\nexports.detectDomainLocale = detectDomainLocale;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=detect-domain-locale.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXRlY3QtZG9tYWluLWxvY2FsZS5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTs7Ozs7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCwwQkFBMEIsR0FBRyxLQUFLLENBQUMsQ0FBQztBQUNwQyxJQUFNRSxrQkFBa0IsR0FBRyxXQUFXO3FDQUFQQyxJQUFJO1FBQUpBLElBQUk7O0lBQy9CLElBQUlDLEtBQStCLEVBQUUsa0JBRXBDO0FBQ0wsQ0FBQztBQUNESiwwQkFBMEIsR0FBR0Usa0JBQWtCLENBQUM7QUFFaEQsSUFBSSxDQUFDLE9BQU9GLE9BQU8sQ0FBQ1EsT0FBTyxLQUFLLFVBQVUsSUFBSyxPQUFPUixPQUFPLENBQUNRLE9BQU8sS0FBSyxRQUFRLElBQUlSLE9BQU8sQ0FBQ1EsT0FBTyxLQUFLLElBQUksQ0FBQyxJQUFLLE9BQU9SLE9BQU8sQ0FBQ1EsT0FBTyxDQUFDQyxVQUFVLEtBQUssV0FBVyxFQUFFO0lBQ3JLWCxNQUFNLENBQUNDLGNBQWMsQ0FBQ0MsT0FBTyxDQUFDUSxPQUFPLEVBQUUsWUFBWSxFQUFFO1FBQUVQLEtBQUssRUFBRSxJQUFJO0tBQUUsQ0FBQyxDQUFDO0lBQ3RFSCxNQUFNLENB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LmRlZmF1bHQsICdfX2VzTW9kdWxlJywgeyB2YWx1ZTogdHJ1ZSB9KTtcbiAgT2JqZWN0LmFzc2lnbihleHBvcnRzLmRlZmF1bHQsIGV4cG9ydHMpO1xuICBtb2R1bGUuZXhwb3J0cyA9IGV4cG9ydHMuZGVmYXVsdDtcbn1cblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9ZGV0ZWN0LWRvbWFpbi1sb2NhbGUuanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiZGV0ZWN0RG9tYWluTG9jYWxlIiwiYXJncyIsInByb2Nlc3MiLCJlbnYiLCJfX05FWFRfSTE4Tl9TVVBQT1JUIiwicmVxdWlyZSIsImRlZmF1bHQiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/detect-domain-locale.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/dev/dev-build-watcher.js": /*!****************************************************************!*\ !*** ./node_modules/next/dist/client/dev/dev-build-watcher.js ***! \****************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = initializeBuildWatcher;\nvar _websocket = __webpack_require__(/*! ./error-overlay/websocket */ \"./node_modules/next/dist/client/dev/error-overlay/websocket.js\");\nfunction initializeBuildWatcher(toggleCallback) {\n var position = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"bottom-right\";\n var handleMessage = function handleMessage(event) {\n var obj = typeof event === \"string\" ? {\n action: event\n } : JSON.parse(event.data);\n // eslint-disable-next-line default-case\n switch(obj.action){\n case \"building\":\n timeoutId && clearTimeout(timeoutId);\n isVisible = true;\n isBuilding = true;\n updateContainer();\n break;\n case \"built\":\n case \"sync\":\n isBuilding = false;\n // Wait for the fade out transition to complete\n timeoutId = setTimeout(function() {\n isVisible = false;\n updateContainer();\n }, 100);\n updateContainer();\n break;\n }\n };\n var updateContainer = function updateContainer() {\n if (isBuilding) {\n container.classList.add(\"\".concat(prefix, \"building\"));\n } else {\n container.classList.remove(\"\".concat(prefix, \"building\"));\n }\n if (isVisible) {\n container.classList.add(\"\".concat(prefix, \"visible\"));\n } else {\n container.classList.remove(\"\".concat(prefix, \"visible\"));\n }\n };\n var shadowHost = document.createElement(\"div\");\n var ref = _slicedToArray(position.split(\"-\"), 2), verticalProperty = ref[0], horizontalProperty = ref[1];\n shadowHost.id = \"__next-build-watcher\";\n // Make sure container is fixed and on a high zIndex so it shows\n shadowHost.style.position = \"fixed\";\n // Ensure container's position to be top or bottom (default)\n shadowHost.style[verticalProperty] = \"10px\";\n // Ensure container's position to be left or right (default)\n shadowHost.style[horizontalProperty] = \"20px\";\n shadowHost.style.width = 0;\n shadowHost.style.height = 0;\n shadowHost.style.zIndex = 99999;\n document.body.appendChild(shadowHost);\n var shadowRoot;\n var prefix = \"\";\n if (shadowHost.attachShadow) {\n shadowRoot = shadowHost.attachShadow({\n mode: \"open\"\n });\n } else {\n // If attachShadow is undefined then the browser does not support\n // the Shadow DOM, we need to prefix all the names so there\n // will be no conflicts\n shadowRoot = shadowHost;\n prefix = \"__next-build-watcher-\";\n }\n // Container\n var container = createContainer(prefix);\n shadowRoot.appendChild(container);\n // CSS\n var css = createCss(prefix, {\n horizontalProperty: horizontalProperty,\n verticalProperty: verticalProperty\n });\n shadowRoot.appendChild(css);\n // State\n var isVisible = false;\n var isBuilding = false;\n var timeoutId = null;\n // Handle events\n (0, _websocket).addMessageListener(function(event) {\n // This is the heartbeat event\n if (event.data === \"\\uD83D\\uDC93\") {\n return;\n }\n try {\n handleMessage(event);\n } catch (e) {}\n });\n toggleCallback(handleMessage);\n}\nfunction createContainer(prefix) {\n var container = document.createElement(\"div\");\n container.id = \"\".concat(prefix, \"container\");\n container.innerHTML = '\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n ');\n return container;\n}\nfunction createCss(prefix, param) {\n var horizontalProperty = param.horizontalProperty, verticalProperty = param.verticalProperty;\n var css = document.createElement(\"style\");\n css.textContent = \"\\n #\".concat(prefix, \"container {\\n position: absolute;\\n \").concat(verticalProperty, \": 10px;\\n \").concat(horizontalProperty, \": 30px;\\n\\n border-radius: 3px;\\n background: #000;\\n color: #fff;\\n font: initial;\\n cursor: initial;\\n letter-spacing: initial;\\n text-shadow: initial;\\n text-transform: initial;\\n visibility: initial;\\n\\n padding: 7px 10px 8px 10px;\\n align-items: center;\\n box-shadow: 0 11px 40px 0 rgba(0, 0, 0, 0.25), 0 2px 10px 0 rgba(0, 0, 0, 0.12);\\n\\n display: none;\\n opacity: 0;\\n transition: opacity 0.1s ease, \").concat(verticalProperty, \" 0.1s ease;\\n animation: \").concat(prefix, \"fade-in 0.1s ease-in-out;\\n }\\n\\n #\").concat(prefix, \"container.\").concat(prefix, \"visible {\\n display: flex;\\n }\\n\\n #\").concat(prefix, \"container.\").concat(prefix, \"building {\\n \").concat(verticalProperty, \": 20px;\\n opacity: 1;\\n }\\n\\n #\").concat(prefix, \"icon-wrapper {\\n width: 16px;\\n height: 16px;\\n }\\n\\n #\").concat(prefix, \"icon-wrapper > svg {\\n width: 100%;\\n height: 100%;\\n }\\n\\n #\").concat(prefix, \"icon-group {\\n animation: \").concat(prefix, \"strokedash 1s ease-in-out both infinite;\\n }\\n\\n @keyframes \").concat(prefix, \"fade-in {\\n from {\\n \").concat(verticalProperty, \": 10px;\\n opacity: 0;\\n }\\n to {\\n \").concat(verticalProperty, \": 20px;\\n opacity: 1;\\n }\\n }\\n\\n @keyframes \").concat(prefix, \"strokedash {\\n 0% {\\n stroke-dasharray: 0 226;\\n }\\n 80%,\\n 100% {\\n stroke-dasharray: 659 226;\\n }\\n }\\n \");\n return css;\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=dev-build-watcher.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXYvZGV2LWJ1aWxkLXdhdGNoZXIuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Ozs7O0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsa0JBQWUsR0FBR0csc0JBQXNCLENBQUM7QUFDekMsSUFBSUMsVUFBVSxHQUFHQyxtQkFBTyxDQUFDLGlHQUEyQixDQUFDO0FBQ3JELFNBQVNGLHNCQUFzQixDQUFDRyxjQUFjLEVBQTZCO1FBQTNCQyxRQUFRLEdBQVJBLCtDQUF5QixrQkFBZCxjQUFjO1FBa0Q1REMsYUFBYSxHQUF0QixTQUFTQSxhQUFhLENBQUNDLEtBQUssRUFBRTtRQUMxQixJQUFNQyxHQUFHLEdBQUcsT0FBT0QsS0FBSyxLQUFLLFFBQVEsR0FBRztZQUNwQ0UsTUFBTSxFQUFFRixLQUFLO1NBQ2hCLEdBQUdHLElBQUksQ0FBQ0MsS0FBSyxDQUFDSixLQUFLLENBQUNLLElBQUksQ0FBQztRQUMxQix3Q0FBd0M7UUFDeEMsT0FBT0osR0FBRyxDQUFDQyxNQUFNO1lBQ2IsS0FBSyxVQUFVO2dCQUNYSSxTQUFTLElBQUlDLFlBQVksQ0FBQ0QsU0FBUyxDQUFDLENBQUM7Z0JBQ3JDRSxTQUFTLEdBQUcsSUFBSSxDQUFDO2dC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IDogSlNPTi5wYXJzZShldmVudC5kYXRhKTtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGRlZmF1bHQtY2FzZVxuICAgICAgICBzd2l0Y2gob2JqLmFjdGlvbil7XG4gICAgICAgICAgICBjYXNlICdidWlsZGluZyc6XG4gICAgICAgICAgICAgICAgdGltZW91dElkICYmIGNsZWFyVGltZW91dCh0aW1lb3V0SWQpO1xuICAgICAgICAgICAgICAgIGlzVmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgaXNCdWlsZGluZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgdXBkYXRlQ29udGFpbmVyKCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdidWlsdCc6XG4gICAgICAgICAgICBjYXNlICdzeW5jJzpcbiAgICAgICAgICAgICAgICBpc0J1aWxkaW5nID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgLy8gV2FpdCBmb3IgdGhlIGZhZGUgb3V0IHRyYW5zaXRpb24gdG8gY29tcGxldGVcbiAgICAgICAgICAgICAgICB0aW1lb3V0SWQgPSBzZXRUaW1lb3V0KCgpPT57XG4gICAgICAgICAgICAgICAgICAgIGlzVmlzaWJsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb250YWluZXIoKTtcbiAgICAgICAgICAgICAgICB9LCAxMDApO1xuICAgICAgICAgICAgICAgIHVwZGF0ZUNvbnRhaW5lcigpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuICAgIHRvZ2dsZUNhbGxiYWNrKGhhbmRsZU1lc3NhZ2UpO1xuICAgIGZ1bmN0aW9uIHVwZGF0ZUNvbnRhaW5lcigpIHtcbiAgICAgICAgaWYgKGlzQnVpbGRpbmcpIHtcbiAgICAgICAgICAgIGNvbnRhaW5lci5jbGFzc0xpc3QuYWRkKGAke3ByZWZpeH1idWlsZGluZ2ApO1xuIC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mYXVsdCIsImluaXRpYWxpemVCdWlsZFdhdGNoZXIiLCJfd2Vic29ja2V0IiwicmVxdWlyZSIsInRvZ2dsZUNhbGxiYWNrIiwicG9zaXRpb24iLCJoYW5kbGVNZXNzYWdlIiwiZXZlbnQiLCJvYmoiLCJhY3Rpb24iLCJKU09OIiwicGFyc2UiLCJkYXRhIiwidGltZW91dElkIiwiY2xlYXJUaW1lb3V0IiwiaXNWaXNpYmxlIiwiaXNCdWlsZGluZyIsInVwZGF0ZUNvbnRhaW5lciIsInNldFRpbWVvdXQiLCJjb250YWluZXIiLCJjbGFzc0xpc3QiLCJhZGQiLCJwcmVmaXgiLCJyZW1vdmUiLCJzaGFkb3dIb3N0IiwiZG9jdW1lbnQiLCJjcmVhdGVFbGVtZW50Iiwic3BsaXQiLCJ2ZXJ0aWNhbFByb3BlcnR5IiwiaG9yaXpvbnRhbFByb3BlcnR5IiwiaWQiLCJzdHlsZSIsIndpZHRoIiwiaGVpZ2h0IiwiekluZGV4IiwiYm9keSIsImFwcGVuZENoaWxkIiwic2hhZG93Um9vdCIsImF0dGFjaFNoYWRvdyIsIm1vZGUiLCJjcmVhdGVDb250YWluZXIiLCJjc3MiLCJjcmVhdGVDc3MiLCJhZGRNZXNzYWdlTGlzdGVuZXIiLCJlIiwiaW5uZXJIVE1MIiwidGV4dENvbnRlbnQiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/dev-build-watcher.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/dev/error-overlay/format-webpack-messages.js": /*!************************************************************************************!*\ !*** ./node_modules/next/dist/client/dev/error-overlay/format-webpack-messages.js ***! \************************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nvar _toConsumableArray = (__webpack_require__(/*! @swc/helpers/lib/_to_consumable_array.js */ \"./node_modules/@swc/helpers/lib/_to_consumable_array.js\")[\"default\"]);\nvar _extends = (__webpack_require__(/*! @swc/helpers/lib/_extends.js */ \"./node_modules/@swc/helpers/lib/_extends.js\")[\"default\"]);\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _stripAnsi = _interop_require_default(__webpack_require__(/*! next/dist/compiled/strip-ansi */ \"./node_modules/next/dist/compiled/strip-ansi/index.js\"));\n// This file is based on https://github.com/facebook/create-react-app/blob/7b1a32be6ec9f99a6c9a3c66813f3ac09c4736b9/packages/react-dev-utils/formatWebpackMessages.js\n// It's been edited to remove chalk and CRA-specific logic\nvar friendlySyntaxErrorLabel = \"Syntax error:\";\nvar WEBPACK_BREAKING_CHANGE_POLYFILLS = \"\\n\\nBREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.\";\nfunction isLikelyASyntaxError(message) {\n return (0, _stripAnsi).default(message).indexOf(friendlySyntaxErrorLabel) !== -1;\n}\nvar hadMissingSassError = false;\n// Cleans up webpack error messages.\nfunction formatMessage(message, verbose, importTraceNote) {\n // TODO: Replace this once webpack 5 is stable\n if (typeof message === \"object\" && message.message) {\n var filteredModuleTrace = message.moduleTrace && message.moduleTrace.filter(function(trace) {\n return !/next-(middleware|client-pages|edge-function)-loader\\.js/.test(trace.originName);\n });\n var body = message.message;\n var breakingChangeIndex = body.indexOf(WEBPACK_BREAKING_CHANGE_POLYFILLS);\n if (breakingChangeIndex >= 0) {\n body = body.slice(0, breakingChangeIndex);\n }\n message = (message.moduleName ? (0, _stripAnsi).default(message.moduleName) + \"\\n\" : \"\") + (message.file ? (0, _stripAnsi).default(message.file) + \"\\n\" : \"\") + body + (message.details && verbose ? \"\\n\" + message.details : \"\") + (filteredModuleTrace && filteredModuleTrace.length && verbose ? (importTraceNote || \"\\n\\nImport trace for requested module:\") + filteredModuleTrace.map(function(trace) {\n return \"\\n\".concat(trace.moduleName);\n }).join(\"\") : \"\") + (message.stack && verbose ? \"\\n\" + message.stack : \"\");\n }\n var lines = message.split(\"\\n\");\n // Strip Webpack-added headers off errors/warnings\n // https://github.com/webpack/webpack/blob/master/lib/ModuleError.js\n lines = lines.filter(function(line) {\n return !/Module [A-z ]+\\(from/.test(line);\n });\n // Transform parsing error into syntax error\n // TODO: move this to our ESLint formatter?\n lines = lines.map(function(line) {\n var parsingError = /Line (\\d+):(?:(\\d+):)?\\s*Parsing error: (.+)$/.exec(line);\n if (!parsingError) {\n return line;\n }\n var _parsingError = _slicedToArray(parsingError, 4), errorLine = _parsingError[1], errorColumn = _parsingError[2], errorMessage = _parsingError[3];\n return \"\".concat(friendlySyntaxErrorLabel, \" \").concat(errorMessage, \" (\").concat(errorLine, \":\").concat(errorColumn, \")\");\n });\n message = lines.join(\"\\n\");\n // Smoosh syntax errors (commonly found in CSS)\n message = message.replace(/SyntaxError\\s+\\((\\d+):(\\d+)\\)\\s*(.+?)\\n/g, \"\".concat(friendlySyntaxErrorLabel, \" $3 ($1:$2)\\n\"));\n // Clean up export errors\n message = message.replace(/^.*export '(.+?)' was not found in '(.+?)'.*$/gm, \"Attempted import error: '$1' is not exported from '$2'.\");\n message = message.replace(/^.*export 'default' \\(imported as '(.+?)'\\) was not found in '(.+?)'.*$/gm, \"Attempted import error: '$2' does not contain a default export (imported as '$1').\");\n message = message.replace(/^.*export '(.+?)' \\(imported as '(.+?)'\\) was not found in '(.+?)'.*$/gm, \"Attempted import error: '$1' is not exported from '$3' (imported as '$2').\");\n lines = message.split(\"\\n\");\n // Remove leading newline\n if (lines.length > 2 && lines[1].trim() === \"\") {\n lines.splice(1, 1);\n }\n // Cleans up verbose \"module not found\" messages for files and packages.\n if (lines[1] && lines[1].indexOf(\"Module not found: \") === 0) {\n lines = [\n lines[0],\n lines[1].replace(\"Error: \", \"\").replace(\"Module not found: Cannot find file:\", \"Cannot find file:\"), \n ].concat(_toConsumableArray(lines.slice(2)));\n }\n // Add helpful message for users trying to use Sass for the first time\n if (lines[1] && lines[1].match(/Cannot find module.+sass/)) {\n // ./file.module.scss (<>) => ./file.module.scss\n var firstLine = lines[0].split(\"!\");\n lines[0] = firstLine[firstLine.length - 1];\n lines[1] = \"To use Next.js' built-in Sass support, you first need to install `sass`.\\n\";\n lines[1] += \"Run `npm i sass` or `yarn add sass` inside your workspace.\\n\";\n lines[1] += \"\\nLearn more: https://nextjs.org/docs/messages/install-sass\";\n // dispose of unhelpful stack trace\n lines = lines.slice(0, 2);\n hadMissingSassError = true;\n } else if (hadMissingSassError && message.match(/(sass-loader|resolve-url-loader: CSS error)/)) {\n // dispose of unhelpful stack trace following missing sass module\n lines = [];\n }\n if (!verbose) {\n message = lines.join(\"\\n\");\n // Internal stacks are generally useless so we strip them... with the\n // exception of stacks containing `webpack:` because they're normally\n // from user code generated by Webpack. For more information see\n // https://github.com/facebook/create-react-app/pull/1050\n message = message.replace(/^\\s*at\\s((?!webpack:).)*:\\d+:\\d+[\\s)]*(\\n|$)/gm, \"\") // at ... ...:x:y\n ;\n message = message.replace(/^\\s*at\\s(\\n|$)/gm, \"\") // at \n ;\n lines = message.split(\"\\n\");\n }\n // Remove duplicated newlines\n lines = lines.filter(function(line, index, arr) {\n return index === 0 || line.trim() !== \"\" || line.trim() !== arr[index - 1].trim();\n });\n // Reassemble the message\n message = lines.join(\"\\n\");\n return message.trim();\n}\nfunction formatWebpackMessages(json, verbose) {\n var formattedErrors = json.errors.map(function(message) {\n var importTraceNote;\n // TODO: Shall we use invisible characters in the original error\n // message as meta information?\n if (message && message.message && /NEXT_RSC_ERR_/.test(message.message)) {\n // Comes from the \"React Server Components\" transform in SWC, always\n // attach the module trace.\n var NEXT_RSC_ERR_REACT_API = RegExp(\".+NEXT_RSC_ERR_REACT_API: (.*?)\\\\n\", \"s\");\n var NEXT_RSC_ERR_SERVER_IMPORT = RegExp(\".+NEXT_RSC_ERR_SERVER_IMPORT: (.*?)\\\\n\", \"s\");\n var NEXT_RSC_ERR_CLIENT_IMPORT = RegExp(\".+NEXT_RSC_ERR_CLIENT_IMPORT: (.*?)\\\\n\", \"s\");\n if (NEXT_RSC_ERR_REACT_API.test(message.message)) {\n message.message = message.message.replace(NEXT_RSC_ERR_REACT_API, \"\\n\\nYou're importing a component that needs $1. It only works in a Client Component but none of its parents are marked with \\\"client\\\", so they're Server Components by default.\\n\\n\");\n importTraceNote = '\\n\\nMaybe one of these should be marked as a \"client\" entry:\\n';\n } else if (NEXT_RSC_ERR_SERVER_IMPORT.test(message.message)) {\n message.message = message.message.replace(NEXT_RSC_ERR_SERVER_IMPORT, \"\\n\\nYou're importing a component that imports $1. It only works in a Client Component but none of its parents are marked with \\\"client\\\", so they're Server Components by default.\\n\\n\");\n importTraceNote = '\\n\\nMaybe one of these should be marked as a \"client\" entry:\\n';\n } else if (NEXT_RSC_ERR_CLIENT_IMPORT.test(message.message)) {\n message.message = message.message.replace(NEXT_RSC_ERR_CLIENT_IMPORT, \"\\n\\nYou're importing a component that needs $1. That only works in a Server Component but one of its parents is marked with \\\"client\\\", so it's a Client Component.\\n\\n\");\n importTraceNote = '\\n\\nOne of these is marked as a \"client\" entry:\\n';\n }\n verbose = true;\n }\n return formatMessage(message, verbose, importTraceNote);\n });\n var formattedWarnings = json.warnings.map(function(message) {\n return formatMessage(message, verbose);\n });\n var result = _extends({}, json, {\n errors: formattedErrors,\n warnings: formattedWarnings\n });\n if (!verbose && result.errors.some(isLikelyASyntaxError)) {\n // If there are any syntax errors, show just them.\n result.errors = result.errors.filter(isLikelyASyntaxError);\n result.warnings = [];\n }\n return result;\n}\nmodule.exports = formatWebpackMessages;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=format-webpack-messages.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNo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RUFLSU5HX0NIQU5HRV9QT0xZRklMTFMiLCJpc0xpa2VseUFTeW50YXhFcnJvciIsIm1lc3NhZ2UiLCJpbmRleE9mIiwiaGFkTWlzc2luZ1Nhc3NFcnJvciIsImZvcm1hdE1lc3NhZ2UiLCJ2ZXJib3NlIiwiaW1wb3J0VHJhY2VOb3RlIiwiZmlsdGVyZWRNb2R1bGVUcmFjZSIsIm1vZHVsZVRyYWNlIiwiZmlsdGVyIiwidHJhY2UiLCJ0ZXN0Iiwib3JpZ2luTmFtZSIsImJvZHkiLCJicmVha2luZ0NoYW5nZUluZGV4Iiwic2xpY2UiLCJtb2R1bGVOYW1lIiwiZmlsZSIsImRldGFpbHMiLCJsZW5ndGgiLCJtYXAiLCJqb2luIiwic3RhY2siLCJsaW5lcyIsInNwbGl0IiwibGluZSIsInBhcnNpbmdFcnJvciIsImV4ZWMiLCJlcnJvckxpbmUiLCJlcnJvckNvbHVtbiIsImVycm9yTWVzc2FnZSIsInJlcGxhY2UiLCJ0cmltIiwic3BsaWNlIiwibWF0Y2giLCJmaXJzdExpbmUiLCJpbmRleCIsImFyciIsImZvcm1hdFdlYnBhY2tNZXNzYWdlcyIsImpzb24iLCJmb3JtYXR0ZWRFcnJvcnMiLCJlcnJvcnMiLCJORVhUX1JTQ19FUlJfUkVBQ1RfQVBJIiwiUmVnRXhwIiwiTkVYVF9SU0NfRVJSX1NFUlZFUl9JTVBPUlQiLCJORVhUX1JTQ19FUlJfQ0xJRU5UX0lNUE9SVCIsImZvcm1hdHRlZFdhcm5pbmdzIiwid2FybmluZ3MiLCJyZXN1bHQiLCJzb21lIiwibW9kdWxlIiwiZXhwb3J0cyIsIl9fZXNNb2R1bGUiLCJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsInZhbHVlIiwiYXNzaWduIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/error-overlay/format-webpack-messages.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/dev/error-overlay/hot-dev-client.js": /*!***************************************************************************!*\ !*** ./node_modules/next/dist/client/dev/error-overlay/hot-dev-client.js ***! \***************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = connect;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _client = __webpack_require__(/*! next/dist/compiled/@next/react-dev-overlay/dist/client */ \"./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js\");\nvar _stripAnsi = _interop_require_default(__webpack_require__(/*! next/dist/compiled/strip-ansi */ \"./node_modules/next/dist/compiled/strip-ansi/index.js\"));\nvar _websocket = __webpack_require__(/*! ./websocket */ \"./node_modules/next/dist/client/dev/error-overlay/websocket.js\");\nvar _formatWebpackMessages = _interop_require_default(__webpack_require__(/*! ./format-webpack-messages */ \"./node_modules/next/dist/client/dev/error-overlay/format-webpack-messages.js\"));\nfunction connect() {\n (0, _client).register();\n (0, _websocket).addMessageListener(function(event) {\n if (event.data.indexOf(\"action\") === -1) return;\n try {\n processMessage(event);\n } catch (ex) {\n console.warn(\"Invalid HMR message: \" + event.data + \"\\n\", ex);\n }\n });\n return {\n subscribeToHmrEvent: function subscribeToHmrEvent(handler) {\n customHmrEventHandler = handler;\n },\n onUnrecoverableError: function onUnrecoverableError() {\n hadRuntimeError = true;\n }\n };\n}\n// This alternative WebpackDevServer combines the functionality of:\n// https://github.com/webpack/webpack-dev-server/blob/webpack-1/client/index.js\n// https://github.com/webpack/webpack/blob/webpack-1/hot/dev-server.js\n// It only supports their simplest configuration (hot updates on same server).\n// It makes some opinionated choices on top, like adding a syntax error overlay\n// that looks similar to our console output. The error overlay is inspired by:\n// https://github.com/glenjamin/webpack-hot-middleware\nwindow.__nextDevClientId = Math.round(Math.random() * 100 + Date.now());\nvar hadRuntimeError = false;\nvar customHmrEventHandler;\n// Remember some state related to hot module replacement.\nvar isFirstCompilation = true;\nvar mostRecentCompilationHash = null;\nvar hasCompileErrors = false;\nfunction clearOutdatedErrors() {\n // Clean up outdated compile errors, if any.\n if (typeof console !== \"undefined\" && typeof console.clear === \"function\") {\n if (hasCompileErrors) {\n console.clear();\n }\n }\n}\n// Successful compilation.\nfunction handleSuccess() {\n clearOutdatedErrors();\n var isHotUpdate = !isFirstCompilation || window.__NEXT_DATA__.page !== \"/_error\" && isUpdateAvailable();\n isFirstCompilation = false;\n hasCompileErrors = false;\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate(hasUpdates) {\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n onFastRefresh(hasUpdates);\n });\n }\n}\n// Compilation with warnings (e.g. ESLint).\nfunction handleWarnings(warnings) {\n var printWarnings = function printWarnings() {\n // Print warnings to the console.\n var formatted = (0, _formatWebpackMessages).default({\n warnings: warnings,\n errors: []\n });\n if (typeof console !== \"undefined\" && typeof console.warn === \"function\") {\n for(var i = 0; i < formatted.warnings.length; i++){\n if (i === 5) {\n console.warn(\"There were more warnings in other files.\\n\" + \"You can find a complete log in the terminal.\");\n break;\n }\n console.warn((0, _stripAnsi).default(formatted.warnings[i]));\n }\n }\n };\n clearOutdatedErrors();\n var isHotUpdate = !isFirstCompilation;\n isFirstCompilation = false;\n hasCompileErrors = false;\n printWarnings();\n // Attempt to apply hot updates or reload.\n if (isHotUpdate) {\n tryApplyUpdates(function onSuccessfulHotUpdate(hasUpdates) {\n // Only dismiss it when we're sure it's a hot update.\n // Otherwise it would flicker right before the reload.\n onFastRefresh(hasUpdates);\n });\n }\n}\n// Compilation with errors (e.g. syntax error or missing modules).\nfunction handleErrors(errors) {\n clearOutdatedErrors();\n isFirstCompilation = false;\n hasCompileErrors = true;\n // \"Massage\" webpack messages.\n var formatted = (0, _formatWebpackMessages).default({\n errors: errors,\n warnings: []\n });\n // Only show the first error.\n (0, _client).onBuildError(formatted.errors[0]);\n // Also log them to the console.\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n for(var i = 0; i < formatted.errors.length; i++){\n console.error((0, _stripAnsi).default(formatted.errors[i]));\n }\n }\n // Do not attempt to reload now.\n // We will reload on next success instead.\n if (false) {}\n}\nvar startLatency = undefined;\nfunction onFastRefresh(hasUpdates) {\n (0, _client).onBuildOk();\n if (hasUpdates) {\n (0, _client).onRefresh();\n }\n if (startLatency) {\n var endLatency = Date.now();\n var latency = endLatency - startLatency;\n console.log(\"[Fast Refresh] done in \".concat(latency, \"ms\"));\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"client-hmr-latency\",\n id: window.__nextDevClientId,\n startTime: startLatency,\n endTime: endLatency\n }));\n if (self.__NEXT_HMR_LATENCY_CB) {\n self.__NEXT_HMR_LATENCY_CB(latency);\n }\n }\n}\n// There is a newer version of the code available.\nfunction handleAvailableHash(hash) {\n // Update last known compilation hash.\n mostRecentCompilationHash = hash;\n}\n// Handle messages from the server.\nfunction processMessage(e) {\n var obj = JSON.parse(e.data);\n switch(obj.action){\n case \"building\":\n {\n startLatency = Date.now();\n console.log(\"[Fast Refresh] rebuilding\");\n break;\n }\n case \"built\":\n case \"sync\":\n {\n if (obj.hash) {\n handleAvailableHash(obj.hash);\n }\n var errors = obj.errors, warnings = obj.warnings;\n var hasErrors = Boolean(errors && errors.length);\n if (hasErrors) {\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"client-error\",\n errorCount: errors.length,\n clientId: window.__nextDevClientId\n }));\n return handleErrors(errors);\n }\n var hasWarnings = Boolean(warnings && warnings.length);\n if (hasWarnings) {\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"client-warning\",\n warningCount: warnings.length,\n clientId: window.__nextDevClientId\n }));\n return handleWarnings(warnings);\n }\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"client-success\",\n clientId: window.__nextDevClientId\n }));\n return handleSuccess();\n }\n case \"serverComponentChanges\":\n {\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"server-component-reload-page\",\n clientId: window.__nextDevClientId\n }));\n return window.location.reload();\n }\n default:\n {\n if (customHmrEventHandler) {\n customHmrEventHandler(obj);\n break;\n }\n break;\n }\n }\n}\n// Is there a newer version of this code available?\nfunction isUpdateAvailable() {\n /* globals __webpack_hash__ */ // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}\n// Webpack disallows updates in other states.\nfunction canApplyUpdates() {\n return module.hot.status() === \"idle\";\n}\nfunction afterApplyUpdates(fn) {\n if (canApplyUpdates()) {\n fn();\n } else {\n function handler(status) {\n if (status === \"idle\") {\n module.hot.removeStatusHandler(handler);\n fn();\n }\n }\n module.hot.addStatusHandler(handler);\n }\n}\n// Attempt to update code on the fly, fall back to a hard reload.\nfunction tryApplyUpdates(onHotUpdateSuccess) {\n var handleApplyUpdates = function handleApplyUpdates(err, updatedModules) {\n if (err || hadRuntimeError || !updatedModules) {\n if (err) {\n console.warn(\"[Fast Refresh] performing full reload\\n\\n\" + \"Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React rendering tree.\\n\" + \"You might have a file which exports a React component but also exports a value that is imported by a non-React component file.\\n\" + \"Consider migrating the non-React component export to a separate file and importing it into both files.\\n\\n\" + \"It is also possible the parent component of the component you edited is a class component, which disables Fast Refresh.\\n\" + \"Fast Refresh requires at least one parent function component in your React tree.\");\n } else if (hadRuntimeError) {\n console.warn(\"[Fast Refresh] performing full reload because your application had an unrecoverable error\");\n }\n performFullReload(err);\n return;\n }\n var hasUpdates = Boolean(updatedModules.length);\n if (typeof onHotUpdateSuccess === \"function\") {\n // Maybe we want to do something.\n onHotUpdateSuccess(hasUpdates);\n }\n if (isUpdateAvailable()) {\n // While we were updating, there was a new update! Do it again.\n tryApplyUpdates(hasUpdates ? _client.onBuildOk : onHotUpdateSuccess);\n } else {\n (0, _client).onBuildOk();\n if (false) {}\n }\n };\n if (false) {}\n if (!isUpdateAvailable() || !canApplyUpdates()) {\n (0, _client).onBuildOk();\n return;\n }\n // https://webpack.js.org/api/hot-module-replacement/#check\n module.hot.check(/* autoApply */ true).then(function(updatedModules) {\n handleApplyUpdates(null, updatedModules);\n }, function(err) {\n handleApplyUpdates(err, null);\n });\n}\nfunction performFullReload(err) {\n var stackTrace = err && (err.stack && err.stack.split(\"\\n\").slice(0, 5).join(\"\\n\") || err.message || err + \"\");\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"client-full-reload\",\n stackTrace: stackTrace\n }));\n window.location.reload();\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=hot-dev-client.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXYvZXJyb3Itb3ZlcmxheS9ob3QtZGV2LWNsaWVudC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELGtCQUFlLEdBQUdHLE9BQU8sQ0FBQztBQUMxQixJQUFJQyx3QkFBd0IsR0FBR0MsbUpBQStEO0FBQzlGLElBQUlDLE9BQU8sR0FBR0QsbUJBQU8sQ0FBQyx3SUFBd0QsQ0FBQztBQUMvRSxJQUFJRSxVQUFVLEdBQUdILHdCQUF3QixDQUFDQyxtQkFBTyxDQUFDLDRGQUErQixDQUFDLENBQUM7QUFDbkYsSUFBSUcsVUFBVSxHQUFHSCxtQkFBTyxDQUFDLG1GQUFhLENBQUM7QUFDdkMsSUFBSUksc0JBQXNCLEdBQUdMLHdCQUF3QixDQUFDQyx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lc3NNZXNzYWdlKGUpIHtcbiAgICBjb25zdCBvYmogPSBKU09OLnBhcnNlKGUuZGF0YSk7XG4gICAgc3dpdGNoKG9iai5hY3Rpb24pe1xuICAgICAgICBjYXNlICdidWlsZGluZyc6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc3RhcnRMYXRlbmN5ID0gRGF0ZS5ub3coKTtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnW0Zhc3QgUmVmcmVzaF0gcmVidWlsZGluZycpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICBjYXNlICdidWlsdCc6XG4gICAgICAgIGNhc2UgJ3N5bmMnOlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGlmIChvYmouaGFzaCkge1xuICAgICAgICAgICAgICAgICAgICBoYW5kbGVBdmFpbGFibGVIYXNoKG9iai5oYXNoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29uc3QgeyBlcnJvcnMgLCB3YXJuaW5ncyAgfSA9IG9iajtcbiAgICAgICAgICAgICAgICBjb25zdCBoYXNFcnJvcnMgPSBCb29sZWFuKGVycm9ycyAmJiBlcnJvcnMubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICBpZiAoaGFzRXJyb3JzKSB7XG4gICAgICAgICAgICAgICAgICAgICgwLCBfd2Vic29ja2V0KS5zZW5kTWVzc2FnZShKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudDogJ2NsaWVudC1lcnJvcicsXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvckNvdW50OiBlcnJvcnMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50SWQ6IHdpbmRvdy5fX25leHREZXZDbGllbnRJZFxuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBoYW5kbGVFcnJvcnMoZXJyb3JzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29uc3QgaGFzV2FybmluZ3MgPSBCb29sZWFuKHdhcm5pbmdzICYmIHdhcm5pbmdzLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgaWYgKGhhc1dhcm5pbmdzKSB7XG4gICAgICAgICAgICAgICAgICAgICgwLCBfd2Vic29ja2V0KS5zZW5kTWVzc2FnZShKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudDogJ2NsaWVudC13YXJuaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhcm5pbmdDb3VudDogd2FybmluZ3MubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50SWQ6IHdpbmRvdy5fX25leHREZXZDbGllbnRJZFxuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBoYW5kbGVXYXJuaW5ncyh3YXJuaW5ncyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICgwLCBfd2Vic29ja2V0KS5zZW5kTWVzc2FnZShKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50OiAnY2xpZW50LXN1Y2Nlc3MnLFxuICAgICAgICAgICAgICAgICAgICBjbGllbnRJZDogd2luZG93Ll9fbmV4dERldkNsaWVudElkXG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgIHJldHVybiBoYW5kbGVTdWNjZXNzKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIGNhc2UgJ3NlcnZlckNvbXBvbmVudENoYW5nZXMnOlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICgwLCBfd2Vic29ja2V0KS5zZW5kTWVzc2FnZShKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50OiAnc2VydmVyLWNvbXBvbmVudC1yZWxvYWQtcGFnZScsXG4g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VzIiwicGVyZm9ybUZ1bGxSZWxvYWQiLCJjaGVjayIsInRoZW4iLCJzdGFja1RyYWNlIiwic3RhY2siLCJzcGxpdCIsInNsaWNlIiwiam9pbiIsIm1lc3NhZ2UiLCJfX2VzTW9kdWxlIiwiYXNzaWduIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/error-overlay/hot-dev-client.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/dev/error-overlay/websocket.js": /*!**********************************************************************!*\ !*** ./node_modules/next/dist/client/dev/error-overlay/websocket.js ***! \**********************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.addMessageListener = addMessageListener;\nexports.sendMessage = sendMessage;\nexports.connectHMR = connectHMR;\nvar source;\nvar eventCallbacks = [];\nvar lastActivity = Date.now();\nfunction getSocketProtocol(assetPrefix) {\n var protocol = location.protocol;\n try {\n // assetPrefix is a url\n protocol = new URL(assetPrefix).protocol;\n } catch (_) {}\n return protocol === \"http:\" ? \"ws\" : \"wss\";\n}\nfunction addMessageListener(cb) {\n eventCallbacks.push(cb);\n}\nfunction sendMessage(data) {\n if (!source || source.readyState !== source.OPEN) return;\n return source.send(data);\n}\nfunction connectHMR(options) {\n if (!options.timeout) {\n options.timeout = 5 * 1000;\n }\n function init() {\n if (source) source.close();\n function handleOnline() {\n if (options.log) console.log(\"[HMR] connected\");\n lastActivity = Date.now();\n }\n function handleMessage(event) {\n lastActivity = Date.now();\n eventCallbacks.forEach(function(cb) {\n cb(event);\n });\n }\n var timer;\n function handleDisconnect() {\n clearInterval(timer);\n source.close();\n setTimeout(init, options.timeout);\n }\n timer = setInterval(function() {\n if (Date.now() - lastActivity > options.timeout) {\n handleDisconnect();\n }\n }, options.timeout / 2);\n var hostname = location.hostname, port = location.port;\n var protocol = getSocketProtocol(options.assetPrefix || \"\");\n var assetPrefix = options.assetPrefix.replace(/^\\/+/, \"\");\n var url = \"\".concat(protocol, \"://\").concat(hostname, \":\").concat(port).concat(assetPrefix ? \"/\".concat(assetPrefix) : \"\");\n if (assetPrefix.startsWith(\"http\")) {\n url = \"\".concat(protocol, \"://\").concat(assetPrefix.split(\"://\")[1]);\n }\n source = new window.WebSocket(\"\".concat(url).concat(options.path));\n source.onopen = handleOnline;\n source.onerror = handleDisconnect;\n source.onmessage = handleMessage;\n }\n init();\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=websocket.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXYvZXJyb3Itb3ZlcmxheS93ZWJzb2NrZXQuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCwwQkFBMEIsR0FBR0Usa0JBQWtCLENBQUM7QUFDaERGLG1CQUFtQixHQUFHRyxXQUFXLENBQUM7QUFDbENILGtCQUFrQixHQUFHSSxVQUFVLENBQUM7QUFDaEMsSUFBSUMsTUFBTTtBQUNWLElBQU1DLGNBQWMsR0FBRyxFQUFFO0FBQ3pCLElBQUlDLFlBQVksR0FBR0MsSUFBSSxDQUFDQyxHQUFHLEVBQUU7QUFDN0IsU0FBU0MsaUJBQWlCLENBQUNDLFdBQVcsRUFBRTtJQUNwQyxJQUFJQyxRQUFRLEdBQUdDLFFBQVEsQ0FBQ0QsUUFBUTtJQUNoQyxJQUFJO1FBQ0EsdUJBQXVCO1FBQ3ZCQSxRQUFRLEdBQUcsSUFBSUUsR0FBRyxDQUFDSCxXQUFXLENBQUMs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ICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7XG4gICAgICAgICAgICBzb3VyY2UuY2xvc2UoKTtcbiAgICAgICAgICAgIHNldFRpbWVvdXQoaW5pdCwgb3B0aW9ucy50aW1lb3V0KTtcbiAgICAgICAgfVxuICAgICAgICB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgaWYgKERhdGUubm93KCkgLSBsYXN0QWN0aXZpdHkgPiBvcHRpb25zLnRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICBoYW5kbGVEaXNjb25uZWN0KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIG9wdGlvbnMudGltZW91dCAvIDIpO1xuICAgICAgICBjb25zdCB7IGhvc3RuYW1lICwgcG9ydCAgfSA9IGxvY2F0aW9uO1xuICAgICAgICBjb25zdCBwcm90b2NvbCA9IGdldFNvY2tldFByb3RvY29sKG9wdGlvbnMuYXNzZXRQcmVmaXggfHwgJycpO1xuICAgICAgICBjb25zdCBhc3NldFByZWZpeCA9IG9wdGlvbnMuYXNzZXRQcmVmaXgucmVwbGFjZSgvXlxcLysvLCAnJyk7XG4gICAgICAgIGxldCB1cmwgPSBgJHtwcm90b2NvbH06Ly8ke2hvc3RuYW1lfToke3BvcnR9JHthc3NldFByZWZpeCA/IGAvJHthc3NldFByZWZpeH1gIDogJyd9YDtcbiAgICAgICAgaWYgKGFzc2V0UHJlZml4LnN0YXJ0c1dpdGgoJ2h0dHAnKSkge1xuICAgICAgICAgICAgdXJsID0gYCR7cHJvdG9jb2x9Oi8vJHthc3NldFByZWZpeC5zcGxpdCgnOi8vJylbMV19YDtcbiAgICAgICAgfVxuICAgICAgICBzb3VyY2UgPSBuZXcgd2luZG93LldlYlNvY2tldChgJHt1cmx9JHtvcHRpb25zLnBhdGh9YCk7XG4gICAgICAgIHNvdXJjZS5vbm9wZW4gPSBoYW5kbGVPbmxpbmU7XG4gICAgICAgIHNvdXJjZS5vbmVycm9yID0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zYWdlIiwiZXZlbnQiLCJmb3JFYWNoIiwidGltZXIiLCJoYW5kbGVEaXNjb25uZWN0IiwiY2xlYXJJbnRlcnZhbCIsInNldFRpbWVvdXQiLCJzZXRJbnRlcnZhbCIsImhvc3RuYW1lIiwicG9ydCIsInJlcGxhY2UiLCJ1cmwiLCJzdGFydHNXaXRoIiwic3BsaXQiLCJ3aW5kb3ciLCJXZWJTb2NrZXQiLCJwYXRoIiwib25vcGVuIiwib25lcnJvciIsIm9ubWVzc2FnZSIsImRlZmF1bHQiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/error-overlay/websocket.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/dev/fouc.js": /*!***************************************************!*\ !*** ./node_modules/next/dist/client/dev/fouc.js ***! \***************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.displayContent = displayContent;\n// This wrapper function is used to safely select the best available function\n// to schedule removal of the no-FOUC styles workaround. requestAnimationFrame\n// is the ideal choice, but when used in iframes, there are no guarantees that\n// the callback will actually be called, which could stall the promise returned\n// from displayContent.\n//\n// See: https://www.vector-logic.com/blog/posts/on-request-animation-frame-and-embedded-iframes\nvar safeCallbackQueue = function(callback) {\n if (window.requestAnimationFrame && window.self === window.top) {\n window.requestAnimationFrame(callback);\n } else {\n window.setTimeout(callback);\n }\n};\nfunction displayContent() {\n return new Promise(function(resolve) {\n safeCallbackQueue(function() {\n for(var x = document.querySelectorAll(\"[data-next-hide-fouc]\"), i = x.length; i--;){\n x[i].parentNode.removeChild(x[i]);\n }\n resolve();\n });\n });\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=fouc.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.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GVmYXVsdCIsIl9fZXNNb2R1bGUiLCJhc3NpZ24iLCJtb2R1bGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/fouc.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/dev/on-demand-entries-client.js": /*!***********************************************************************!*\ !*** ./node_modules/next/dist/client/dev/on-demand-entries-client.js ***! \***********************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _tsGenerator = (__webpack_require__(/*! @swc/helpers/lib/_ts_generator.js */ \"./node_modules/@swc/helpers/lib/_ts_generator.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _async_to_generator = (__webpack_require__(/*! @swc/helpers/lib/_async_to_generator.js */ \"./node_modules/@swc/helpers/lib/_async_to_generator.js\")[\"default\"]);\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _router = _interop_require_default(__webpack_require__(/*! next/router */ \"./node_modules/next/router.js\"));\nvar _websocket = __webpack_require__(/*! ./error-overlay/websocket */ \"./node_modules/next/dist/client/dev/error-overlay/websocket.js\");\nvar _default = _async_to_generator(function(page) {\n return _tsGenerator(this, function(_state) {\n if (page) {\n // in AMP the router isn't initialized on the client and\n // client-transitions don't occur so ping initial page\n setInterval(function() {\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"ping\",\n page: page\n }));\n }, 2500);\n } else {\n _router.default.ready(function() {\n setInterval(function() {\n // when notFound: true is returned we should use the notFoundPage\n // as the Router.pathname will point to the 404 page but we want\n // to ping the source page that returned notFound: true instead\n var notFoundSrcPage = self.__NEXT_DATA__.notFoundSrcPage;\n var pathname = (_router.default.pathname === \"/404\" || _router.default.pathname === \"/_error\") && notFoundSrcPage ? notFoundSrcPage : _router.default.pathname;\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"ping\",\n page: pathname\n }));\n }, 2500);\n });\n }\n (0, _websocket).addMessageListener(function(event) {\n if (event.data.indexOf(\"{\") === -1) return;\n try {\n var payload = JSON.parse(event.data);\n // don't attempt fetching the page if we're already showing\n // the dev overlay as this can cause the error to be triggered\n // repeatedly\n if (payload.event === \"pong\" && payload.invalid && !self.__NEXT_DATA__.err) {\n // Payload can be invalid even if the page does exist.\n // So, we check if it can be created.\n fetch(location.href, {\n credentials: \"same-origin\"\n }).then(function(pageRes) {\n if (pageRes.status === 200) {\n // Page exists now, reload\n location.reload();\n } else {\n // Page doesn't exist\n if (self.__NEXT_DATA__.page === _router.default.pathname && _router.default.pathname !== \"/_error\") {\n // We are still on the page,\n // reload to show 404 error page\n location.reload();\n }\n }\n });\n }\n } catch (err) {\n console.error(\"on-demand-entries failed to parse response\", err);\n }\n });\n return [\n 2\n ];\n });\n});\nexports[\"default\"] = _default;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=on-demand-entries-client.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXYvb24tZGVtYW5kLWVudHJpZXMtY2xpZW50LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhOzs7OztBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELGtCQUFlLEdBQUcsS0FBSyxDQUFDLENBQUM7QUFDekIsSUFBSUcsbUJBQW1CLEdBQUdDLHlJQUEwRDtBQUNwRixJQUFJQyx3QkFBd0IsR0FBR0QsbUpBQStEO0FBQzlGLElBQUlF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BhZ2UgZXhpc3RzIG5vdywgcmVsb2FkXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFBhZ2UgZG9lc24ndCBleGlzdFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuX19ORVhUX0RBVEFfXy5wYWdlID09PSBfcm91dGVyLmRlZmF1bHQucGF0aG5hbWUgJiYgX3JvdXRlci5kZWZhdWx0LnBhdGhuYW1lICE9PSAnL19lcnJvcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBhcmUgc3RpbGwgb24gdGhlIHBhZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVsb2FkIHRvIHNob3cgNDA0IGVycm9yIHBhZ2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ29uLWRlbWFuZC1lbnRyaWVzIGZhaWxlZCB0byBwYXJzZSByZXNwb25zZScsIGVycik7XG4gICAgICAgIH1cbiAgICB9KTtcbn0pO1xuZXhwb3J0cy5kZWZhdWx0ID0gX2RlZmF1bHQ7XG5cbmlmICgodHlwZW9mIGV4cG9ydHMuZGVmYXVsdCA9PT0gJ2Z1bmN0aW9uJyB8fCAodHlwZW9mIGV4cG9ydHMuZGVmYXVsdCA9PT0gJ29iamVjdCcgJiYgZXhwb3J0cy5kZWZhdWx0ICE9PSBudWxsKSkgJiYgdHlwZW9mIGV4cG9ydHMuZGVmYXVsdC5fX2VzTW9kdWxlID09PSAndW5kZWZpbmVkJykge1xuICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cy5kZWZhdWx0LCAnX19lc01vZHVsZScsIHsgdmFsdWU6IHRydWUgfSk7XG4gIE9iamVjdC5hc3NpZ24oZXhwb3J0cy5kZWZhdWx0LCBleHBvcnRzKTtcbiAgbW9kdWxlLmV4cG9ydHMgPSBleHBvcnRzLmRlZmF1bHQ7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPW9uLWRlbWFuZC1lbnRyaWVzLWNsaWVudC5qcy5tYXAiXSwibmFtZXMiOlsiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJleHBvcnRzIiwidmFsdWUiLCJkZWZhdWx0IiwiX2FzeW5jX3RvX2dlbmVyYXRvciIsInJlcXVpcmUiLCJfaW50ZXJvcF9yZXF1aXJlX2RlZmF1bHQiLCJfcm91dGVyIiwiX3dlYnNvY2tldCIsIl9kZWZhdWx0IiwicGFnZSIsInNldEludGVydmFsIiwic2VuZE1lc3NhZ2UiLCJKU09OIiwic3RyaW5naWZ5IiwiZXZlbnQiLCJyZWFkeSIsIm5vdEZvdW5kU3JjUGFnZSIsInNlbGYiLCJfX05FWFRfREFUQV9fIiwicGF0aG5hbWUiLCJhZGRNZXNzYWdlTGlzdGVuZXIiLCJkYXRhIiwiaW5kZXhPZiIsInBheWxvYWQiLCJwYXJzZSIsImludmFsaWQiLCJlcnIiLCJmZXRjaCIsImxvY2F0aW9uIiwiaHJlZiIsImNyZWRlbnRpYWxzIiwidGhlbiIsInBhZ2VSZXMiLCJzdGF0dXMiLCJyZWxvYWQiLCJjb25zb2xlIiwiZXJyb3IiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/on-demand-entries-client.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/dev/webpack-hot-middleware-client.js": /*!****************************************************************************!*\ !*** ./node_modules/next/dist/client/dev/webpack-hot-middleware-client.js ***! \****************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _hotDevClient = _interop_require_default(__webpack_require__(/*! ./error-overlay/hot-dev-client */ \"./node_modules/next/dist/client/dev/error-overlay/hot-dev-client.js\"));\nvar _websocket = __webpack_require__(/*! ./error-overlay/websocket */ \"./node_modules/next/dist/client/dev/error-overlay/websocket.js\");\nvar _default = function() {\n var devClient = (0, _hotDevClient).default();\n devClient.subscribeToHmrEvent(function(obj) {\n if (obj.action === \"reloadPage\") {\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"client-reload-page\",\n clientId: window.__nextDevClientId\n }));\n return window.location.reload();\n }\n if (obj.action === \"removedPage\") {\n var _data = _slicedToArray(obj.data, 1), page = _data[0];\n if (page === window.next.router.pathname) {\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"client-removed-page\",\n clientId: window.__nextDevClientId,\n page: page\n }));\n return window.location.reload();\n }\n return;\n }\n if (obj.action === \"addedPage\") {\n var _data1 = _slicedToArray(obj.data, 1), page1 = _data1[0];\n if (page1 === window.next.router.pathname && typeof window.next.router.components[page1] === \"undefined\") {\n (0, _websocket).sendMessage(JSON.stringify({\n event: \"client-added-page\",\n clientId: window.__nextDevClientId,\n page: page1\n }));\n return window.location.reload();\n }\n return;\n }\n throw new Error(\"Unexpected action \" + obj.action);\n });\n return devClient;\n};\nexports[\"default\"] = _default;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=webpack-hot-middleware-client.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXYvd2VicGFjay1ob3QtbWlkZGxld2FyZS1jbGllbnQuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Ozs7O0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsa0JBQWUsR0FBRyxLQUFLLENBQUMsQ0FBQztBQUN6QixJQUFJRyx3QkFBd0IsR0FBR0MsbUpBQStEO0FBQzlGLElBQUlDLGFBQWEsR0FBR0Ysd0JBQXdCLENBQUNDLG1CQUFPLENBQUMsMkdBQWdDLENBQUMsQ0FBQztBQUN2RixJQUFJRSxVQUFVLEdBQUdGLG1CQUFPLENBQUMsaUdBQTJCLENBQUM7QUFDckQsSUFBSUcsUUFBUSxHQUFHLFdBQUk7SUFDZixJQUFNQyxTQUFTLEdBQUcsQ0FBQyxDQUFDLEVBQUVILGFBQWEsRUFBRUgsT0FBTyxFQUFFO0lBQzlDTSxTQUFTLENBQUNDLG1CQUFtQixDQUFDLFNBQUNDLEdBQUcsRUFBRztRQUNqQyxJQUFJQSxHQUFHLENBQUNDLE1BQU0sS0FBSyxZQUFZLEVBQUU7WUFDNUIsRUFBQyxFQUFFTCxVQUFVLEVBQUVNLFdBQVcsQ0FBQ0MsSUFBSSxDQUFDQyxTQUFTLENBQUM7Z0JBQ3ZDQyxLQUFLLEVBQUUsb0JBQW9CO2dCQUMzQkMsUUFBUSxFQUFFQyxNQUFNLENBQUNDLGlCQUFpQjthQUNyQyxDQUFDLENBQUMsQ0FBQztZQUNKLE9BQU9ELE1BQU0sQ0F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G93LmxvY2F0aW9uLnJlbG9hZCgpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChvYmouYWN0aW9uID09PSAncmVtb3ZlZFBhZ2UnKSB7XG4gICAgICAgICAgICBjb25zdCBbcGFnZV0gPSBvYmouZGF0YTtcbiAgICAgICAgICAgIGlmIChwYWdlID09PSB3aW5kb3cubmV4dC5yb3V0ZXIucGF0aG5hbWUpIHtcbiAgICAgICAgICAgICAgICAoMCwgX3dlYnNvY2tldCkuc2VuZE1lc3NhZ2UoSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICBldmVudDogJ2NsaWVudC1yZW1vdmVkLXBhZ2UnLFxuICAgICAgICAgICAgICAgICAgICBjbGllbnRJZDogd2luZG93Ll9fbmV4dERldkNsaWVudElkLFxuICAgICAgICAgICAgICAgICAgICBwYWdlXG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgIHJldHVybiB3aW5kb3cubG9jYXRpb24ucmVsb2FkKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9iai5hY3Rpb24gPT09ICdhZGRlZFBhZ2UnKSB7XG4gICAgICAgICAgICBjb25zdCBbcGFnZV0gPSBvYmouZGF0YTtcbiAgICAgICAgICAgIGlmIChwYWdlID09PSB3aW5kb3cubmV4dC5yb3V0ZXIucGF0aG5hbWUgJiYgdHlwZW9mIHdpbmRvdy5uZXh0LnJvdXRlci5jb21wb25lbnRzW3BhZ2VdID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICgwLCBfd2Vic29ja2V0KS5zZW5kTWVzc2FnZShKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50OiAnY2xpZW50LWFkZGVkLXBhZ2UnLFxuICAgICAgICAgICAgICAgICAgICBjbGllbnRJZDogd2luZG93Ll9fbmV4dERldkNsaWVudElkLFxuICAgICAgICAgICAgICAgIC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udCIsIm9iaiIsImFjdGlvbiIsInNlbmRNZXNzYWdlIiwiSlNPTiIsInN0cmluZ2lmeSIsImV2ZW50IiwiY2xpZW50SWQiLCJ3aW5kb3ciLCJfX25leHREZXZDbGllbnRJZCIsImxvY2F0aW9uIiwicmVsb2FkIiwiZGF0YSIsInBhZ2UiLCJuZXh0Iiwicm91dGVyIiwicGF0aG5hbWUiLCJjb21wb25lbnRzIiwiRXJyb3IiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/webpack-hot-middleware-client.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/has-base-path.js": /*!********************************************************!*\ !*** ./node_modules/next/dist/client/has-base-path.js ***! \********************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.hasBasePath = hasBasePath;\nvar _pathHasPrefix = __webpack_require__(/*! ../shared/lib/router/utils/path-has-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js\");\nvar basePath = false || \"\";\nfunction hasBasePath(path) {\n return (0, _pathHasPrefix).pathHasPrefix(path, basePath);\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=has-base-path.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9oYXMtYmFzZS1wYXRoLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsbUJBQW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yIsImVudiIsIl9fTkVYVF9ST1VURVJfQkFTRVBBVEgiLCJwYXRoIiwicGF0aEhhc1ByZWZpeCIsImRlZmF1bHQiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/has-base-path.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/head-manager.js": /*!*******************************************************!*\ !*** ./node_modules/next/dist/client/head-manager.js ***! \*******************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _instanceof = (__webpack_require__(/*! @swc/helpers/lib/_instanceof.js */ \"./node_modules/@swc/helpers/lib/_instanceof.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = initHeadManager;\nexports.isEqualNode = isEqualNode;\nexports.DOMAttributeNames = void 0;\nfunction initHeadManager() {\n return {\n mountedInstances: new Set(),\n updateHead: function(head) {\n var tags = {};\n head.forEach(function(h) {\n if (// it won't be inlined. In this case revert to the original behavior\n h.type === \"link\" && h.props[\"data-optimized-fonts\"]) {\n if (document.querySelector('style[data-href=\"'.concat(h.props[\"data-href\"], '\"]'))) {\n return;\n } else {\n h.props.href = h.props[\"data-href\"];\n h.props[\"data-href\"] = undefined;\n }\n }\n var components = tags[h.type] || [];\n components.push(h);\n tags[h.type] = components;\n });\n var titleComponent = tags.title ? tags.title[0] : null;\n var title = \"\";\n if (titleComponent) {\n var children = titleComponent.props.children;\n title = typeof children === \"string\" ? children : Array.isArray(children) ? children.join(\"\") : \"\";\n }\n if (title !== document.title) document.title = title;\n [\n \"meta\",\n \"base\",\n \"link\",\n \"style\",\n \"script\"\n ].forEach(function(type) {\n updateElements(type, tags[type] || []);\n });\n }\n };\n}\nvar DOMAttributeNames = {\n acceptCharset: \"accept-charset\",\n className: \"class\",\n htmlFor: \"for\",\n httpEquiv: \"http-equiv\",\n noModule: \"noModule\"\n};\nexports.DOMAttributeNames = DOMAttributeNames;\nfunction reactElementToDOM(param) {\n var type = param.type, props = param.props;\n var el = document.createElement(type);\n for(var p in props){\n if (!props.hasOwnProperty(p)) continue;\n if (p === \"children\" || p === \"dangerouslySetInnerHTML\") continue;\n // we don't render undefined props to the DOM\n if (props[p] === undefined) continue;\n var attr = DOMAttributeNames[p] || p.toLowerCase();\n if (type === \"script\" && (attr === \"async\" || attr === \"defer\" || attr === \"noModule\")) {\n el[attr] = !!props[p];\n } else {\n el.setAttribute(attr, props[p]);\n }\n }\n var children = props.children, dangerouslySetInnerHTML = props.dangerouslySetInnerHTML;\n if (dangerouslySetInnerHTML) {\n el.innerHTML = dangerouslySetInnerHTML.__html || \"\";\n } else if (children) {\n el.textContent = typeof children === \"string\" ? children : Array.isArray(children) ? children.join(\"\") : \"\";\n }\n return el;\n}\nfunction isEqualNode(oldTag, newTag) {\n if (_instanceof(oldTag, HTMLElement) && _instanceof(newTag, HTMLElement)) {\n var nonce = newTag.getAttribute(\"nonce\");\n // Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not\n // be stripped if there is no content security policy response header that includes a nonce.\n if (nonce && !oldTag.getAttribute(\"nonce\")) {\n var cloneTag = newTag.cloneNode(true);\n cloneTag.setAttribute(\"nonce\", \"\");\n cloneTag.nonce = nonce;\n return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);\n }\n }\n return oldTag.isEqualNode(newTag);\n}\nfunction updateElements(type, components) {\n var headEl = document.getElementsByTagName(\"head\")[0];\n var headCountEl = headEl.querySelector(\"meta[name=next-head-count]\");\n if (true) {\n if (!headCountEl) {\n console.error(\"Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing\");\n return;\n }\n }\n var headCount = Number(headCountEl.content);\n var oldTags = [];\n for(var i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){\n var ref;\n if ((j == null ? void 0 : (ref = j.tagName) == null ? void 0 : ref.toLowerCase()) === type) {\n oldTags.push(j);\n }\n }\n var newTags = components.map(reactElementToDOM).filter(function(newTag) {\n for(var k = 0, len = oldTags.length; k < len; k++){\n var oldTag = oldTags[k];\n if (isEqualNode(oldTag, newTag)) {\n oldTags.splice(k, 1);\n return false;\n }\n }\n return true;\n });\n oldTags.forEach(function(t) {\n var ref;\n return (ref = t.parentNode) == null ? void 0 : ref.removeChild(t);\n });\n newTags.forEach(function(t) {\n return headEl.insertBefore(t, headCountEl);\n });\n headCountEl.content = (headCount - oldTags.length + newTags.length).toString();\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=head-manager.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9oZWFkLW1hbmFnZXIuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Ozs7O0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsa0JBQWUsR0FBR0csZUFBZSxDQUFDO0FBQ2xDSCxtQkFBbUIsR0FBR0ksV0FBVyxDQUFDO0FBQ2xDSix5QkFBeUIsR0FBRyxLQUFLLENBQUMsQ0FBQztBQUNuQyxTQUFTRyxlQUFlLEdBQUc7SUFDdkIsT0FBTztRQUNIRyxnQkFBZ0IsRUFBRSxJQUFJQyxHQUFHLEVBQUU7UUFDM0JDLFVBQVUsRUFBRSxTQUFDQyxJQUFJLEVBQUc7WUFDaEIsSUFBTUMsSUFBSSxHQUFHLEVBQUU7WUFDZkQsSUFBSSxDQUFDRSxPQUFPLENBQUMsU0FBQ0MsQ0FBQyxFQUFHO2dCQU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Y3Rpb24gaW5pdEhlYWRNYW5hZ2VyKCkge1xuICAgIHJldHVybiB7XG4gICAgICAgIG1vdW50ZWRJbnN0YW5jZXM6IG5ldyBTZXQoKSxcbiAgICAgICAgdXBkYXRlSGVhZDogKGhlYWQpPT57XG4gICAgICAgICAgICBjb25zdCB0YWdzID0ge307XG4gICAgICAgICAgICBoZWFkLmZvckVhY2goKGgpPT57XG4gICAgICAgICAgICAgICAgaWYgKC8vIElmIHRoZSBmb250IHRhZyBpcyBsb2FkZWQgb25seSBvbiBjbGllbnQgbmF2aWdhdGlvblxuICAgICAgICAgICAgICAgIC8vIGl0IHdvbid0IGJlIGlubGluZWQuIEluIHRoaXMgY2FzZSByZXZlcnQgdG8gdGhlIG9yaWdpbmFsIGJlaGF2aW9yXG4gICAgICAgICAgICAgICAgaC50eXBlID09PSAnbGluaycgJiYgaC5wcm9wc1snZGF0YS1vcHRpbWl6ZWQtZm9udHMnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQucXVlcnlTZWxlY3Rvcihgc3R5bGVbZGF0YS1ocmVmPVwiJHtoLnByb3BzWydkYXRhLWhyZWYnXX1cIl1gKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaC5wcm9wcy5ocmVmID0gaC5wcm9wc1snZGF0YS1ocmVmJ107XG4gICAgICAgICAgICAgICAgICAgICAgICBoLnByb3BzWydkYXRhLWhyZWYnXSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCBjb21wb25lbnRzID0gdGFnc1toLnR5cGVdIHx8IFtdO1xuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucHVzaChoKTtcbiAgICAgICAgICAgICAgICB0YWdzW2gudHlwZV0gPSBjb21wb25lbnRzO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBjb25zdCB0aXRsZUNvbXBvbmVudCA9IHRhZ3MudGl0bGUgPyB0YWdzLnRpdGxlWzBdIDogbnVsbDtcbiAgICAgICAgICAgIGxldCB0aXRsZSA9ICcnO1xuICAgICAgICAgICAgaWYgKHRpdGxlQ29tcG9uZW50KSB7XG4gICAgICAgICAgICAgICAgY29uc3QgeyBjaGlsZHJlbiAgfSA9IHRpdGxlQ29tcG9uZW50LnByb3BzO1xuICAgICAgICAgICAgICAgIHRpdGxlID0gdHlwZW9mIGNoaWxkcmVuID09PSAnc3RyaW5nJyA/IGNoaWxkcmVuIDogQXJyYXkuaXNBcnJheShjaGlsZHJlbikgPyBjaGlsZHJlbi5qb2luKCcnKSA6ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRpdGxlICE9PSBkb2N1bWVudC50aXRsZSkgZG9jdW1lbnQudGl0bGUgPSB0aXRsZTtcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAnbWV0YScsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnLFxuICAgICAgICAgICAgICAgICdsaW5rJyxcbiAgICAgICAgICAgICAgICAnc3R5bGUnLFxuICAgICAgICAgICAgICAgICdzY3JpcHQnXG4gICAgICAgICAgICBdLmZvckVhY2goKHR5cGUpPT57XG4gICAgICAgICAgICAgICAgdXBkYXRlRWxlbWVudHModHlwZSwgdGFnc1t0eXBlXSB8fCBbXSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH07XG59XG5jb25zdCBET01BdHRyaWJ1dGVOYW1lcyA9IHtcbiAgICBhY2NlcHRDaGFyc2V0OiAnYWNjZXB0LWNoYXJzZXQnLFxuICAgIGNsYXNzTmFtZTogJ2NsYXNzJyxcbiAgICBodG1sRm9yOiAnZm9yJyxcbiAgICBodHRwRXF1aXY6ICdodHRwLWVxdWl2JyxcbiAgICBub01vZHVsZTogJ25vTW9kdWxlJ1xufTtcbmV4cG9yd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IsIkhUTUxFbGVtZW50Iiwibm9uY2UiLCJnZXRBdHRyaWJ1dGUiLCJjbG9uZVRhZyIsImNsb25lTm9kZSIsImhlYWRFbCIsImdldEVsZW1lbnRzQnlUYWdOYW1lIiwiaGVhZENvdW50RWwiLCJwcm9jZXNzIiwiY29uc29sZSIsImVycm9yIiwiaGVhZENvdW50IiwiTnVtYmVyIiwiY29udGVudCIsIm9sZFRhZ3MiLCJpIiwiaiIsInByZXZpb3VzRWxlbWVudFNpYmxpbmciLCJyZWYiLCJ0YWdOYW1lIiwibmV3VGFncyIsIm1hcCIsImZpbHRlciIsImsiLCJsZW4iLCJsZW5ndGgiLCJzcGxpY2UiLCJ0IiwicGFyZW50Tm9kZSIsInJlbW92ZUNoaWxkIiwiaW5zZXJ0QmVmb3JlIiwidG9TdHJpbmciLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/head-manager.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/index.js": /*!************************************************!*\ !*** ./node_modules/next/dist/client/index.js ***! \************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _classCallCheck = (__webpack_require__(/*! @swc/helpers/lib/_class_call_check.js */ \"./node_modules/@swc/helpers/lib/_class_call_check.js\")[\"default\"]);\nvar _createClass = (__webpack_require__(/*! @swc/helpers/lib/_create_class.js */ \"./node_modules/@swc/helpers/lib/_create_class.js\")[\"default\"]);\nvar _inherits = (__webpack_require__(/*! @swc/helpers/lib/_inherits.js */ \"./node_modules/@swc/helpers/lib/_inherits.js\")[\"default\"]);\nvar _interopRequireWildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ \"./node_modules/@swc/helpers/lib/_interop_require_wildcard.js\")[\"default\"]);\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nvar _createSuper = (__webpack_require__(/*! @swc/helpers/lib/_create_super.js */ \"./node_modules/@swc/helpers/lib/_create_super.js\")[\"default\"]);\nvar _tsGenerator = (__webpack_require__(/*! @swc/helpers/lib/_ts_generator.js */ \"./node_modules/@swc/helpers/lib/_ts_generator.js\")[\"default\"]);\nvar _s = $RefreshSig$(), _s1 = $RefreshSig$();\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.initialize = initialize;\nexports.hydrate = hydrate;\nexports.emitter = exports.router = exports.version = void 0;\nvar _async_to_generator = (__webpack_require__(/*! @swc/helpers/lib/_async_to_generator.js */ \"./node_modules/@swc/helpers/lib/_async_to_generator.js\")[\"default\"]);\nvar _extends = (__webpack_require__(/*! @swc/helpers/lib/_extends.js */ \"./node_modules/@swc/helpers/lib/_extends.js\")[\"default\"]);\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _interop_require_wildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ \"./node_modules/@swc/helpers/lib/_interop_require_wildcard.js\")[\"default\"]);\n__webpack_require__(/*! ../build/polyfills/polyfill-module */ \"./node_modules/next/dist/build/polyfills/polyfill-module.js\");\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _headManagerContext = __webpack_require__(/*! ../shared/lib/head-manager-context */ \"./node_modules/next/dist/shared/lib/head-manager-context.js\");\nvar _mitt = _interop_require_default(__webpack_require__(/*! ../shared/lib/mitt */ \"./node_modules/next/dist/shared/lib/mitt.js\"));\nvar _routerContext = __webpack_require__(/*! ../shared/lib/router-context */ \"./node_modules/next/dist/shared/lib/router-context.js\");\nvar _isDynamic = __webpack_require__(/*! ../shared/lib/router/utils/is-dynamic */ \"./node_modules/next/dist/shared/lib/router/utils/is-dynamic.js\");\nvar _querystring = __webpack_require__(/*! ../shared/lib/router/utils/querystring */ \"./node_modules/next/dist/shared/lib/router/utils/querystring.js\");\nvar _runtimeConfig = __webpack_require__(/*! ../shared/lib/runtime-config */ \"./node_modules/next/dist/shared/lib/runtime-config.js\");\nvar _utils = __webpack_require__(/*! ../shared/lib/utils */ \"./node_modules/next/dist/shared/lib/utils.js\");\nvar _portal = __webpack_require__(/*! ./portal */ \"./node_modules/next/dist/client/portal/index.js\");\nvar _headManager = _interop_require_default(__webpack_require__(/*! ./head-manager */ \"./node_modules/next/dist/client/head-manager.js\"));\nvar _pageLoader = _interop_require_default(__webpack_require__(/*! ./page-loader */ \"./node_modules/next/dist/client/page-loader.js\"));\nvar _performanceRelayer = _interop_require_default(__webpack_require__(/*! ./performance-relayer */ \"./node_modules/next/dist/client/performance-relayer.js\"));\nvar _routeAnnouncer = __webpack_require__(/*! ./route-announcer */ \"./node_modules/next/dist/client/route-announcer.js\");\nvar _router = __webpack_require__(/*! ./router */ \"./node_modules/next/dist/client/router.js\");\nvar _isError = __webpack_require__(/*! ../lib/is-error */ \"./node_modules/next/dist/lib/is-error.js\");\nvar _imageConfigContext = __webpack_require__(/*! ../shared/lib/image-config-context */ \"./node_modules/next/dist/shared/lib/image-config-context.js\");\nvar _removeBasePath = __webpack_require__(/*! ./remove-base-path */ \"./node_modules/next/dist/client/remove-base-path.js\");\nvar _hasBasePath = __webpack_require__(/*! ./has-base-path */ \"./node_modules/next/dist/client/has-base-path.js\");\nvar ReactDOM = true ? __webpack_require__(/*! react-dom/client */ \"./node_modules/react-dom/client.js\") : 0;\nvar version = \"12.3.4\";\nexports.version = version;\nvar router;\nexports.router = router;\nvar emitter = (0, _mitt).default();\nexports.emitter = emitter;\nvar looseToArray = function(input) {\n return [].slice.call(input);\n};\nvar initialData;\nvar defaultLocale = undefined;\nvar asPath;\nvar pageLoader;\nvar appElement;\nvar headManager;\nvar initialMatchesMiddleware = false;\nvar lastAppProps;\nvar lastRenderReject;\nvar webpackHMR;\nvar CachedApp, onPerfEntry;\nvar CachedComponent;\nself.__next_require__ = __webpack_require__;\nvar Container = /*#__PURE__*/ function(_Component) {\n \"use strict\";\n _inherits(Container, _Component);\n var _super = _createSuper(Container);\n function Container() {\n _classCallCheck(this, Container);\n return _super.apply(this, arguments);\n }\n _createClass(Container, [\n {\n key: \"componentDidCatch\",\n value: function componentDidCatch(componentErr, info) {\n this.props.fn(componentErr, info);\n }\n },\n {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.scrollToHash();\n // We need to replace the router state if:\n // - the page was (auto) exported and has a query string or search (hash)\n // - it was auto exported and is a dynamic route (to provide params)\n // - if it is a client-side skeleton (fallback render)\n // - if middleware matches the current page (may have rewrite params)\n // - if rewrites in next.config.js match (may have rewrite params)\n if (router.isSsr && // We don't update for 404 requests as this can modify\n // the asPath unexpectedly e.g. adding basePath when\n // it wasn't originally present\n initialData.page !== \"/404\" && initialData.page !== \"/_error\" && (initialData.isFallback || initialData.nextExport && ((0, _isDynamic).isDynamicRoute(router.pathname) || location.search || false || initialMatchesMiddleware) || initialData.props && initialData.props.__N_SSG && (location.search || false || initialMatchesMiddleware))) {\n // update query on mount for exported pages\n router.replace(router.pathname + \"?\" + String((0, _querystring).assign((0, _querystring).urlQueryToSearchParams(router.query), new URLSearchParams(location.search))), asPath, {\n // @ts-ignore\n // WARNING: `_h` is an internal option for handing Next.js\n // client-side hydration. Your app should _never_ use this property.\n // It may change at any time without notice.\n _h: 1,\n // Fallback pages must trigger the data fetch, so the transition is\n // not shallow.\n // Other pages (strictly updating query) happens shallowly, as data\n // requirements would already be present.\n shallow: !initialData.isFallback && !initialMatchesMiddleware\n }).catch(function(err) {\n if (!err.cancelled) throw err;\n });\n }\n }\n },\n {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.scrollToHash();\n }\n },\n {\n key: \"scrollToHash\",\n value: function scrollToHash() {\n var hash = location.hash;\n hash = hash && hash.substring(1);\n if (!hash) return;\n var el = document.getElementById(hash);\n if (!el) return;\n // If we call scrollIntoView() in here without a setTimeout\n // it won't scroll properly.\n setTimeout(function() {\n return el.scrollIntoView();\n }, 0);\n }\n },\n {\n key: \"render\",\n value: function render() {\n if (false) {} else {\n var ReactDevOverlay = (__webpack_require__(/*! next/dist/compiled/@next/react-dev-overlay/dist/client */ \"./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js\").ReactDevOverlay);\n return /*#__PURE__*/ _react.default.createElement(ReactDevOverlay, null, this.props.children);\n }\n }\n }\n ]);\n return Container;\n}(_react.default.Component);\nfunction initialize() {\n return _initialize.apply(this, arguments);\n}\nfunction _initialize() {\n _initialize = _async_to_generator(function() {\n var opts, prefix, normalizeLocalePath, detectDomainLocale, parseRelativeUrl, formatUrl, parsedAs, localePathResult, detectedDomain, initScriptLoader, register;\n var _arguments = arguments;\n return _tsGenerator(this, function(_state) {\n opts = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};\n // This makes sure this specific lines are removed in production\n if (true) {\n webpackHMR = opts.webpackHMR;\n }\n initialData = JSON.parse(document.getElementById(\"__NEXT_DATA__\").textContent);\n window.__NEXT_DATA__ = initialData;\n defaultLocale = initialData.defaultLocale;\n prefix = initialData.assetPrefix || \"\";\n // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time\n // So, this is how we do it in the client side at runtime\n __webpack_require__.p = \"\".concat(prefix, \"/_next/\") //eslint-disable-line\n ;\n // Initialize next/config with the environment configuration\n (0, _runtimeConfig).setConfig({\n serverRuntimeConfig: {},\n publicRuntimeConfig: initialData.runtimeConfig || {}\n });\n asPath = (0, _utils).getURL();\n // make sure not to attempt stripping basePath for 404s\n if ((0, _hasBasePath).hasBasePath(asPath)) {\n asPath = (0, _removeBasePath).removeBasePath(asPath);\n }\n if (false) {}\n if (initialData.scriptLoader) {\n initScriptLoader = (__webpack_require__(/*! ./script */ \"./node_modules/next/dist/client/script.js\").initScriptLoader);\n initScriptLoader(initialData.scriptLoader);\n }\n pageLoader = new _pageLoader.default(initialData.buildId, prefix);\n register = function(param) {\n var _param = _slicedToArray(param, 2), r = _param[0], f = _param[1];\n return pageLoader.routeLoader.onEntrypoint(r, f);\n };\n if (window.__NEXT_P) {\n // Defer page registration for another tick. This will increase the overall\n // latency in hydrating the page, but reduce the total blocking time.\n window.__NEXT_P.map(function(p) {\n return setTimeout(function() {\n return register(p);\n }, 0);\n });\n }\n window.__NEXT_P = [];\n window.__NEXT_P.push = register;\n headManager = (0, _headManager).default();\n headManager.getIsSsr = function() {\n return router.isSsr;\n };\n appElement = document.getElementById(\"__next\");\n return [\n 2,\n {\n assetPrefix: prefix\n }\n ];\n });\n });\n return _initialize.apply(this, arguments);\n}\nfunction renderApp(App, appProps) {\n return /*#__PURE__*/ _react.default.createElement(App, Object.assign({}, appProps));\n}\nfunction AppContainer(param) {\n var children = param.children;\n return /*#__PURE__*/ _react.default.createElement(Container, {\n fn: function(error) {\n return(// eslint-disable-next-line @typescript-eslint/no-use-before-define\n renderError({\n App: CachedApp,\n err: error\n }).catch(function(err) {\n return console.error(\"Error rendering page: \", err);\n }));\n }\n }, /*#__PURE__*/ _react.default.createElement(_routerContext.RouterContext.Provider, {\n value: (0, _router).makePublicRouterInstance(router)\n }, /*#__PURE__*/ _react.default.createElement(_headManagerContext.HeadManagerContext.Provider, {\n value: headManager\n }, /*#__PURE__*/ _react.default.createElement(_imageConfigContext.ImageConfigContext.Provider, {\n value: {\"deviceSizes\":[640,750,828,1080,1200,1920,2048,3840],\"imageSizes\":[16,32,48,64,96,128,256,384],\"path\":\"/_next/image\",\"loader\":\"default\",\"dangerouslyAllowSVG\":false,\"unoptimized\":false,\"domains\":[],\"remotePatterns\":[]}\n }, children))));\n}\n_c = AppContainer;\nvar wrapApp = function(App) {\n return function(wrappedAppProps) {\n var appProps = _extends({}, wrappedAppProps, {\n Component: CachedComponent,\n err: initialData.err,\n router: router\n });\n return /*#__PURE__*/ _react.default.createElement(AppContainer, null, renderApp(App, appProps));\n };\n};\n// This method handles all runtime and debug errors.\n// 404 and 500 errors are special kind of errors\n// and they are still handle via the main render method.\nfunction renderError(renderErrorProps) {\n var App = renderErrorProps.App, err = renderErrorProps.err;\n // In development runtime errors are caught by our overlay\n // In production we catch runtime errors using componentDidCatch which will trigger renderError\n if (true) {\n // A Next.js rendering runtime error is always unrecoverable\n // FIXME: let's make this recoverable (error in GIP client-transition)\n webpackHMR.onUnrecoverableError();\n // We need to render an empty so that the `` can\n // render itself.\n // TODO: Fix disabled eslint rule\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return doRender({\n App: function() {\n return null;\n },\n props: {},\n Component: function() {\n return null;\n },\n styleSheets: []\n });\n }\n // Make sure we log the error to the console, otherwise users can't track down issues.\n console.error(err);\n console.error(\"A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred\");\n return pageLoader.loadPage(\"/_error\").then(function(param) {\n var ErrorComponent = param.page, styleSheets = param.styleSheets;\n return (lastAppProps == null ? void 0 : lastAppProps.Component) === ErrorComponent ? Promise.resolve().then(function() {\n return /*#__PURE__*/ _interopRequireWildcard(__webpack_require__(/*! ../pages/_error */ \"./node_modules/next/dist/pages/_error.js\"));\n }).then(function(errorModule) {\n return Promise.resolve().then(function() {\n return /*#__PURE__*/ _interopRequireWildcard(__webpack_require__(/*! ../pages/_app */ \"./node_modules/next/dist/pages/_app.js\"));\n }).then(function(appModule) {\n App = appModule.default;\n renderErrorProps.App = App;\n return errorModule;\n });\n }).then(function(m) {\n return {\n ErrorComponent: m.default,\n styleSheets: []\n };\n }) : {\n ErrorComponent: ErrorComponent,\n styleSheets: styleSheets\n };\n }).then(function(param) {\n var ErrorComponent = param.ErrorComponent, styleSheets = param.styleSheets;\n var ref;\n // In production we do a normal render with the `ErrorComponent` as component.\n // If we've gotten here upon initial render, we can use the props from the server.\n // Otherwise, we need to call `getInitialProps` on `App` before mounting.\n var AppTree = wrapApp(App);\n var appCtx = {\n Component: ErrorComponent,\n AppTree: AppTree,\n router: router,\n ctx: {\n err: err,\n pathname: initialData.page,\n query: initialData.query,\n asPath: asPath,\n AppTree: AppTree\n }\n };\n return Promise.resolve(((ref = renderErrorProps.props) == null ? void 0 : ref.err) ? renderErrorProps.props : (0, _utils).loadGetInitialProps(App, appCtx)).then(function(initProps) {\n return(// eslint-disable-next-line @typescript-eslint/no-use-before-define\n doRender(_extends({}, renderErrorProps, {\n err: err,\n Component: ErrorComponent,\n styleSheets: styleSheets,\n props: initProps\n })));\n });\n });\n}\n// Dummy component that we render as a child of Root so that we can\n// toggle the correct styles before the page is rendered.\nfunction Head(param) {\n var callback = param.callback;\n _s();\n // We use `useLayoutEffect` to guarantee the callback is executed\n // as soon as React flushes the update.\n _react.default.useLayoutEffect(function() {\n return callback();\n }, [\n callback\n ]);\n return null;\n}\n_s(Head, \"n7/vCynhJvM+pLkyL2DMQUF0odM=\");\n_c1 = Head;\nvar reactRoot = null;\n// On initial render a hydrate should always happen\nvar shouldHydrate = true;\nfunction clearMarks() {\n [\n \"beforeRender\",\n \"afterHydrate\",\n \"afterRender\",\n \"routeChange\"\n ].forEach(function(mark) {\n return performance.clearMarks(mark);\n });\n}\nfunction markHydrateComplete() {\n if (!_utils.ST) return;\n performance.mark(\"afterHydrate\") // mark end of hydration\n ;\n performance.measure(\"Next.js-before-hydration\", \"navigationStart\", \"beforeRender\");\n performance.measure(\"Next.js-hydration\", \"beforeRender\", \"afterHydrate\");\n if (onPerfEntry) {\n performance.getEntriesByName(\"Next.js-hydration\").forEach(onPerfEntry);\n }\n clearMarks();\n}\nfunction markRenderComplete() {\n if (!_utils.ST) return;\n performance.mark(\"afterRender\") // mark end of render\n ;\n var navStartEntries = performance.getEntriesByName(\"routeChange\", \"mark\");\n if (!navStartEntries.length) return;\n performance.measure(\"Next.js-route-change-to-render\", navStartEntries[0].name, \"beforeRender\");\n performance.measure(\"Next.js-render\", \"beforeRender\", \"afterRender\");\n if (onPerfEntry) {\n performance.getEntriesByName(\"Next.js-render\").forEach(onPerfEntry);\n performance.getEntriesByName(\"Next.js-route-change-to-render\").forEach(onPerfEntry);\n }\n clearMarks();\n [\n \"Next.js-route-change-to-render\",\n \"Next.js-render\"\n ].forEach(function(measure) {\n return performance.clearMeasures(measure);\n });\n}\nfunction renderReactElement(domEl, fn) {\n // mark start of hydrate/render\n if (_utils.ST) {\n performance.mark(\"beforeRender\");\n }\n var reactEl = fn(shouldHydrate ? markHydrateComplete : markRenderComplete);\n if (true) {\n if (!reactRoot) {\n // Unlike with createRoot, you don't need a separate root.render() call here\n reactRoot = ReactDOM.hydrateRoot(domEl, reactEl);\n // TODO: Remove shouldHydrate variable when React 18 is stable as it can depend on `reactRoot` existing\n shouldHydrate = false;\n } else {\n var startTransition = _react.default.startTransition;\n startTransition(function() {\n reactRoot.render(reactEl);\n });\n }\n } else {}\n}\nfunction Root(param) {\n var callbacks = param.callbacks, children = param.children;\n _s1();\n // We use `useLayoutEffect` to guarantee the callbacks are executed\n // as soon as React flushes the update\n _react.default.useLayoutEffect(function() {\n return callbacks.forEach(function(callback) {\n return callback();\n });\n }, [\n callbacks\n ]);\n // We should ask to measure the Web Vitals after rendering completes so we\n // don't cause any hydration delay:\n _react.default.useEffect(function() {\n (0, _performanceRelayer).default(onPerfEntry);\n }, []);\n if (false) {}\n return children;\n}\n_s1(Root, \"Gjgl5rfcc2T4sFnfEMfRvL6K4Q4=\");\n_c2 = Root;\nfunction doRender(input) {\n var onStart = // This function has a return type to ensure it doesn't start returning a\n // Promise. It should remain synchronous.\n function onStart() {\n if (!styleSheets || // We use `style-loader` in development, so we don't need to do anything\n // unless we're in production:\n \"development\" !== \"production\") {\n return false;\n }\n var currentStyleTags = looseToArray(document.querySelectorAll(\"style[data-n-href]\"));\n var currentHrefs = new Set(currentStyleTags.map(function(tag) {\n return tag.getAttribute(\"data-n-href\");\n }));\n var noscript = document.querySelector(\"noscript[data-n-css]\");\n var nonce = noscript == null ? void 0 : noscript.getAttribute(\"data-n-css\");\n styleSheets.forEach(function(param) {\n var href = param.href, text = param.text;\n if (!currentHrefs.has(href)) {\n var styleTag = document.createElement(\"style\");\n styleTag.setAttribute(\"data-n-href\", href);\n styleTag.setAttribute(\"media\", \"x\");\n if (nonce) {\n styleTag.setAttribute(\"nonce\", nonce);\n }\n document.head.appendChild(styleTag);\n styleTag.appendChild(document.createTextNode(text));\n }\n });\n return true;\n };\n var onHeadCommit = function onHeadCommit() {\n if (// unless we're in production:\n false) { var referenceNode, idx, currentHrefs, currentStyleTags, desiredHrefs; }\n if (input.scroll) {\n var htmlElement = document.documentElement;\n var existing = htmlElement.style.scrollBehavior;\n htmlElement.style.scrollBehavior = \"auto\";\n window.scrollTo(input.scroll.x, input.scroll.y);\n htmlElement.style.scrollBehavior = existing;\n }\n };\n var onRootCommit = function onRootCommit() {\n resolvePromise();\n };\n var App = input.App, Component = input.Component, props = input.props, err = input.err;\n var styleSheets = \"initial\" in input ? undefined : input.styleSheets;\n Component = Component || lastAppProps.Component;\n props = props || lastAppProps.props;\n var appProps = _extends({}, props, {\n Component: Component,\n err: err,\n router: router\n });\n // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.\n lastAppProps = appProps;\n var canceled = false;\n var resolvePromise;\n var renderPromise = new Promise(function(resolve, reject) {\n if (lastRenderReject) {\n lastRenderReject();\n }\n resolvePromise = function() {\n lastRenderReject = null;\n resolve();\n };\n lastRenderReject = function() {\n canceled = true;\n lastRenderReject = null;\n var error = new Error(\"Cancel rendering route\");\n error.cancelled = true;\n reject(error);\n };\n });\n onStart();\n var elem = /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(Head, {\n callback: onHeadCommit\n }), /*#__PURE__*/ _react.default.createElement(AppContainer, null, renderApp(App, appProps), /*#__PURE__*/ _react.default.createElement(_portal.Portal, {\n type: \"next-route-announcer\"\n }, /*#__PURE__*/ _react.default.createElement(_routeAnnouncer.RouteAnnouncer, null))));\n // We catch runtime errors using componentDidCatch which will trigger renderError\n renderReactElement(appElement, function(callback) {\n return /*#__PURE__*/ _react.default.createElement(Root, {\n callbacks: [\n callback,\n onRootCommit\n ]\n }, true ? /*#__PURE__*/ _react.default.createElement(_react.default.StrictMode, null, elem) : 0);\n });\n return renderPromise;\n}\nfunction render(renderingProps) {\n return _render.apply(this, arguments);\n}\nfunction _render() {\n _render = _async_to_generator(function(renderingProps) {\n var err, renderErr;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n if (!renderingProps.err) return [\n 3,\n 2\n ];\n return [\n 4,\n renderError(renderingProps)\n ];\n case 1:\n _state.sent();\n return [\n 2\n ];\n case 2:\n _state.trys.push([\n 2,\n 4,\n ,\n 6\n ]);\n return [\n 4,\n doRender(renderingProps)\n ];\n case 3:\n _state.sent();\n return [\n 3,\n 6\n ];\n case 4:\n err = _state.sent();\n renderErr = (0, _isError).getProperError(err);\n // bubble up cancelation errors\n if (renderErr.cancelled) {\n throw renderErr;\n }\n if (true) {\n // Ensure this error is displayed in the overlay in development\n setTimeout(function() {\n throw renderErr;\n });\n }\n return [\n 4,\n renderError(_extends({}, renderingProps, {\n err: renderErr\n }))\n ];\n case 5:\n _state.sent();\n return [\n 3,\n 6\n ];\n case 6:\n return [\n 2\n ];\n }\n });\n });\n return _render.apply(this, arguments);\n}\nfunction hydrate(opts) {\n return _hydrate.apply(this, arguments);\n}\nfunction _hydrate() {\n _hydrate = _async_to_generator(function(opts) {\n var initialErr, appEntrypoint, app, mod, pageEntrypoint, _tmp, isValidElementType, error1, getServerError, renderCtx;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n initialErr = initialData.err;\n _state.label = 1;\n case 1:\n _state.trys.push([\n 1,\n 6,\n ,\n 7\n ]);\n return [\n 4,\n pageLoader.routeLoader.whenEntrypoint(\"/_app\")\n ];\n case 2:\n appEntrypoint = _state.sent();\n if (\"error\" in appEntrypoint) {\n throw appEntrypoint.error;\n }\n app = appEntrypoint.component, mod = appEntrypoint.exports;\n CachedApp = app;\n if (mod && mod.reportWebVitals) {\n onPerfEntry = function(param) {\n var id = param.id, name = param.name, startTime = param.startTime, value = param.value, duration = param.duration, entryType = param.entryType, entries = param.entries;\n // Combines timestamp with random number for unique ID\n var uniqueID = \"\".concat(Date.now(), \"-\").concat(Math.floor(Math.random() * (9e12 - 1)) + 1e12);\n var perfStartEntry;\n if (entries && entries.length) {\n perfStartEntry = entries[0].startTime;\n }\n var webVitals = {\n id: id || uniqueID,\n name: name,\n startTime: startTime || perfStartEntry,\n value: value == null ? duration : value,\n label: entryType === \"mark\" || entryType === \"measure\" ? \"custom\" : \"web-vital\"\n };\n mod.reportWebVitals(webVitals);\n };\n }\n if (!// error, so we need to skip waiting for the entrypoint.\n ( true && initialData.err)) return [\n 3,\n 3\n ];\n _tmp = {\n error: initialData.err\n };\n return [\n 3,\n 5\n ];\n case 3:\n return [\n 4,\n pageLoader.routeLoader.whenEntrypoint(initialData.page)\n ];\n case 4:\n _tmp = _state.sent();\n _state.label = 5;\n case 5:\n pageEntrypoint = _tmp;\n if (\"error\" in pageEntrypoint) {\n throw pageEntrypoint.error;\n }\n CachedComponent = pageEntrypoint.component;\n if (true) {\n isValidElementType = (__webpack_require__(/*! next/dist/compiled/react-is */ \"./node_modules/next/dist/compiled/react-is/index.js\").isValidElementType);\n if (!isValidElementType(CachedComponent)) {\n throw new Error('The default export is not a React Component in page: \"'.concat(initialData.page, '\"'));\n }\n }\n return [\n 3,\n 7\n ];\n case 6:\n error1 = _state.sent();\n // This catches errors like throwing in the top level of a module\n initialErr = (0, _isError).getProperError(error1);\n return [\n 3,\n 7\n ];\n case 7:\n if (true) {\n getServerError = (__webpack_require__(/*! next/dist/compiled/@next/react-dev-overlay/dist/client */ \"./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js\").getServerError);\n // Server-side runtime errors need to be re-thrown on the client-side so\n // that the overlay is rendered.\n if (initialErr) {\n if (initialErr === initialData.err) {\n setTimeout(function() {\n var error;\n try {\n // Generate a new error object. We `throw` it because some browsers\n // will set the `stack` when thrown, and we want to ensure ours is\n // not overridden when we re-throw it below.\n throw new Error(initialErr.message);\n } catch (e) {\n error = e;\n }\n error.name = initialErr.name;\n error.stack = initialErr.stack;\n throw getServerError(error, initialErr.source);\n });\n } else {\n setTimeout(function() {\n throw initialErr;\n });\n }\n }\n }\n if (!window.__NEXT_PRELOADREADY) return [\n 3,\n 9\n ];\n return [\n 4,\n window.__NEXT_PRELOADREADY(initialData.dynamicIds)\n ];\n case 8:\n _state.sent();\n _state.label = 9;\n case 9:\n exports.router = router = (0, _router).createRouter(initialData.page, initialData.query, asPath, {\n initialProps: initialData.props,\n pageLoader: pageLoader,\n App: CachedApp,\n Component: CachedComponent,\n wrapApp: wrapApp,\n err: initialErr,\n isFallback: Boolean(initialData.isFallback),\n subscription: function(info, App, scroll) {\n return render(Object.assign({}, info, {\n App: App,\n scroll: scroll\n }));\n },\n locale: initialData.locale,\n locales: initialData.locales,\n defaultLocale: defaultLocale,\n domainLocales: initialData.domainLocales,\n isPreview: initialData.isPreview\n });\n return [\n 4,\n router._initialMatchesMiddlewarePromise\n ];\n case 10:\n initialMatchesMiddleware = _state.sent();\n renderCtx = {\n App: CachedApp,\n initial: true,\n Component: CachedComponent,\n props: initialData.props,\n err: initialErr\n };\n if (!(opts == null ? void 0 : opts.beforeRender)) return [\n 3,\n 12\n ];\n return [\n 4,\n opts.beforeRender()\n ];\n case 11:\n _state.sent();\n _state.label = 12;\n case 12:\n render(renderCtx);\n return [\n 2\n ];\n }\n });\n });\n return _hydrate.apply(this, arguments);\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=index.js.map\nvar _c, _c1, _c2;\n$RefreshReg$(_c, \"AppContainer\");\n$RefreshReg$(_c1, \"Head\");\n$RefreshReg$(_c2, \"Root\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application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W50OiBtLmRlZmF1bHQsXG4gICAgICAgICAgICAgICAgc3R5bGVTaGVldHM6IFtdXG4gICAgICAgICAgICB9KSkgOiB7XG4gICAgICAgICAgICBFcnJvckNvbXBvbmVudCxcbiAgICAgICAgICAgIHN0eWxlU2hlZXRzXG4gICAgICAgIH07XG4gICAgfSkudGhlbigoeyBFcnJvckNvbXBvbmVudCAsIHN0eWxlU2hlZXRzICB9KT0+e1xuICAgICAgICB2YXIgcmVmO1xuICAgICAgICAvLyBJbiBwcm9kdWN0aW9uIHdlIGRvIGEgbm9ybWFsIHJlbmRlciB3aXRoIHRoZSBgRXJyb3JDb21wb25lbnRgIGFzIGNvbXBvbmVudC5cbiAgICAgICAgLy8gSWYgd2UndmUgZ290dGVuIGhlcmUgdXBvbiBpbml0aWFsIHJlbmRlciwgd2UgY2FuIHVzZSB0aGUgcHJvcHMgZnJvbSB0aGUgc2VydmVyLlxuICAgICAgICAvLyBPdGhlcndpc2UsIHdlIG5lZWQgdG8gY2FsbCBgZ2V0SW5pdGlhbFByb3BzYCBvbiBgQXBwYCBiZWZvcmUgbW91bnRpbmcuXG4gICAgICAgIGNvbnN0IEFwcFRyZWUgPSB3cmFwQXBwKEFwcCk7XG4gICAgICAgIGNvbnN0IGFwcEN0eCA9IHtcbiAgICAgICAgICAgIENvbXBvbmVudDogRXJyb3JDb21wb25lbnQsXG4gICAgICAgICAgICBBcHBUcmVlLFxuICAgICAgICAgICAgcm91dGVyLFxuICAgICAgICAgICAgY3R4OiB7XG4gICAgICAgICAgICAgICAgZXJyLFxuICAgICAgICAgICAgICAgIHBhdGhuYW1lOiBpbml0aWFsRGF0YS5wYWdlLFxuICAgICAgICAgICAgICAgIHF1ZXJ5OiBpbml0aWFsRGF0YS5xdWVyeSxcbiAgICAgICAgICAgICAgICBhc1BhdGgsXG4gICAgICAgICAgICAgICAgQXBwVHJlZVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvb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mIGRlcGVuZGluZyBvbiBpZiB0aGV5J3JlIG5lZWRlZDpcbiAgICAgICAgICAgIGZvcihsZXQgaWR4ID0gMDsgaWR4IDwgY3VycmVudEhyZWZzLmxlbmd0aDsgKytpZHgpe1xuICAgICAgICAgICAgICAgIGlmIChkZXNpcmVkSHJlZnMuaGFzKGN1cnJlbnRIcmVmc1tpZHhdKSkge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50U3R5bGVUYWdzW2lkeF0ucmVtb3ZlQXR0cmlidXRlKCdtZWRpYScpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRTdHlsZVRhZ3NbaWR4XS5zZXRBdHRyaWJ1dGUoJ21lZGlhJywgJ3gnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBSZW9yZGVyIHN0eWxlcyBpbnRvIGludGVuZGVkIG9yZGVyOlxuICAgICAgICAgICAgbGV0IHJlZmVyZW5jZU5vZGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdub3NjcmlwdFtkYXRhLW4tY3NzXScpO1xuICAgICAgICAgICAgaWYgKC8vIFRoaXMgc2hvdWxkIGJlIGFuIGludmFyaWFudDpcbiAgICAgICAgICAgIHJlZmVyZW5jZU5vZGUpIHtcbiAgICAgICAgICAgICAgICBzdHlsZVNoZWV0cy5mb3JFYWNoKCh7IGhyZWYgIH0pPT57XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldFRhZyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoYHN0eWxlW2RhdGEtbi1ocmVmPVwiJHtocmVmfVwiXWApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoLy8gVGhpcyBzaG91bGQgYmUgYW4gaW52YXJpYW50OlxuICAgICAgICAgICAgICAgICAgICB0YXJnZXRUYWcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZmVyZW5jZU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FRpbWUgLCB2YWx1ZSAsIGR1cmF0aW9uICwgZW50cnlUeXBlICwgZW50cmllcyAgfSk9PntcbiAgICAgICAgICAgICAgICAgICAgLy8gQ29tYmluZXMgdGltZXN0YW1wIHdpdGggcmFuZG9tIG51bWJlciBmb3IgdW5pcXVlIElEXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHVuaXF1ZUlEID0gYCR7RGF0ZS5ub3coKX0tJHtNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiAoOWUxMiAtIDEpKSArIDFlMTJ9YDtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBlcmZTdGFydEVudHJ5O1xuICAgICAgICAgICAgICAgICAgICBpZiAoZW50cmllcyAmJiBlbnRyaWVzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGVyZlN0YXJ0RW50cnkgPSBlbnRyaWVzWzBdLnN0YXJ0VGltZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCB3ZWJWaXRhbHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQgfHwgdW5pcXVlSUQsXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRUaW1lOiBzdGFydFRpbWUgfHwgcGVyZlN0YXJ0RW50cnksXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUgPT0gbnVsbCA/IGR1cmF0aW9uIDogdmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogZW50cnlUeXBlID09PSAnbWFyaycgfHwgZW50cnlUeXBlID09PSAnbWVhc3VyZScgPyAnY3VzdG9tJyA6ICd3ZWItdml0YWwnXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIG1vZC5yZXBvcnRXZWJWaXRhbHMod2ViVml0YWxzKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAg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ZTogXCIke2luaXRpYWxEYXRhLnBhZ2V9XCJgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yMSkge1xuICAgICAgICAgICAgLy8gVGhpcyBjYXRjaGVzIGVycm9ycyBsaWtlIHRocm93aW5nIGluIHRoZSB0b3AgbGV2ZWwgb2YgYSBtb2R1bGVcbiAgICAgICAgICAgIGluaXRpYWxFcnIgPSAoMCwgX2lzRXJyb3IpLmdldFByb3BlckVycm9yKGVycm9yMSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSAnZGV2ZWxvcG1lbnQnKSB7XG4gICAgICAgICAgICBjb25zdCB7IGdldFNlcnZlckVycm9yICwgIH0gPSByZXF1aXJlKCduZXh0L2Rpc3QvY29tcGlsZWQvQG5leHQvcmVhY3QtZGV2LW92ZXJsYXkvZGlzdC9jbGllbnQnKTtcbiAgICAgICAgICAgIC8vIFNlcnZlci1zaWRlIHJ1bnRpbWUgZXJyb3JzIG5lZWQgdG8gYmUgcmUtdGhyb3duIG9uIHRoZSBjbGllbnQtc2lkZSBzb1xuICAgICAgICAgICAgLy8gdGhhdCB0aGUgb3ZlcmxheSBpcyByZW5kZXJlZC5cbiAgICAgICAgICAgIGlmIChpbml0aWFsRXJyKSB7XG4gICAgICAgICAgICAgICAgaWYgKGluaXRpYWxFcnIgPT09IGluaXRpYWxEYXRhLmVycikge1xuICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KCgpPT57XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXJyb3I7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGEgbmV3IGVycm9yIG9iamVjdC4gV2UgYHRocm93YCBpdCBiZWNhdXNlIHNvbWUgYnJvd3NlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aWxsIHNldCB0aGUgYHN0YWNrYCB3aGVuIHRocm93biwgYW5kIHdlIHdhbnQgdG8gZW5zdXJlIG91cnMgaXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBub3Qgb3ZlcnJpZGRlbiB3aGVuIHdlIHJlLXRocm93IGl0IGJlbG93LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihpbml0aWFsRXJyLm1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yLm5hbWUgPSBpbml0aWFsRXJyLm5hbWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvci5zdGFjayA9IGluaXRpYWxFcnIuc3RhY2s7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBnZXRTZXJ2ZXJFcnJvcihlcnJvciwgaW5pdGlhbEVyci5zb3VyY2UpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KCgpPT57XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBpbml0aWFsRXJyO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHdpbmRvdy5fX05FWFRfUFJFTE9BRFJFQURZKSB7XG4gICAgICAgICAgICB5aWVsZCB3aW5kb3cuX19ORVhUX1BSRUxPQURSRUFEWShpbml0aWFsRGF0YS5keW5hbWljSWRzKTtcbiAgICAgICAgfVxuICAgICAgICBleHBvcnRzLnJvdXRlciA9IHJvdXRlciA9ICgwLCBfcm91dGVyKS5jcmVhdGVSb3V0ZXIoaW5pdGlhbERhdGEucGFnZSwgaW5pdGlhbERhdGEucXVlcnksIGFzUGF0aCwge1xuICAgICAgICAgICAgaW5pdGlhbFByb3BzOiBpbml0aWFsRGF0YS5wcm9wcyxcbiAgICAgICAgICAgIHBhZ2VMb2FkZXIsXG4gICAgICAgICAgICBBcHA6IENhY2hlZEFwcCxcbiAgICAgICAgICAgIENvbXBvbmVudDogQ2FjaGVkQ29tcG9uZW50LFxuICAgICAgICAgICAgd3JhcEFwcCxcbiAgICAgICAgICAgIGVycjogaW5pdGlhbEVycixcbiAgICAgICAgICAgIGlzRmFsbGJhY2s6IEJvb2xlYW4oaW5pdGlhbERhdGEuaXNGYWxsYmFjayksXG4gICAgICAgICAgICBzdWJzY3JpcHRpb246IChpbmZvLCBBcHAsIHNjcm9sbCk9PnJlbmRlcihPYmplY3QuYXNzaWduKHt9LCBpbmZvLCB7XG4gICAgICAgICAgICAgICAgICAgIEFwcCxcbiAgICAgICAgICAgICAgICAgICAgc2Nyb2xsXG4gICAgICAgICAgICAgICAgfSkpLFxuICAgICAgICAgICAgbG9jYWxlOiBpbml0aWFsRGF0YS5sb2NhbGUsXG4gICAgICAgICAgICBsb2NhbGVzOiBpbml0aWFsRGF0YS5sb2NhbGVzLFxuICAgICAgICAgICAgZGVmYXVsdExvY2FsZSxcbiAgICAgICAgICAgIGRvbWFpbkxvY2FsZXM6IGluaXRpYWxEYXRhLmRvbWFpbkxvY2FsZXMsXG4gICAgICAgICAgICBpc1ByZXZpZXc6IGluaXRpYWxEYXRhLmlzUHJldmlld1xuICAgICAgICB9KTtcbiAgICAgICAgaW5pdGlhbE1hdGNoZXNNaWRkbGV3YXJlID0geWllbGQgcm91dGVyLl9pbml0aWFsTWF0Y2hlc01pZGRsZXdhcmVQcm9taXNlO1xuICAgICAgICBjb25zdCByZW5kZXJDdHggPSB7XG4gICAgICAgICAgICBBcHA6IENhY2hlZEFwcCxcbiAgICAgICAgICAgIGluaXRpYWw6IHRydWUsXG4gICAgIC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UUklDVF9NT0RFIiwiU3RyaWN0TW9kZSIsInJlbmRlcmluZ1Byb3BzIiwiX3JlbmRlciIsInJlbmRlckVyciIsImdldFByb3BlckVycm9yIiwiX2h5ZHJhdGUiLCJpbml0aWFsRXJyIiwiYXBwRW50cnlwb2ludCIsImFwcCIsIm1vZCIsInBhZ2VFbnRyeXBvaW50IiwiaXNWYWxpZEVsZW1lbnRUeXBlIiwiZXJyb3IxIiwiZ2V0U2VydmVyRXJyb3IiLCJyZW5kZXJDdHgiLCJ3aGVuRW50cnlwb2ludCIsImNvbXBvbmVudCIsInJlcG9ydFdlYlZpdGFscyIsImlkIiwic3RhcnRUaW1lIiwiZHVyYXRpb24iLCJlbnRyeVR5cGUiLCJlbnRyaWVzIiwidW5pcXVlSUQiLCJNYXRoIiwiRGF0ZSIsIm5vdyIsImZsb29yIiwicmFuZG9tIiwicGVyZlN0YXJ0RW50cnkiLCJ3ZWJWaXRhbHMiLCJsYWJlbCIsIm1lc3NhZ2UiLCJlIiwic3RhY2siLCJzb3VyY2UiLCJfX05FWFRfUFJFTE9BRFJFQURZIiwiZHluYW1pY0lkcyIsImNyZWF0ZVJvdXRlciIsImluaXRpYWxQcm9wcyIsIkJvb2xlYW4iLCJzdWJzY3JpcHRpb24iLCJkb21haW5Mb2NhbGVzIiwiaXNQcmV2aWV3IiwiX2luaXRpYWxNYXRjaGVzTWlkZGxld2FyZVByb21pc2UiLCJpbml0aWFsIiwiYmVmb3JlUmVuZGVyIiwiX19lc01vZHVsZSIsIm1vZHVsZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/index.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/next-dev.js": /*!***************************************************!*\ !*** ./node_modules/next/dist/client/next-dev.js ***! \***************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _toConsumableArray = (__webpack_require__(/*! @swc/helpers/lib/_to_consumable_array.js */ \"./node_modules/@swc/helpers/lib/_to_consumable_array.js\")[\"default\"]);\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _ = __webpack_require__(/*! ./ */ \"./node_modules/next/dist/client/index.js\");\nvar _onDemandEntriesClient = _interop_require_default(__webpack_require__(/*! ./dev/on-demand-entries-client */ \"./node_modules/next/dist/client/dev/on-demand-entries-client.js\"));\nvar _webpackHotMiddlewareClient = _interop_require_default(__webpack_require__(/*! ./dev/webpack-hot-middleware-client */ \"./node_modules/next/dist/client/dev/webpack-hot-middleware-client.js\"));\nvar _devBuildWatcher = _interop_require_default(__webpack_require__(/*! ./dev/dev-build-watcher */ \"./node_modules/next/dist/client/dev/dev-build-watcher.js\"));\nvar _fouc = __webpack_require__(/*! ./dev/fouc */ \"./node_modules/next/dist/client/dev/fouc.js\");\nvar _websocket = __webpack_require__(/*! ./dev/error-overlay/websocket */ \"./node_modules/next/dist/client/dev/error-overlay/websocket.js\");\nvar _querystring = __webpack_require__(/*! ../shared/lib/router/utils/querystring */ \"./node_modules/next/dist/shared/lib/router/utils/querystring.js\");\nif (!window._nextSetupHydrationWarning) {\n var origConsoleError = window.console.error;\n window.console.error = function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n var isHydrateError = args.some(function(arg) {\n return typeof arg === \"string\" && arg.match(/(hydration|content does not match|did not match)/i);\n });\n if (isHydrateError) {\n args = _toConsumableArray(args).concat([\n \"\\n\\nSee more info here: https://nextjs.org/docs/messages/react-hydration-error\", \n ]);\n }\n origConsoleError.apply(window.console, args);\n };\n window._nextSetupHydrationWarning = true;\n}\nwindow.next = {\n version: _.version,\n // router is initialized later so it has to be live-binded\n get router () {\n return _.router;\n },\n emitter: _.emitter\n};\nvar webpackHMR = (0, _webpackHotMiddlewareClient).default();\n(0, _).initialize({\n webpackHMR: webpackHMR\n}).then(function(param) {\n var assetPrefix = param.assetPrefix;\n (0, _websocket).connectHMR({\n assetPrefix: assetPrefix,\n path: \"/_next/webpack-hmr\"\n });\n return (0, _).hydrate({\n beforeRender: _fouc.displayContent\n }).then(function() {\n var devPagesManifestListener = function devPagesManifestListener(event) {\n if (event.data.indexOf(\"devPagesManifest\") !== -1) {\n fetch(\"\".concat(assetPrefix, \"/_next/static/development/_devPagesManifest.json\")).then(function(res) {\n return res.json();\n }).then(function(manifest) {\n window.__DEV_PAGES_MANIFEST = manifest;\n }).catch(function(err) {\n console.log(\"Failed to fetch devPagesManifest\", err);\n });\n } else if (event.data.indexOf(\"middlewareChanges\") !== -1) {\n return window.location.reload();\n } else if (event.data.indexOf(\"serverOnlyChanges\") !== -1) {\n var pages = JSON.parse(event.data).pages;\n // Make sure to reload when the dev-overlay is showing for an\n // API route\n if (pages.includes(_.router.query.__NEXT_PAGE)) {\n return window.location.reload();\n }\n if (!_.router.clc && pages.includes(_.router.pathname)) {\n console.log(\"Refreshing page data due to server-side change\");\n buildIndicatorHandler(\"building\");\n var clearIndicator = function() {\n return buildIndicatorHandler(\"built\");\n };\n _.router.replace(_.router.pathname + \"?\" + String((0, _querystring).assign((0, _querystring).urlQueryToSearchParams(_.router.query), new URLSearchParams(location.search))), _.router.asPath, {\n scroll: false\n }).catch(function() {\n // trigger hard reload when failing to refresh data\n // to show error overlay properly\n location.reload();\n }).finally(clearIndicator);\n }\n }\n };\n (0, _onDemandEntriesClient).default();\n var buildIndicatorHandler = function() {};\n (0, _websocket).addMessageListener(devPagesManifestListener);\n if (true) {\n (0, _devBuildWatcher).default(function(handler) {\n buildIndicatorHandler = handler;\n }, \"bottom-right\");\n }\n });\n}).catch(function(err) {\n console.error(\"Error was not caught\", err);\n});\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=next-dev.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\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S50aGVuKChyZXMpPT5yZXMuanNvbigpKS50aGVuKChtYW5pZmVzdCk9PntcbiAgICAgICAgICAgICAgICAgICAgd2luZG93Ll9fREVWX1BBR0VTX01BTklGRVNUID0gbWFuaWZlc3Q7XG4gICAgICAgICAgICAgICAgfSkuY2F0Y2goKGVycik9PntcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coYEZhaWxlZCB0byBmZXRjaCBkZXZQYWdlc01hbmlmZXN0YCwgZXJyKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQuZGF0YS5pbmRleE9mKCdtaWRkbGV3YXJlQ2hhbmdlcycpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB3aW5kb3cubG9jYXRpb24ucmVsb2FkKCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LmRhdGEuaW5kZXhPZignc2VydmVyT25seUNoYW5nZXMnKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBjb25zdCB7IHBhZ2VzICB9ID0gSlNPTi5wYXJzZShldmVudC5kYXRhKTtcbiAgICAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdG8gcmVsb2FkIHdoZW4gdGhlIGRldi1vdmVybGF5IGlzIHNob3dpbmcgZm9yIGFuXG4gICAgICAgICAgICAgICAgLy8gQVBJIHJvdXRlXG4gICAgICAgICAgICAgICAgaWYgKHBhZ2VzLmluY2x1ZGVzKF8ucm91dGVyLnF1ZXJ5Ll9fTkVYVF9QQUdFKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gd2luZG93LmxvY2F0aW9uLnJlbG9hZCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIV8ucm91dGVyLmNsYyAmJiBwYWdlcy5pbmNsdWRlcyhfLnJvdXRlci5wYXRobmFtZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ1JlZnJlc2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IiwidmFsdWUiLCJtb2R1bGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/next-dev.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/normalize-trailing-slash.js": /*!*******************************************************************!*\ !*** ./node_modules/next/dist/client/normalize-trailing-slash.js ***! \*******************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.normalizePathTrailingSlash = void 0;\nvar _removeTrailingSlash = __webpack_require__(/*! ../shared/lib/router/utils/remove-trailing-slash */ \"./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js\");\nvar _parsePath = __webpack_require__(/*! ../shared/lib/router/utils/parse-path */ \"./node_modules/next/dist/shared/lib/router/utils/parse-path.js\");\nvar normalizePathTrailingSlash = function(path) {\n if (!path.startsWith(\"/\") || undefined) {\n return path;\n }\n var ref = (0, _parsePath).parsePath(path), pathname = ref.pathname, query = ref.query, hash = ref.hash;\n if (false) {}\n return \"\".concat((0, _removeTrailingSlash).removeTrailingSlash(pathname)).concat(query).concat(hash);\n};\nexports.normalizePathTrailingSlash = normalizePathTrailingSlash;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=normalize-trailing-slash.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9ub3JtYWxpemUtdHJhaWxpbmctc2xhc2guanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxrQ0FBa0MsR0FBRyxLQUF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B7XG4gIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLmRlZmF1bHQsICdfX2VzTW9kdWxlJywgeyB2YWx1ZTogdHJ1ZSB9KTtcbiAgT2JqZWN0LmFzc2lnbihleHBvcnRzLmRlZmF1bHQsIGV4cG9ydHMpO1xuICBtb2R1bGUuZXhwb3J0cyA9IGV4cG9ydHMuZGVmYXVsdDtcbn1cblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9bm9ybWFsaXplLXRyYWlsaW5nLXNsYXNoLmpzLm1hcCJdLCJuYW1lcyI6WyJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsIm5vcm1hbGl6ZVBhdGhUcmFpbGluZ1NsYXNoIiwiX3JlbW92ZVRyYWlsaW5nU2xhc2giLCJyZXF1aXJlIiwiX3BhcnNlUGF0aCIsInBhdGgiLCJzdGFydHNXaXRoIiwicHJvY2VzcyIsImVudiIsIl9fTkVYVF9NQU5VQUxfVFJBSUxJTkdfU0xBU0giLCJwYXJzZVBhdGgiLCJwYXRobmFtZSIsInF1ZXJ5IiwiaGFzaCIsIl9fTkVYVF9UUkFJTElOR19TTEFTSCIsInRlc3QiLCJyZW1vdmVUcmFpbGluZ1NsYXNoIiwiZW5kc1dpdGgiLCJkZWZhdWx0IiwiX19lc01vZHVsZSIsImFzc2lnbiIsIm1vZHVsZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/normalize-trailing-slash.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/page-loader.js": /*!******************************************************!*\ !*** ./node_modules/next/dist/client/page-loader.js ***! \******************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _classCallCheck = (__webpack_require__(/*! @swc/helpers/lib/_class_call_check.js */ \"./node_modules/@swc/helpers/lib/_class_call_check.js\")[\"default\"]);\nvar _createClass = (__webpack_require__(/*! @swc/helpers/lib/_create_class.js */ \"./node_modules/@swc/helpers/lib/_create_class.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _addBasePath = __webpack_require__(/*! ./add-base-path */ \"./node_modules/next/dist/client/add-base-path.js\");\nvar _router = __webpack_require__(/*! ../shared/lib/router/router */ \"./node_modules/next/dist/shared/lib/router/router.js\");\nvar _getAssetPathFromRoute = _interop_require_default(__webpack_require__(/*! ../shared/lib/router/utils/get-asset-path-from-route */ \"./node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js\"));\nvar _addLocale = __webpack_require__(/*! ./add-locale */ \"./node_modules/next/dist/client/add-locale.js\");\nvar _isDynamic = __webpack_require__(/*! ../shared/lib/router/utils/is-dynamic */ \"./node_modules/next/dist/shared/lib/router/utils/is-dynamic.js\");\nvar _parseRelativeUrl = __webpack_require__(/*! ../shared/lib/router/utils/parse-relative-url */ \"./node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js\");\nvar _removeTrailingSlash = __webpack_require__(/*! ../shared/lib/router/utils/remove-trailing-slash */ \"./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js\");\nvar _routeLoader = __webpack_require__(/*! ./route-loader */ \"./node_modules/next/dist/client/route-loader.js\");\nvar PageLoader = /*#__PURE__*/ function() {\n function PageLoader(buildId, assetPrefix) {\n _classCallCheck(this, PageLoader);\n this.routeLoader = (0, _routeLoader).createRouteLoader(assetPrefix);\n this.buildId = buildId;\n this.assetPrefix = assetPrefix;\n this.promisedSsgManifest = new Promise(function(resolve) {\n if (window.__SSG_MANIFEST) {\n resolve(window.__SSG_MANIFEST);\n } else {\n window.__SSG_MANIFEST_CB = function() {\n resolve(window.__SSG_MANIFEST);\n };\n }\n });\n }\n _createClass(PageLoader, [\n {\n key: \"getPageList\",\n value: function getPageList() {\n if (false) {} else {\n if (window.__DEV_PAGES_MANIFEST) {\n return window.__DEV_PAGES_MANIFEST.pages;\n } else {\n this.promisedDevPagesManifest || (this.promisedDevPagesManifest = fetch(\"\".concat(this.assetPrefix, \"/_next/static/development/_devPagesManifest.json\")).then(function(res) {\n return res.json();\n }).then(function(manifest) {\n window.__DEV_PAGES_MANIFEST = manifest;\n return manifest.pages;\n }).catch(function(err) {\n console.log(\"Failed to fetch devPagesManifest:\", err);\n throw new Error(\"Failed to fetch _devPagesManifest.json. Is something blocking that network request?\\n\" + \"Read more: https://nextjs.org/docs/messages/failed-to-fetch-devpagesmanifest\");\n }));\n return this.promisedDevPagesManifest;\n }\n }\n }\n },\n {\n key: \"getMiddleware\",\n value: function getMiddleware() {\n if (false) { var middlewareMatchers; } else {\n if (window.__DEV_MIDDLEWARE_MATCHERS) {\n return window.__DEV_MIDDLEWARE_MATCHERS;\n } else {\n if (!this.promisedMiddlewareMatchers) {\n // TODO: Decide what should happen when fetching fails instead of asserting\n // @ts-ignore\n this.promisedMiddlewareMatchers = fetch(\"\".concat(this.assetPrefix, \"/_next/static/\").concat(this.buildId, \"/_devMiddlewareManifest.json\")).then(function(res) {\n return res.json();\n }).then(function(matchers) {\n window.__DEV_MIDDLEWARE_MATCHERS = matchers;\n return matchers;\n }).catch(function(err) {\n console.log(\"Failed to fetch _devMiddlewareManifest\", err);\n });\n }\n // TODO Remove this assertion as this could be undefined\n return this.promisedMiddlewareMatchers;\n }\n }\n }\n },\n {\n key: \"getDataHref\",\n value: function getDataHref(params) {\n var _this = this;\n var asPath = params.asPath, href = params.href, locale = params.locale;\n var ref = (0, _parseRelativeUrl).parseRelativeUrl(href), hrefPathname = ref.pathname, query = ref.query, search = ref.search;\n var ref1 = (0, _parseRelativeUrl).parseRelativeUrl(asPath), asPathname = ref1.pathname;\n var route = (0, _removeTrailingSlash).removeTrailingSlash(hrefPathname);\n if (route[0] !== \"/\") {\n throw new Error('Route name should start with a \"/\", got \"'.concat(route, '\"'));\n }\n var getHrefForSlug = function(path) {\n var dataRoute = (0, _getAssetPathFromRoute).default((0, _removeTrailingSlash).removeTrailingSlash((0, _addLocale).addLocale(path, locale)), \".json\");\n return (0, _addBasePath).addBasePath(\"/_next/data/\".concat(_this.buildId).concat(dataRoute).concat(search), true);\n };\n return getHrefForSlug(params.skipInterpolation ? asPathname : (0, _isDynamic).isDynamicRoute(route) ? (0, _router).interpolateAs(hrefPathname, asPathname, query).result : route);\n }\n },\n {\n /**\n * @param {string} route - the route (file-system path)\n */ key: \"_isSsg\",\n value: function _isSsg(route) {\n return this.promisedSsgManifest.then(function(manifest) {\n return manifest.has(route);\n });\n }\n },\n {\n key: \"loadPage\",\n value: function loadPage(route) {\n return this.routeLoader.loadRoute(route).then(function(res) {\n if (\"component\" in res) {\n return {\n page: res.component,\n mod: res.exports,\n styleSheets: res.styles.map(function(o) {\n return {\n href: o.href,\n text: o.content\n };\n })\n };\n }\n throw res.error;\n });\n }\n },\n {\n key: \"prefetch\",\n value: function prefetch(route) {\n return this.routeLoader.prefetch(route);\n }\n }\n ]);\n return PageLoader;\n}();\nexports[\"default\"] = PageLoader;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=page-loader.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9wYWdlLWxvYWRlci5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTs7Ozs7O0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsa0JBQWUsR0FBRyxLQUFLLENBQUMsQ0FBQztB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ZU1hdGNoZXJzID0gcHJvY2Vzcy5lbnYuX19ORVhUX01JRERMRVdBUkVfTUFUQ0hFUlM7XG4gICAgICAgICAgICB3aW5kb3cuX19NSURETEVXQVJFX01BVENIRVJTID0gbWlkZGxld2FyZU1hdGNoZXJzID8gbWlkZGxld2FyZU1hdGNoZXJzIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgcmV0dXJuIHdpbmRvdy5fX01JRERMRVdBUkVfTUFUQ0hFUlM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAod2luZG93Ll9fREVWX01JRERMRVdBUkVfTUFUQ0hFUlMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gd2luZG93Ll9fREVWX01JRERMRVdBUkVfTUFUQ0hFUlM7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5wcm9taXNlZE1pZGRsZXdhcmVNYXRjaGVycykge1xuICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBEZWNpZGUgd2hhdCBzaG91bGQgaGFwcGVuIHdoZW4gZmV0Y2hpbmcgZmFpbHMgaW5zdGVhZCBvZiBhc3NlcnRpbmdcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgICAgICAgICAgICAgICB0aGlzLnByb21pc2VkTWlkZGxld2FyZU1hdGNoZXJzID0gZmV0Y2goYCR7dGhpcy5hc3NldFByZWZpeH0vX25leHQvc3RhdGljLyR7dGhpcy5idWlsZElkfS9fZGV2TWlkZGxld2FyZU1hbmlmZXN0Lmpzb25gKS50aGVuKChyZXMpPT5yZXMuanNvbigpKS50aGVuKChtYXRjaGVycyk9PntcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5fX0RFVl9NSURETEVXQVJFX01BVENIRVJTID0gbWF0Y2hlcnM7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hlcnM7XG4gICAgICAgICAgICAgICAgICAgIH0p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AgICAgICAgICAgICAgcGFnZTogcmVzLmNvbXBvbmVudCxcbiAgICAgICAgICAgICAgICAgICAgbW9kOiByZXMuZXhwb3J0cyxcbiAgICAgICAgICAgICAgICAgICAgc3R5bGVTaGVldHM6IHJlcy5zdHlsZXMubWFwKChvKT0+KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBocmVmOiBvLmhyZWYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dDogby5jb250ZW50XG4gICAgICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgcmVzLmVycm9yO1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgcHJlZmV0Y2gocm91dGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucm91dGVMb2FkZXIucHJlZmV0Y2gocm91dGUpO1xuICAgIH1cbiAgICBjb25zdHJ1Y3RvcihidWlsZElkLCBhc3NldFByZWZpeCl7XG4gICAgICAgIHRoaXMucm91dGVMb2FkZXIgPSAoMCwgX3JvdXRlTG9hZGVyKS5jcmVhdGVSb3V0ZUxvYWRlcihhc3NldFByZWZpeCk7XG4gICAgICAgIHRoaXMuYnVpbGRJZCA9IGJ1aWxkSWQ7XG4gICAgICAgIHRoaXMuYXNzZXRQcmVmaXggPSBhc3NldFByZWZpeDtcbiAgICAgICAgdGhpcy5wcm9taXNlZFNzZ01hbmlmZXN0ID0gbmV3IFByb21pc2UoKHJlc29sdmUpPT57XG4gICAgICAgICAgICBpZiAod2luZG93Ll9fU1NHX01BTklGRVNUKSB7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZSh3aW5kb3cuX19TU0dfTUFOSUZFU1QpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB3aW5kb3cuX19TU0dfTUFOSUZFU1RfQ0IgPSAoKT0+e1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHdpbmRvdy5fX1N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zIiwibWFwIiwibyIsInRleHQiLCJjb250ZW50IiwiZXJyb3IiLCJwcmVmZXRjaCIsIl9fZXNNb2R1bGUiLCJhc3NpZ24iLCJtb2R1bGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/page-loader.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/performance-relayer.js": /*!**************************************************************!*\ !*** ./node_modules/next/dist/client/performance-relayer.js ***! \**************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _webVitals = __webpack_require__(/*! next/dist/compiled/web-vitals */ \"./node_modules/next/dist/compiled/web-vitals/web-vitals.js\");\nvar initialHref = location.href;\nvar isRegistered = false;\nvar userReportHandler;\nfunction onReport(metric) {\n if (userReportHandler) {\n userReportHandler(metric);\n }\n // This code is not shipped, executed, or present in the client-side\n // JavaScript bundle unless explicitly enabled in your application.\n //\n // When this feature is enabled, we'll make it very clear by printing a\n // message during the build (`next build`).\n if (false) { var send, vitalsUrl, blob, body, ref, fallbackSend; }\n}\nvar _default = function(onPerfEntry) {\n // Update function if it changes:\n userReportHandler = onPerfEntry;\n // Only register listeners once:\n if (isRegistered) {\n return;\n }\n isRegistered = true;\n (0, _webVitals).onCLS(onReport);\n (0, _webVitals).onFID(onReport);\n (0, _webVitals).onFCP(onReport);\n (0, _webVitals).onLCP(onReport);\n (0, _webVitals).onTTFB(onReport);\n (0, _webVitals).onINP(onReport);\n};\nexports[\"default\"] = _default;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=performance-relayer.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9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lyZSIsImluaXRpYWxIcmVmIiwibG9jYXRpb24iLCJocmVmIiwiaXNSZWdpc3RlcmVkIiwidXNlclJlcG9ydEhhbmRsZXIiLCJvblJlcG9ydCIsIm1ldHJpYyIsInByb2Nlc3MiLCJlbnYiLCJfX05FWFRfQU5BTFlUSUNTX0lEIiwiZmFsbGJhY2tTZW5kIiwiZmV0Y2giLCJ2aXRhbHNVcmwiLCJib2R5IiwiYmxvYiIsIm1ldGhvZCIsImNyZWRlbnRpYWxzIiwia2VlcGFsaXZlIiwiY2F0Y2giLCJjb25zb2xlIiwiZXJyb3IiLCJyZWYiLCJkc24iLCJpZCIsInBhZ2UiLCJ3aW5kb3ciLCJfX05FWFRfREFUQV9fIiwiZXZlbnRfbmFtZSIsIm5hbWUiLCJ0b1N0cmluZyIsInNwZWVkIiwibmF2aWdhdG9yIiwiQmxvYiIsIlVSTFNlYXJjaFBhcmFtcyIsInR5cGUiLCJzZW5kIiwic2VuZEJlYWNvbiIsImJpbmQiLCJlcnIiLCJfZGVmYXVsdCIsIm9uUGVyZkVudHJ5Iiwib25DTFMiLCJvbkZJRCIsIm9uRkNQIiwib25MQ1AiLCJvblRURkIiLCJvbklOUCIsIl9fZXNNb2R1bGUiLCJhc3NpZ24iLCJtb2R1bGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/performance-relayer.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/portal/index.js": /*!*******************************************************!*\ !*** ./node_modules/next/dist/client/portal/index.js ***! \*******************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nvar _s = $RefreshSig$();\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.Portal = void 0;\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar _reactDom = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\nvar Portal = function(param) {\n var children = param.children, type = param.type;\n _s();\n var ref = _slicedToArray((0, _react).useState(null), 2), portalNode = ref[0], setPortalNode = ref[1];\n (0, _react).useEffect(function() {\n var element = document.createElement(type);\n document.body.appendChild(element);\n setPortalNode(element);\n return function() {\n document.body.removeChild(element);\n };\n }, [\n type\n ]);\n return portalNode ? /*#__PURE__*/ (0, _reactDom).createPortal(children, portalNode) : null;\n};\n_s(Portal, \"RFImm+EuWCdF9gTeRNMrIZMTdTE=\");\n_c = Portal;\nexports.Portal = Portal;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=index.js.map\nvar _c;\n$RefreshReg$(_c, \"Portal\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9wb3J0YWwvaW5kZXguanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Ozs7OztBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELGNBQWMsR0FBRyxLQUFLLENBQUMsQ0FBQztBQUN4QixJQUFJRyxNQUFNLEdBQUdDLG1CQUFPLENBQUMsNENBQU8sQ0FBQztBQUM3QixJQUFJQyxTQUFTLEdBQUdELG1CQUFPLENBQUMsb0RBQVcsQ0FBQztBQUNwQyxJQUFNRixNQUFNLEdBQUcsZ0JBQXdCO1FBQXJCSSxRQUFRLFNBQVJBLFFBQVEsRUFBR0MsSUFBSSxTQUFKQSxJQUFJOztJQUM3QixJQUFvQyxHQUEwQixrQkFBMUIsQ0FB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YXBwZW5kQ2hpbGQiLCJyZW1vdmVDaGlsZCIsImNyZWF0ZVBvcnRhbCIsImRlZmF1bHQiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/portal/index.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/remove-base-path.js": /*!***********************************************************!*\ !*** ./node_modules/next/dist/client/remove-base-path.js ***! \***********************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.removeBasePath = removeBasePath;\nvar _hasBasePath = __webpack_require__(/*! ./has-base-path */ \"./node_modules/next/dist/client/has-base-path.js\");\nvar basePath = false || \"\";\nfunction removeBasePath(path) {\n if (false) {}\n path = path.slice(basePath.length);\n if (!path.startsWith(\"/\")) path = \"/\".concat(path);\n return path;\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=remove-base-path.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yZW1vdmUtYmFzZS1wYXRoLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsc0JBQXNCLEdBQUdFLGNBQWMsQ0FBQztBQUN4QyxJQUFJQyxZQUFZLEdBQUdDLG1CQUFPLENBQUMseUVBQWlCLENBQUM7QUFDN0MsSUFBTUMsUUFBUSxHQUFHQyxNQUFrQyxJQUFJLEVBQUU7QUFDekQsU0FBU0osY0FBYyxDQU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cnRzID0gZXhwb3J0cy5kZWZhdWx0O1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1yZW1vdmUtYmFzZS1wYXRoLmpzLm1hcCJdLCJuYW1lcyI6WyJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsInJlbW92ZUJhc2VQYXRoIiwiX2hhc0Jhc2VQYXRoIiwicmVxdWlyZSIsImJhc2VQYXRoIiwicHJvY2VzcyIsImVudiIsIl9fTkVYVF9ST1VURVJfQkFTRVBBVEgiLCJwYXRoIiwiX19ORVhUX01BTlVBTF9DTElFTlRfQkFTRV9QQVRIIiwiaGFzQmFzZVBhdGgiLCJzbGljZSIsImxlbmd0aCIsInN0YXJ0c1dpdGgiLCJkZWZhdWx0IiwiX19lc01vZHVsZSIsImFzc2lnbiIsIm1vZHVsZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/remove-base-path.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/remove-locale.js": /*!********************************************************!*\ !*** ./node_modules/next/dist/client/remove-locale.js ***! \********************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.removeLocale = removeLocale;\nvar _parsePath = __webpack_require__(/*! ../shared/lib/router/utils/parse-path */ \"./node_modules/next/dist/shared/lib/router/utils/parse-path.js\");\nfunction removeLocale(path, locale) {\n if (false) { var localeLower, pathLower, pathname; }\n return path;\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=remove-locale.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9k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GV4cG9ydHMuZGVmYXVsdCAhPT0gbnVsbCkpICYmIHR5cGVvZiBleHBvcnRzLmRlZmF1bHQuX19lc01vZHVsZSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMuZGVmYXVsdCwgJ19fZXNNb2R1bGUnLCB7IHZhbHVlOiB0cnVlIH0pO1xuICBPYmplY3QuYXNzaWduKGV4cG9ydHMuZGVmYXVsdCwgZXhwb3J0cyk7XG4gIG1vZHVsZS5leHBvcnRzID0gZXhwb3J0cy5kZWZhdWx0O1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1yZW1vdmUtbG9jYWxlLmpzLm1hcCJdLCJuYW1lcyI6WyJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsInJlbW92ZUxvY2FsZSIsIl9wYXJzZVBhdGgiLCJyZXF1aXJlIiwicGF0aCIsImxvY2FsZSIsInByb2Nlc3MiLCJlbnYiLCJfX05FWFRfSTE4Tl9TVVBQT1JUIiwicGF0aG5hbWUiLCJwYXJzZVBhdGgiLCJwYXRoTG93ZXIiLCJ0b0xvd2VyQ2FzZSIsImxvY2FsZUxvd2VyIiwic3RhcnRzV2l0aCIsImxlbmd0aCIsInNsaWNlIiwiZGVmYXVsdCIsIl9fZXNNb2R1bGUiLCJhc3NpZ24iLCJtb2R1bGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/remove-locale.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/request-idle-callback.js": /*!****************************************************************!*\ !*** ./node_modules/next/dist/client/request-idle-callback.js ***! \****************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.cancelIdleCallback = exports.requestIdleCallback = void 0;\nvar requestIdleCallback = typeof self !== \"undefined\" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {\n var start = Date.now();\n return setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function timeRemaining() {\n return Math.max(0, 50 - (Date.now() - start));\n }\n });\n }, 1);\n};\nexports.requestIdleCallback = requestIdleCallback;\nvar cancelIdleCallback = typeof self !== \"undefined\" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {\n return clearTimeout(id);\n};\nexports.cancelIdleCallback = cancelIdleCallback;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=request-idle-callback.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yZXF1ZXN0LWlkbGUtY2FsbGJhY2suanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCwwQkFBMEIsR0FBR0EsMkJBQTJCLEdBQUcsS0FBSyxDQUFDLENBQUM7QUFDbEUsSUFBTUcsbUJBQW1CLEdBQUcsT0FBT0MsSUFBSSxLQUFLLFdBQVcsSUFBSUEsSUFBSSxDQUFDRCxtQkFBbUIsSUFBSUMsSUFBSSxDQUFDRCxtQkFBbUIsQ0FBQ0UsSUFBSSxDQUFDQyxNQUFNLENBQUMsSUFBSSxTQUFTQyxFQUFFLEVBQUU7SUFDekksSUFBSUMsS0FBSyxHQUFHQyxJQUFJLENBQUNDLEdBQUcsRUFBRTtJQUN0QixPQUFPQyxVQUFVLENBQUMsV0FBVztRQUN6QkosRUFBRSxDQUFDO1lBQ0NLLFVBQVUsRUFBRSxLQUFLO1lBQ2pCQyxhQUFhLEVBQUUsU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pbmluZyIsIk1hdGgiLCJtYXgiLCJpZCIsImNsZWFyVGltZW91dCIsImRlZmF1bHQiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/request-idle-callback.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/route-announcer.js": /*!**********************************************************!*\ !*** ./node_modules/next/dist/client/route-announcer.js ***! \**********************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nvar _s = $RefreshSig$();\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = exports.RouteAnnouncer = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _router = __webpack_require__(/*! ./router */ \"./node_modules/next/dist/client/router.js\");\nvar nextjsRouteAnnouncerStyles = {\n border: 0,\n clip: \"rect(0 0 0 0)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: 0,\n position: \"absolute\",\n width: \"1px\",\n // https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe\n whiteSpace: \"nowrap\",\n wordWrap: \"normal\"\n};\nvar RouteAnnouncer = function() {\n _s();\n var asPath = (0, _router).useRouter().asPath;\n var ref = _slicedToArray(_react.default.useState(\"\"), 2), routeAnnouncement = ref[0], setRouteAnnouncement = ref[1];\n // Only announce the path change, but not for the first load because screen\n // reader will do that automatically.\n var previouslyLoadedPath = _react.default.useRef(asPath);\n // Every time the path changes, announce the new page’s title following this\n // priority: first the document title (from head), otherwise the first h1, or\n // if none of these exist, then the pathname from the URL. This methodology is\n // inspired by Marcy Sutton’s accessible client routing user testing. More\n // information can be found here:\n // https://www.gatsbyjs.com/blog/2019-07-11-user-testing-accessible-client-routing/\n _react.default.useEffect(function() {\n // If the path hasn't change, we do nothing.\n if (previouslyLoadedPath.current === asPath) return;\n previouslyLoadedPath.current = asPath;\n if (document.title) {\n setRouteAnnouncement(document.title);\n } else {\n var pageHeader = document.querySelector(\"h1\");\n var ref;\n var content = (ref = pageHeader == null ? void 0 : pageHeader.innerText) != null ? ref : pageHeader == null ? void 0 : pageHeader.textContent;\n setRouteAnnouncement(content || asPath);\n }\n }, [\n asPath\n ]);\n return /*#__PURE__*/ _react.default.createElement(\"p\", {\n \"aria-live\": \"assertive\" // Make the announcement immediately.\n ,\n id: \"__next-route-announcer__\",\n role: \"alert\",\n style: nextjsRouteAnnouncerStyles\n }, routeAnnouncement);\n};\n_s(RouteAnnouncer, \"XmDOMcfEgRlT21GulgLTmCStecg=\");\n_c = RouteAnnouncer;\nexports.RouteAnnouncer = RouteAnnouncer;\nvar _default = RouteAnnouncer;\nexports[\"default\"] = _default;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=route-announcer.js.map\nvar _c;\n$RefreshReg$(_c, \"RouteAnnouncer\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yb3V0ZS1hbm5vdW5jZXIuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Ozs7OztBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELGtCQUFlLE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NldFJvdXRlQW5ub3VuY2VtZW50IiwicHJldmlvdXNseUxvYWRlZFBhdGgiLCJ1c2VSZWYiLCJ1c2VFZmZlY3QiLCJjdXJyZW50IiwiZG9jdW1lbnQiLCJ0aXRsZSIsInBhZ2VIZWFkZXIiLCJxdWVyeVNlbGVjdG9yIiwicmVmIiwiY29udGVudCIsImlubmVyVGV4dCIsInRleHRDb250ZW50IiwiY3JlYXRlRWxlbWVudCIsImlkIiwicm9sZSIsInN0eWxlIiwiX2RlZmF1bHQiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/route-announcer.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/route-loader.js": /*!*******************************************************!*\ !*** ./node_modules/next/dist/client/route-loader.js ***! \*******************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.markAssetError = markAssetError;\nexports.isAssetError = isAssetError;\nexports.getClientBuildManifest = getClientBuildManifest;\nexports.createRouteLoader = createRouteLoader;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _getAssetPathFromRoute = _interop_require_default(__webpack_require__(/*! ../shared/lib/router/utils/get-asset-path-from-route */ \"./node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js\"));\nvar _trustedTypes = __webpack_require__(/*! ./trusted-types */ \"./node_modules/next/dist/client/trusted-types.js\");\nvar _requestIdleCallback = __webpack_require__(/*! ./request-idle-callback */ \"./node_modules/next/dist/client/request-idle-callback.js\");\n// 3.8s was arbitrarily chosen as it's what https://web.dev/interactive\n// considers as \"Good\" time-to-interactive. We must assume something went\n// wrong beyond this point, and then fall-back to a full page transition to\n// show the user something of value.\nvar MS_MAX_IDLE_DELAY = 3800;\nfunction withFuture(key, map, generator) {\n var entry = map.get(key);\n if (entry) {\n if (\"future\" in entry) {\n return entry.future;\n }\n return Promise.resolve(entry);\n }\n var resolver;\n var prom = new Promise(function(resolve) {\n resolver = resolve;\n });\n map.set(key, entry = {\n resolve: resolver,\n future: prom\n });\n return generator ? generator() // eslint-disable-next-line no-sequences\n .then(function(value) {\n return resolver(value), value;\n }).catch(function(err) {\n map.delete(key);\n throw err;\n }) : prom;\n}\nfunction hasPrefetch(link) {\n try {\n link = document.createElement(\"link\");\n return(// with relList.support\n !!window.MSInputMethodContext && !!document.documentMode || link.relList.supports(\"prefetch\"));\n } catch (e) {\n return false;\n }\n}\nvar canPrefetch = hasPrefetch();\nfunction prefetchViaDom(href, as, link) {\n return new Promise(function(res, rej) {\n var selector = '\\n link[rel=\"prefetch\"][href^=\"'.concat(href, '\"],\\n link[rel=\"preload\"][href^=\"').concat(href, '\"],\\n script[src^=\"').concat(href, '\"]');\n if (document.querySelector(selector)) {\n return res();\n }\n link = document.createElement(\"link\");\n // The order of property assignment here is intentional:\n if (as) link.as = as;\n link.rel = \"prefetch\";\n link.crossOrigin = undefined;\n link.onload = res;\n link.onerror = rej;\n // `href` should always be last:\n link.href = href;\n document.head.appendChild(link);\n });\n}\nvar ASSET_LOAD_ERROR = Symbol(\"ASSET_LOAD_ERROR\");\nfunction markAssetError(err) {\n return Object.defineProperty(err, ASSET_LOAD_ERROR, {});\n}\nfunction isAssetError(err) {\n return err && ASSET_LOAD_ERROR in err;\n}\nfunction appendScript(src, script) {\n return new Promise(function(resolve, reject) {\n script = document.createElement(\"script\");\n // The order of property assignment here is intentional.\n // 1. Setup success/failure hooks in case the browser synchronously\n // executes when `src` is set.\n script.onload = resolve;\n script.onerror = function() {\n return reject(markAssetError(new Error(\"Failed to load script: \".concat(src))));\n };\n // 2. Configure the cross-origin attribute before setting `src` in case the\n // browser begins to fetch.\n script.crossOrigin = undefined;\n // 3. Finally, set the source and inject into the DOM in case the child\n // must be appended for fetching to start.\n script.src = src;\n document.body.appendChild(script);\n });\n}\n// We wait for pages to be built in dev before we start the route transition\n// timeout to prevent an un-necessary hard navigation in development.\nvar devBuildPromise;\n// Resolve a promise that times out after given amount of milliseconds.\nfunction resolvePromiseWithTimeout(p, ms, err) {\n return new Promise(function(resolve, reject) {\n var cancelled = false;\n p.then(function(r) {\n // Resolved, cancel the timeout\n cancelled = true;\n resolve(r);\n }).catch(reject);\n // We wrap these checks separately for better dead-code elimination in\n // production bundles.\n if (true) {\n (devBuildPromise || Promise.resolve()).then(function() {\n (0, _requestIdleCallback).requestIdleCallback(function() {\n return setTimeout(function() {\n if (!cancelled) {\n reject(err);\n }\n }, ms);\n });\n });\n }\n if (false) {}\n });\n}\nfunction getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n var onBuildManifest = new Promise(function(resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n self.__BUILD_MANIFEST_CB = function() {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error(\"Failed to load client build manifest\")));\n}\nfunction getFilesForRoute(assetPrefix, route) {\n if (true) {\n var scriptUrl = assetPrefix + \"/_next/static/chunks/pages\" + encodeURI((0, _getAssetPathFromRoute).default(route, \".js\"));\n return Promise.resolve({\n scripts: [\n (0, _trustedTypes).__unsafeCreateTrustedScriptURL(scriptUrl)\n ],\n // Styles are handled by `style-loader` in development:\n css: []\n });\n }\n return getClientBuildManifest().then(function(manifest) {\n if (!(route in manifest)) {\n throw markAssetError(new Error(\"Failed to lookup route: \".concat(route)));\n }\n var allFiles = manifest[route].map(function(entry) {\n return assetPrefix + \"/_next/\" + encodeURI(entry);\n });\n return {\n scripts: allFiles.filter(function(v) {\n return v.endsWith(\".js\");\n }).map(function(v) {\n return (0, _trustedTypes).__unsafeCreateTrustedScriptURL(v);\n }),\n css: allFiles.filter(function(v) {\n return v.endsWith(\".css\");\n })\n };\n });\n}\nfunction createRouteLoader(assetPrefix) {\n var maybeExecuteScript = function maybeExecuteScript(src) {\n // With HMR we might need to \"reload\" scripts when they are\n // disposed and readded. Executing scripts twice has no functional\n // differences\n if (false) { var prom; } else {\n return appendScript(src);\n }\n };\n var fetchStyleSheet = function fetchStyleSheet(href) {\n var prom = styleSheets.get(href);\n if (prom) {\n return prom;\n }\n styleSheets.set(href, prom = fetch(href).then(function(res) {\n if (!res.ok) {\n throw new Error(\"Failed to load stylesheet: \".concat(href));\n }\n return res.text().then(function(text) {\n return {\n href: href,\n content: text\n };\n });\n }).catch(function(err) {\n throw markAssetError(err);\n }));\n return prom;\n };\n var entrypoints = new Map();\n var loadedScripts = new Map();\n var styleSheets = new Map();\n var routes = new Map();\n return {\n whenEntrypoint: function whenEntrypoint(route) {\n return withFuture(route, entrypoints);\n },\n onEntrypoint: function onEntrypoint(route, execute) {\n (execute ? Promise.resolve().then(function() {\n return execute();\n }).then(function(exports1) {\n return {\n component: exports1 && exports1.default || exports1,\n exports: exports1\n };\n }, function(err) {\n return {\n error: err\n };\n }) : Promise.resolve(undefined)).then(function(input) {\n var old = entrypoints.get(route);\n if (old && \"resolve\" in old) {\n if (input) {\n entrypoints.set(route, input);\n old.resolve(input);\n }\n } else {\n if (input) {\n entrypoints.set(route, input);\n } else {\n entrypoints.delete(route);\n }\n // when this entrypoint has been resolved before\n // the route is outdated and we want to invalidate\n // this cache entry\n routes.delete(route);\n }\n });\n },\n loadRoute: function loadRoute(route, prefetch) {\n var _this = this;\n return withFuture(route, routes, function() {\n var devBuildPromiseResolve;\n if (true) {\n devBuildPromise = new Promise(function(resolve) {\n devBuildPromiseResolve = resolve;\n });\n }\n return resolvePromiseWithTimeout(getFilesForRoute(assetPrefix, route).then(function(param) {\n var scripts = param.scripts, css = param.css;\n return Promise.all([\n entrypoints.has(route) ? [] : Promise.all(scripts.map(maybeExecuteScript)),\n Promise.all(css.map(fetchStyleSheet)), \n ]);\n }).then(function(res) {\n return _this.whenEntrypoint(route).then(function(entrypoint) {\n return {\n entrypoint: entrypoint,\n styles: res[1]\n };\n });\n }), MS_MAX_IDLE_DELAY, markAssetError(new Error(\"Route did not complete loading: \".concat(route)))).then(function(param) {\n var entrypoint = param.entrypoint, styles = param.styles;\n var res = Object.assign({\n styles: styles\n }, entrypoint);\n return \"error\" in entrypoint ? entrypoint : res;\n }).catch(function(err) {\n if (prefetch) {\n // we don't want to cache errors during prefetch\n throw err;\n }\n return {\n error: err\n };\n }).finally(function() {\n return devBuildPromiseResolve == null ? void 0 : devBuildPromiseResolve();\n });\n });\n },\n prefetch: function prefetch(route) {\n var _this = this;\n // https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118\n // License: Apache 2.0\n var cn;\n if (cn = navigator.connection) {\n // Don't prefetch if using 2G or if Save-Data is enabled.\n if (cn.saveData || /2g/.test(cn.effectiveType)) return Promise.resolve();\n }\n return getFilesForRoute(assetPrefix, route).then(function(output) {\n return Promise.all(canPrefetch ? output.scripts.map(function(script) {\n return prefetchViaDom(script.toString(), \"script\");\n }) : []);\n }).then(function() {\n (0, _requestIdleCallback).requestIdleCallback(function() {\n return _this.loadRoute(route, true).catch(function() {});\n });\n }).catch(function() {});\n }\n };\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=route-loader.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yb3V0ZS1sb2FkZXIuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUs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RoZSBET006XG4gICAgICAgICAgICBpZiAoZG9jdW1lbnQucXVlcnlTZWxlY3Rvcihgc2NyaXB0W3NyY149XCIke3NyY31cIl1gKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxvYWRlZFNjcmlwdHMuc2V0KHNyYy50b1N0cmluZygpLCBwcm9tID0gYXBwZW5kU2NyaXB0KHNyYykpO1xuICAgICAgICAgICAgcmV0dXJuIHByb207XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gYXBwZW5kU2NyaXB0KHNyYyk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gZmV0Y2hTdHlsZVNoZWV0KGhyZWYpIHtcbiAgICAgICAgbGV0IHByb20gPSBzdHlsZVNoZWV0cy5nZXQoaHJlZik7XG4gICAgICAgIGlmIChwcm9tKSB7XG4gICAgICAgICAgICByZXR1cm4gcHJvbTtcbiAgICAgICAgfVxuICAgICAgICBzdHlsZVNoZWV0cy5zZXQoaHJlZiwgcHJvbSA9IGZldGNoKGhyZWYpLnRoZW4oKHJlcyk9PntcbiAgICAgICAgICAgIGlmICghcmVzLm9rKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBGYWlsZWQgdG8gbG9hZCBzdHlsZXNoZWV0OiAke2hyZWZ9YCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzLnRleHQoKS50aGVuKCh0ZXh0KT0+KHtcbiAgICAgICAgICAgICAgICAgICAgaHJlZjogaHJlZixcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogdGV4dFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfSkuY2F0Y2goKGVycik9PntcbiAgICAgICAgICAgIHRocm93IG1hcmtBc3NldEVycm9yKGVycik7XG4gICAgICAgIH0pKTtcbiAgICAgICAgcmV0dXJuIHByb207XG4gICAgfVxuICAgIHJldHVybiB7XG4gICAgICAgIHdoZW5FbnRyeXBvaW50IChyb3V0ZSkge1xuICAgICAgICAgICAgcmV0dXJuIHdpdGhGdXR1cmUocm91dGUsIGVudHJ5cG9pbnRzKTtcbiAgICAgICAgfSxcbiAgICAgICAgb25FbnRyeXBvaW50IChyb3V0ZSwgZXhlY3V0ZSkge1xuICAgICAgICAgICAgKGV4ZWN1dGUgPyBQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5leGVjdXRlKCkpLnRoZW4oKGV4cG9ydHMpPT4oe1xuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQ6IGV4cG9ydHMgJiYgZXhwb3J0cy5kZWZhdWx0IHx8IGV4cG9ydHMsXG4gICAgICAgICAgICAgICAgICAgIGV4cG9ydHM6IGV4cG9ydHNcbiAgICAgICAgICAgICAgICB9KSwgKGVycik9Pih7XG4gICAgICAgICAgICAgICAgICAgIGVycm9yOiBlcnJcbiAgICAgICAgICAgICAgICB9KSkgOiBQcm9taXNlLnJlc29sdmUodW5kZWZpbmVkKSkudGhlbigoaW5wdXQpPT57XG4gICAgICAgICAgICAgICAgY29uc3Qgb2xkID0gZW50cnlwb2ludHMuZ2V0KHJvdXRlKTtcbiAgICAgICAgICAgICAgICBpZiAob2xkICYmICdyZXNvbHZlJyBpbiBvbGQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRyeXBvaW50cy5zZXQocm91dGUsIGlucHV0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9sZC5yZXNvbHZlKGlucHV0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZW50cnlwb2ludHMuc2V0KHJvdXRlLCBpbnB1dCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRyeXBvaW50cy5kZWxldGUocm91dGUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gdGhpcyBlbnRyeXBvaW50IGhhcyBiZWVuIHJlc29sdmVkIGJlZm9yZVxuICAgICAgICAgICAgICAgICAgICAvLyB0aGUgcm91dGUgaXMgb3V0ZGF0ZWQgYW5kIHdlIHdhbnQgdG8gaW52YWxpZGF0ZVxuICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGNhY2hlIGVudHJ5XG4gICAgICAgICAgICAgICAgICAgIHJvdXRlcy5kZWxldGUocm91dGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBsb2FkUm91dGUgKHJvdXRlLCBwcmVmZXRjaCkge1xuICAgICAgICAgICAgcmV0dXJuIHdpdGhGdXR1cmUocm91dGUsIHJvdXRlcywgKCk9PntcbiAgICAgICAgICAgICAgICBsZXQgZGV2QnVpbGRQcm9taXNlUmVzb2x2ZTtcbiAgICAgICAgICAgICAgICBpZiAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgPT09ICdkZXZlbG9wbWVudCcpIHtcbiAgICAgICAgICAgICAgICAgICAgZGV2QnVpbGRQcm9taXNlID0gbmV3IFByb21pc2UoKHJlc29sdmUpPT57XG4gICAgICAgICAgICAgICAgICAgICAgICBkZXZCdWlsZFByb21pc2VSZXNvbHZlID0gcmVzb2x2ZTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlUHJvbWlzZVdpdGhUaW1lb3V0KGdldEZpbGVzRm9yUm91dGUoYXNzZXRQcmVmaXgsIHJvdXRlKS50aGVuKCh7IHNjcmlwdHMgLCBjc3MgIH0pPT57XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLmFsbChbXG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRyeXBvaW50cy5oYXMocm91dGUpID8gW10gOiBQcm9taXNlLmFsbChzY3JpcHRzLm1hcChtYXliZUV4ZWN1dGVTY3JpcHQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFByb21pc2UuYWxsKGNzcy5tYXAoZmV0Y2hTdHlsZVNoZWV0KSksIFxuICAgICAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgICAgICB9KS50aGVuKChyZXMpPT57XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLndoZW5FbnRyeXBvaW50KHJvdXRlKS50aGVuKChlbnRyeXBvaW50KT0+KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeXBvaW50LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlczogcmVzWzFdXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgfSksIE1TX01BWF9JRExFX0RFTEFZLCBtYXJrQXNzZXRFcnJvcihuZXcgRXJyb3IoYFJvdXRlIGRpZCBub3QgY29tcGxldGUgbG9hZGluZzogJHtyb3V0ZX1gKSkpLnRoZW4oKHsgZW50cnlwb2ludCAsIHN0eWxlcyAgfSk9PntcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzID0gT2JqZWN0LmFzc2lnbih7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZXM6IHN0eWxlc1xuICAgICAgICAgICAgICAgICAgICB9LCBlbnRyeXBvaW50KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdlcnJvcicgaW4gZW50cnlwb2ludCA/IGVudHJ5cG9pbnQgOiByZXM7XG4gICAgICAgICAgICAgICAgfSkuY2F0Y2goKGVycik9PntcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZWZldGNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBkb24ndCB3YW50IHRvIGNhY2hlIGVycm9ycyBkdXJpbmcgcHJlZmV0Y2hcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3I6IGVyclxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH0pLmZpbmFsbHkoKCk9PntcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRldkJ1aWxkUHJvbWlzZVJlc29sdmUgPT0gbnVsbCA/IHZvaWQgMCA6IGRldkJ1aWxkUHJvbWlzZVJlc29sdmUoKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBwcmVmZXRjaCAocm91dGUpIHtcbiAgICAgICAgICAgIC8vIGh0dHBzOi8vZ2l0aHViLmNvbS9Hb29nbGVDaHJvbWVMYWJzL3F1aWNrbGluay9ibG9iLzQ1M2E2NjFmYTFmYTk0MGUyZDJlMDQ0NDUyMzk4ZTM4YzY3YTk4ZmIvc3JjL2luZGV4Lm1qcyNMMTE1LUwxMThcbiAgICAgICAgICAgIC8vIExpY2Vuc2U6IEFwYWNoZSAyLjBcbiAgICAgICAgICAgIGxldCBjbjtcbiAgICAgICAgICAgIGlmIChjbiA9IG5hdmlnYXRvci5jb25uZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgLy8gRG9uJ3QgcHJlZmV0Y2ggaWYgdXNpbmcgMkcgb3IgaWYgU2F2ZS1EYXRhIGlzIGVuYWJsZWQuXG4gICAgICAgICAgICAgICAgaWYgKGNuLnNhdmVEYXRhIHx8IC8yZy8udGVzdChjbi5lZmZlY3RpdmVUeXBlKSkgcmV0dXJuIFByb21pc2UucmVzb2x2ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGdldEZpbGVzRm9yUm91dGUoYXNzZXRQcmVma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Iiwic2VsZiIsIl9fQlVJTERfTUFOSUZFU1QiLCJvbkJ1aWxkTWFuaWZlc3QiLCJjYiIsIl9fQlVJTERfTUFOSUZFU1RfQ0IiLCJnZXRGaWxlc0ZvclJvdXRlIiwiYXNzZXRQcmVmaXgiLCJyb3V0ZSIsInNjcmlwdFVybCIsImVuY29kZVVSSSIsInNjcmlwdHMiLCJfX3Vuc2FmZUNyZWF0ZVRydXN0ZWRTY3JpcHRVUkwiLCJjc3MiLCJtYW5pZmVzdCIsImFsbEZpbGVzIiwiZmlsdGVyIiwidiIsImVuZHNXaXRoIiwibWF5YmVFeGVjdXRlU2NyaXB0IiwibG9hZGVkU2NyaXB0cyIsInRvU3RyaW5nIiwiZmV0Y2hTdHlsZVNoZWV0Iiwic3R5bGVTaGVldHMiLCJmZXRjaCIsIm9rIiwidGV4dCIsImNvbnRlbnQiLCJlbnRyeXBvaW50cyIsIk1hcCIsInJvdXRlcyIsIndoZW5FbnRyeXBvaW50Iiwib25FbnRyeXBvaW50IiwiZXhlY3V0ZSIsImNvbXBvbmVudCIsImVycm9yIiwidW5kZWZpbmVkIiwiaW5wdXQiLCJvbGQiLCJsb2FkUm91dGUiLCJwcmVmZXRjaCIsImRldkJ1aWxkUHJvbWlzZVJlc29sdmUiLCJhbGwiLCJoYXMiLCJlbnRyeXBvaW50Iiwic3R5bGVzIiwiYXNzaWduIiwiZmluYWxseSIsImNuIiwibmF2aWdhdG9yIiwiY29ubmVjdGlvbiIsInNhdmVEYXRhIiwidGVzdCIsImVmZmVjdGl2ZVR5cGUiLCJvdXRwdXQiLCJfX2VzTW9kdWxlIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/route-loader.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/router.js": /*!*************************************************!*\ !*** ./node_modules/next/dist/client/router.js ***! \*************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _construct = (__webpack_require__(/*! @swc/helpers/lib/_construct.js */ \"./node_modules/@swc/helpers/lib/_construct.js\")[\"default\"]);\nvar _toConsumableArray = (__webpack_require__(/*! @swc/helpers/lib/_to_consumable_array.js */ \"./node_modules/@swc/helpers/lib/_to_consumable_array.js\")[\"default\"]);\nvar _s = $RefreshSig$();\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"Router\", ({\n enumerable: true,\n get: function get() {\n return _router.default;\n }\n}));\nObject.defineProperty(exports, \"withRouter\", ({\n enumerable: true,\n get: function get() {\n return _withRouter.default;\n }\n}));\nexports.useRouter = useRouter;\nexports.createRouter = createRouter;\nexports.makePublicRouterInstance = makePublicRouterInstance;\nexports[\"default\"] = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _router = _interop_require_default(__webpack_require__(/*! ../shared/lib/router/router */ \"./node_modules/next/dist/shared/lib/router/router.js\"));\nvar _routerContext = __webpack_require__(/*! ../shared/lib/router-context */ \"./node_modules/next/dist/shared/lib/router-context.js\");\nvar _isError = _interop_require_default(__webpack_require__(/*! ../lib/is-error */ \"./node_modules/next/dist/lib/is-error.js\"));\nvar _withRouter = _interop_require_default(__webpack_require__(/*! ./with-router */ \"./node_modules/next/dist/client/with-router.js\"));\nvar singletonRouter = {\n router: null,\n readyCallbacks: [],\n ready: function ready(cb) {\n if (this.router) return cb();\n if (true) {\n this.readyCallbacks.push(cb);\n }\n }\n};\n// Create public properties and methods of the router in the singletonRouter\nvar urlPropertyFields = [\n \"pathname\",\n \"route\",\n \"query\",\n \"asPath\",\n \"components\",\n \"isFallback\",\n \"basePath\",\n \"locale\",\n \"locales\",\n \"defaultLocale\",\n \"isReady\",\n \"isPreview\",\n \"isLocaleDomain\",\n \"domainLocales\", \n];\nvar routerEvents = [\n \"routeChangeStart\",\n \"beforeHistoryChange\",\n \"routeChangeComplete\",\n \"routeChangeError\",\n \"hashChangeStart\",\n \"hashChangeComplete\", \n];\nvar coreMethodFields = [\n \"push\",\n \"replace\",\n \"reload\",\n \"back\",\n \"prefetch\",\n \"beforePopState\", \n];\n// Events is a static property on the router, the router doesn't have to be initialized to use it\nObject.defineProperty(singletonRouter, \"events\", {\n get: function get() {\n return _router.default.events;\n }\n});\nfunction getRouter() {\n if (!singletonRouter.router) {\n var message = \"No router instance found.\\n\" + 'You should only use \"next/router\" on the client side of your app.\\n';\n throw new Error(message);\n }\n return singletonRouter.router;\n}\nurlPropertyFields.forEach(function(field) {\n // Here we need to use Object.defineProperty because we need to return\n // the property assigned to the actual router\n // The value might get changed as we change routes and this is the\n // proper way to access it\n Object.defineProperty(singletonRouter, field, {\n get: function get() {\n var router = getRouter();\n return router[field];\n }\n });\n});\ncoreMethodFields.forEach(function(field) {\n singletonRouter[field] = function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n var _router;\n var router = getRouter();\n return (_router = router)[field].apply(_router, _toConsumableArray(args));\n };\n});\nrouterEvents.forEach(function(event) {\n singletonRouter.ready(function() {\n _router.default.events.on(event, function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n var eventField = \"on\".concat(event.charAt(0).toUpperCase()).concat(event.substring(1));\n var _singletonRouter = singletonRouter;\n if (_singletonRouter[eventField]) {\n try {\n var __singletonRouter;\n (__singletonRouter = _singletonRouter)[eventField].apply(__singletonRouter, _toConsumableArray(args));\n } catch (err) {\n console.error(\"Error when running the Router event: \".concat(eventField));\n console.error((0, _isError).default(err) ? \"\".concat(err.message, \"\\n\").concat(err.stack) : err + \"\");\n }\n }\n });\n });\n});\nvar _default = singletonRouter;\nexports[\"default\"] = _default;\nfunction useRouter() {\n _s();\n return _react.default.useContext(_routerContext.RouterContext);\n}\n_s(useRouter, \"gDsCjeeItUuvgOWf1v4qoK9RF6k=\");\nfunction createRouter() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n singletonRouter.router = _construct(_router.default, _toConsumableArray(args));\n singletonRouter.readyCallbacks.forEach(function(cb) {\n return cb();\n });\n singletonRouter.readyCallbacks = [];\n return singletonRouter.router;\n}\nfunction makePublicRouterInstance(router) {\n var scopedRouter = router;\n var instance = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = urlPropertyFields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var property = _step.value;\n if (typeof scopedRouter[property] === \"object\") {\n instance[property] = Object.assign(Array.isArray(scopedRouter[property]) ? [] : {}, scopedRouter[property]) // makes sure query is not stateful\n ;\n continue;\n }\n instance[property] = scopedRouter[property];\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n // Events is a static property on the router, the router doesn't have to be initialized to use it\n instance.events = _router.default.events;\n coreMethodFields.forEach(function(field) {\n instance[field] = function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n var _scopedRouter;\n return (_scopedRouter = scopedRouter)[field].apply(_scopedRouter, _toConsumableArray(args));\n };\n });\n return instance;\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=router.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJza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sZXRvblJvdXRlciIsImVyciIsImNvbnNvbGUiLCJlcnJvciIsInN0YWNrIiwiX2RlZmF1bHQiLCJ1c2VDb250ZXh0IiwiUm91dGVyQ29udGV4dCIsInNjb3BlZFJvdXRlciIsImluc3RhbmNlIiwicHJvcGVydHkiLCJhc3NpZ24iLCJBcnJheSIsImlzQXJyYXkiLCJfX2VzTW9kdWxlIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/router.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/script.js": /*!*************************************************!*\ !*** ./node_modules/next/dist/client/script.js ***! \*************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nvar _toConsumableArray = (__webpack_require__(/*! @swc/helpers/lib/_to_consumable_array.js */ \"./node_modules/@swc/helpers/lib/_to_consumable_array.js\")[\"default\"]);\nvar _s = $RefreshSig$();\n\"client\";\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.handleClientScriptLoad = handleClientScriptLoad;\nexports.initScriptLoader = initScriptLoader;\nexports[\"default\"] = void 0;\nvar _extends = (__webpack_require__(/*! @swc/helpers/lib/_extends.js */ \"./node_modules/@swc/helpers/lib/_extends.js\")[\"default\"]);\nvar _interop_require_wildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ \"./node_modules/@swc/helpers/lib/_interop_require_wildcard.js\")[\"default\"]);\nvar _object_without_properties_loose = (__webpack_require__(/*! @swc/helpers/lib/_object_without_properties_loose.js */ \"./node_modules/@swc/helpers/lib/_object_without_properties_loose.js\")[\"default\"]);\nvar _react = _interop_require_wildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _headManagerContext = __webpack_require__(/*! ../shared/lib/head-manager-context */ \"./node_modules/next/dist/shared/lib/head-manager-context.js\");\nvar _headManager = __webpack_require__(/*! ./head-manager */ \"./node_modules/next/dist/client/head-manager.js\");\nvar _requestIdleCallback = __webpack_require__(/*! ./request-idle-callback */ \"./node_modules/next/dist/client/request-idle-callback.js\");\n\"client\";\nvar ScriptCache = new Map();\nvar LoadCache = new Set();\nvar ignoreProps = [\n \"onLoad\",\n \"onReady\",\n \"dangerouslySetInnerHTML\",\n \"children\",\n \"onError\",\n \"strategy\", \n];\nvar loadScript = function(props) {\n var src = props.src, id = props.id, _onLoad = props.onLoad, onLoad = _onLoad === void 0 ? function() {} : _onLoad, _onReady = props.onReady, onReady = _onReady === void 0 ? null : _onReady, dangerouslySetInnerHTML = props.dangerouslySetInnerHTML, _children = props.children, children = _children === void 0 ? \"\" : _children, _strategy = props.strategy, strategy = _strategy === void 0 ? \"afterInteractive\" : _strategy, onError = props.onError;\n var cacheKey = id || src;\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return;\n }\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey);\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError);\n return;\n }\n /** Execute after the script first loaded */ var afterLoad = function() {\n // Run onReady for the first time after load event\n if (onReady) {\n onReady();\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey);\n };\n var el = document.createElement(\"script\");\n var loadPromise = new Promise(function(resolve, reject) {\n el.addEventListener(\"load\", function(e) {\n resolve();\n if (onLoad) {\n onLoad.call(this, e);\n }\n afterLoad();\n });\n el.addEventListener(\"error\", function(e) {\n reject(e);\n });\n }).catch(function(e) {\n if (onError) {\n onError(e);\n }\n });\n if (dangerouslySetInnerHTML) {\n el.innerHTML = dangerouslySetInnerHTML.__html || \"\";\n afterLoad();\n } else if (children) {\n el.textContent = typeof children === \"string\" ? children : Array.isArray(children) ? children.join(\"\") : \"\";\n afterLoad();\n } else if (src) {\n el.src = src;\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n ScriptCache.set(src, loadPromise);\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = Object.entries(props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var _value = _slicedToArray(_step.value, 2), k = _value[0], value = _value[1];\n if (value === undefined || ignoreProps.includes(k)) {\n continue;\n }\n var attr = _headManager.DOMAttributeNames[k] || k.toLowerCase();\n el.setAttribute(attr, value);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (strategy === \"worker\") {\n el.setAttribute(\"type\", \"text/partytown\");\n }\n el.setAttribute(\"data-nscript\", strategy);\n document.body.appendChild(el);\n};\nfunction handleClientScriptLoad(props) {\n var _strategy = props.strategy, strategy = _strategy === void 0 ? \"afterInteractive\" : _strategy;\n if (strategy === \"lazyOnload\") {\n window.addEventListener(\"load\", function() {\n (0, _requestIdleCallback).requestIdleCallback(function() {\n return loadScript(props);\n });\n });\n } else {\n loadScript(props);\n }\n}\nfunction loadLazyScript(props) {\n if (document.readyState === \"complete\") {\n (0, _requestIdleCallback).requestIdleCallback(function() {\n return loadScript(props);\n });\n } else {\n window.addEventListener(\"load\", function() {\n (0, _requestIdleCallback).requestIdleCallback(function() {\n return loadScript(props);\n });\n });\n }\n}\nfunction addBeforeInteractiveToCache() {\n var scripts = _toConsumableArray(document.querySelectorAll('[data-nscript=\"beforeInteractive\"]')).concat(_toConsumableArray(document.querySelectorAll('[data-nscript=\"beforePageRender\"]')));\n scripts.forEach(function(script) {\n var cacheKey = script.id || script.getAttribute(\"src\");\n LoadCache.add(cacheKey);\n });\n}\nfunction initScriptLoader(scriptLoaderItems) {\n scriptLoaderItems.forEach(handleClientScriptLoad);\n addBeforeInteractiveToCache();\n}\nfunction Script(props) {\n _s();\n var id = props.id, _src = props.src, src = _src === void 0 ? \"\" : _src, _onLoad = props.onLoad, onLoad = _onLoad === void 0 ? function() {} : _onLoad, _onReady = props.onReady, onReady = _onReady === void 0 ? null : _onReady, _strategy = props.strategy, strategy = _strategy === void 0 ? \"afterInteractive\" : _strategy, onError = props.onError, restProps = _object_without_properties_loose(props, [\n \"id\",\n \"src\",\n \"onLoad\",\n \"onReady\",\n \"strategy\",\n \"onError\"\n ]);\n // Context is available only during SSR\n var ref = (0, _react).useContext(_headManagerContext.HeadManagerContext), updateScripts = ref.updateScripts, scripts = ref.scripts, getIsSsr = ref.getIsSsr;\n /**\n * - First mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)\n * onReady is skipped, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. hasLoadScriptEffectCalled.current is false, loadScript executes\n * Once the script is loaded, the onLoad and onReady will be called by then\n * [If strict mode is enabled / is wrapped in component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n *\n * - Second mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)\n * onReady is called, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. The script is already loaded, loadScript bails out\n * [If strict mode is enabled / is wrapped in component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n */ var hasOnReadyEffectCalled = (0, _react).useRef(false);\n (0, _react).useEffect(function() {\n var cacheKey = id || src;\n if (!hasOnReadyEffectCalled.current) {\n // Run onReady if script has loaded before but component is re-mounted\n if (onReady && cacheKey && LoadCache.has(cacheKey)) {\n onReady();\n }\n hasOnReadyEffectCalled.current = true;\n }\n }, [\n onReady,\n id,\n src\n ]);\n var hasLoadScriptEffectCalled = (0, _react).useRef(false);\n (0, _react).useEffect(function() {\n if (!hasLoadScriptEffectCalled.current) {\n if (strategy === \"afterInteractive\") {\n loadScript(props);\n } else if (strategy === \"lazyOnload\") {\n loadLazyScript(props);\n }\n hasLoadScriptEffectCalled.current = true;\n }\n }, [\n props,\n strategy\n ]);\n if (strategy === \"beforeInteractive\" || strategy === \"worker\") {\n if (updateScripts) {\n scripts[strategy] = (scripts[strategy] || []).concat([\n _extends({\n id: id,\n src: src,\n onLoad: onLoad,\n onReady: onReady,\n onError: onError\n }, restProps), \n ]);\n updateScripts(scripts);\n } else if (getIsSsr && getIsSsr()) {\n // Script has already loaded during SSR\n LoadCache.add(id || src);\n } else if (getIsSsr && !getIsSsr()) {\n loadScript(props);\n }\n }\n return null;\n}\n_s(Script, \"kiDojfm/3Ev+ZrEJMYf7ieqO4Lc=\");\n_c = Script;\nObject.defineProperty(Script, \"__nextScript\", {\n value: true\n});\nvar _default = Script;\nexports[\"default\"] = _default;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=script.js.map\nvar _c;\n$RefreshReg$(_c, \"Script\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9zY3JpcHQuanMuanMiLCJtYXBwaW5ncyI6IkFBQ2E7Ozs7Ozs7QUFEYix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XRlRWxlbWVudCgnc2NyaXB0Jyk7XG4gICAgY29uc3QgbG9hZFByb21pc2UgPSBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KT0+e1xuICAgICAgICBlbC5hZGRFdmVudExpc3RlbmVyKCdsb2FkJywgZnVuY3Rpb24oZSkge1xuICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgICAgaWYgKG9uTG9hZCkge1xuICAgICAgICAgICAgICAgIG9uTG9hZC5jYWxsKHRoaXMsIGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWZ0ZXJMb2FkKCk7XG4gICAgICAgIH0pO1xuICAgICAgICBlbC5hZGRFdmVudExpc3RlbmVyKCdlcnJvcicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgfSk7XG4gICAgfSkuY2F0Y2goZnVuY3Rpb24oZSkge1xuICAgICAgICBpZiAob25FcnJvcikge1xuICAgICAgICAgICAgb25FcnJvcihlKTtcbiAgICAgICAgfVxuICAgIH0pO1xuICAgIGlmIChkYW5nZXJvdXNseVNldElubmVySFRNTCkge1xuICAgICAgICBlbC5pbm5lckhUTUwgPSBkYW5nZXJvdXNseVNldElubmVySFRNTC5fX2h0bWwgfHwgJyc7XG4gICAgICAgIGFmdGVyTG9hZCgpO1xuICAgIH0gZWxzZSBpZiAoY2hpbGRyZW4pIHtcbiAgICAgICAgZWwudGV4dENvbnRlbnQgPSB0eXBlb2YgY2hpbGRyZW4gPT09ICdzdHJpbmcnID8gY2hpbGRyZW4gOiBBcnJheS5pc0FycmF5KGNoaWxkcmVuKSA/IGNoaWxkcmVuLmpvaW4oJycpIDogJyc7XG4gICAgICAgIGFmdGVyTG9hZCgpO1xuICAgIH0gZWxzZSBpZiAoc3JjKSB7XG4gICAgICAgIGVsLnNyYyA9IHNyYztcbiAgICAgICAgLy8gZG8gbm90IGFkZCBjYWNoZUtleSBpbnRvIExvYWRDYWNoZSBmb3Ig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d5XSB8fCBbXSkuY29uY2F0KFtcbiAgICAgICAgICAgICAgICBfZXh0ZW5kcyh7XG4gICAgICAgICAgICAgICAgICAgIGlkLFxuICAgICAgICAgICAgICAgICAgICBzcmMsXG4gICAgICAgICAgICAgICAgICAgIG9uTG9hZCxcbiAgICAgICAgICAgICAgICAgICAgb25SZWFkeSxcbiAgICAgICAgICAgICAgICAgICAgb25FcnJvclxuICAgICAgICAgICAgICAgIH0sIHJlc3RQcm9wcyksIFxuICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICB1cGRhdGVTY3JpcHRzKHNjcmlwdHMpO1xuICAgICAgICB9IGVsc2UgaWYgKGdldElzU3NyICYmIGdldElzU3NyKCkpIHtcbiAgICAgICAgICAgIC8vIFNjcmlwdCBoYXMgYWxyZWFkeSBsb2FkZWQgZHVyaW5nIFNTUlxuICAgICAgICAgICAgTG9hZENhY2hlLmFkZChpZCB8fCBzcmMpO1xuICAgICAgICB9IGVsc2UgaWYgKGdldElzU3NyICYmICFnZXRJc1NzcigpKSB7XG4gICAgICAgICAgICBsb2FkU2NyaXB0KHByb3BzKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gbnVsbDtcbn1cbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShTY3JpcHQsICdfX25leHRTY3JpcHQnLCB7XG4gICAgdmFsdWU6IHRydWVcbn0pO1xudmFyIF9kZWZhdWx0ID0gU2NyaXB0O1xuZXhwb3J0cy5kZWZhdWx0ID0gX2RlZmF1bHQ7XG5cbmlmICgodHlwZW9mIGV4cG9ydHMuZGVmYXVsdCA9PT0gJ2Z1bmN0aW9uJyB8fCAodHlwZW9mIGV4cG9ydHMuZGVmYXVsdCA9PT0gJ29iamVjdCcgJiYgZXhwb3J0cy5kZWZhdWx0ICE9PSBudWxsKSkgJiYgdHlwZW9mIGV4cG9ydHMuZGVmYXVsdC5fX2VzTW9kdWxlID09PSAndW5kZWZpbmVkJykge1xuICBPYmplY3QuZGVmaW5lUHJvcG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ImlzQXJyYXkiLCJqb2luIiwic2V0IiwiZW50cmllcyIsImsiLCJ1bmRlZmluZWQiLCJpbmNsdWRlcyIsImF0dHIiLCJET01BdHRyaWJ1dGVOYW1lcyIsInRvTG93ZXJDYXNlIiwic2V0QXR0cmlidXRlIiwiYm9keSIsImFwcGVuZENoaWxkIiwid2luZG93IiwicmVxdWVzdElkbGVDYWxsYmFjayIsImxvYWRMYXp5U2NyaXB0IiwicmVhZHlTdGF0ZSIsImFkZEJlZm9yZUludGVyYWN0aXZlVG9DYWNoZSIsInNjcmlwdHMiLCJxdWVyeVNlbGVjdG9yQWxsIiwiZm9yRWFjaCIsInNjcmlwdCIsImdldEF0dHJpYnV0ZSIsInNjcmlwdExvYWRlckl0ZW1zIiwiU2NyaXB0IiwicmVzdFByb3BzIiwidXNlQ29udGV4dCIsIkhlYWRNYW5hZ2VyQ29udGV4dCIsInVwZGF0ZVNjcmlwdHMiLCJnZXRJc1NzciIsImhhc09uUmVhZHlFZmZlY3RDYWxsZWQiLCJ1c2VSZWYiLCJ1c2VFZmZlY3QiLCJjdXJyZW50IiwiaGFzTG9hZFNjcmlwdEVmZmVjdENhbGxlZCIsImNvbmNhdCIsIl9kZWZhdWx0IiwiX19lc01vZHVsZSIsImFzc2lnbiIsIm1vZHVsZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/script.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/trusted-types.js": /*!********************************************************!*\ !*** ./node_modules/next/dist/client/trusted-types.js ***! \********************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.__unsafeCreateTrustedScriptURL = __unsafeCreateTrustedScriptURL;\n/**\n * Stores the Trusted Types Policy. Starts as undefined and can be set to null\n * if Trusted Types is not supported in the browser.\n */ var policy;\n/**\n * Getter for the Trusted Types Policy. If it is undefined, it is instantiated\n * here or set to null if Trusted Types is not supported in the browser.\n */ function getPolicy() {\n if (typeof policy === \"undefined\" && \"object\" !== \"undefined\") {\n var ref;\n policy = ((ref = window.trustedTypes) == null ? void 0 : ref.createPolicy(\"nextjs\", {\n createHTML: function(input) {\n return input;\n },\n createScript: function(input) {\n return input;\n },\n createScriptURL: function(input) {\n return input;\n }\n })) || null;\n }\n return policy;\n}\nfunction __unsafeCreateTrustedScriptURL(url) {\n var ref;\n return ((ref = getPolicy()) == null ? void 0 : ref.createScriptURL(url)) || url;\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=trusted-types.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC90cnVzdGVkLXR5cGVzLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsc0NBQXNDLEdBQUdFLDhCQUE4QixDQUFDO0FBQ3hFOzs7Q0FHQyxHQUFHLElBQUlDLE1BQU07QUFDZDs7O0NBR0MsR0FBRyxTQUFTQyxTQUFTLEdBQUc7SUFDckIsSUFBSSxPQUFPRCxNQUFNLEtBQUssV0FBVyxJQUFJLFFBQWEsS0FBSyxXQUFXLEVBQUU7UUFDaEUsSUFBSUUsR0FBRztRQUNQRixNQUFNLEdBQUcsQ0FBQyxDQUFDRSxHQUFHLEdBQUdDLE1BQU0sQ0FBQ0MsWUFBWSxLQUFLLElBQUksR0FBRyxLQUFLLENBQUMsR0FBR0YsR0FBRyxDQUFDRyxZQUFZLENBQUMsUUFBUSxFQUFFO1lBQ2hGQyxVQUFVLEVBQUUsU0FBQ0MsS0FB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WN5IiwicmVmIiwid2luZG93IiwidHJ1c3RlZFR5cGVzIiwiY3JlYXRlUG9saWN5IiwiY3JlYXRlSFRNTCIsImlucHV0IiwiY3JlYXRlU2NyaXB0IiwiY3JlYXRlU2NyaXB0VVJMIiwidXJsIiwiZGVmYXVsdCIsIl9fZXNNb2R1bGUiLCJhc3NpZ24iLCJtb2R1bGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/trusted-types.js\n")); /***/ }), /***/ "./node_modules/next/dist/client/with-router.js": /*!******************************************************!*\ !*** ./node_modules/next/dist/client/with-router.js ***! \******************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = withRouter;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _router = __webpack_require__(/*! ./router */ \"./node_modules/next/dist/client/router.js\");\nfunction withRouter(ComposedComponent) {\n var WithRouterWrapper = function WithRouterWrapper(props) {\n _s();\n return /*#__PURE__*/ _react.default.createElement(ComposedComponent, Object.assign({\n router: (0, _router).useRouter()\n }, props));\n };\n var _s = $RefreshSig$();\n _s(WithRouterWrapper, \"CeygcqajjFExIxFEzW4x/gfWEGQ=\");\n WithRouterWrapper.getInitialProps = ComposedComponent.getInitialProps;\n WithRouterWrapper.origGetInitialProps = ComposedComponent.origGetInitialProps;\n if (true) {\n var name = ComposedComponent.displayName || ComposedComponent.name || \"Unknown\";\n WithRouterWrapper.displayName = \"withRouter(\".concat(name, \")\");\n }\n return WithRouterWrapper;\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=with-router.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABo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sourceURL=webpack-internal:///./node_modules/next/dist/client/with-router.js\n")); /***/ }), /***/ "./node_modules/next/dist/compiled/strip-ansi/index.js": /*!*************************************************************!*\ !*** ./node_modules/next/dist/compiled/strip-ansi/index.js ***! \*************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("var __dirname = \"/\";\n\n(function() {\n \"use strict\";\n var e = {\n 511: function(e) {\n e.exports = function() {\n var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, tmp = ref.onlyFirst, _$e = tmp === void 0 ? false : tmp;\n var r = [\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\n \"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))\"\n ].join(\"|\");\n return new RegExp(r, _$e ? undefined : \"g\");\n };\n },\n 532: function(e, r, _) {\n var t = _(511);\n e.exports = function(e) {\n return typeof e === \"string\" ? e.replace(t(), \"\") : e;\n };\n }\n };\n var r = {};\n function __nccwpck_require__(_) {\n var t = r[_];\n if (t !== undefined) {\n return t.exports;\n }\n var a = r[_] = {\n exports: {}\n };\n var n = true;\n try {\n e[_](a, a.exports, __nccwpck_require__);\n n = false;\n } finally{\n if (n) delete r[_];\n }\n return a.exports;\n }\n if (typeof __nccwpck_require__ !== \"undefined\") __nccwpck_require__.ab = __dirname + \"/\";\n var _ = __nccwpck_require__(532);\n module.exports = _;\n})();\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NvbXBpbGVkL3N0cmlwLWFuc2kvaW5kZXguanMuanMiLCJtYXBwaW5ncyI6IjtBQUFBO0FBQUMsWUFBSTtJQUF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node_modules/next/dist/pages/_app.js": /*!**********************************************!*\ !*** ./node_modules/next/dist/pages/_app.js ***! \**********************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _classCallCheck = (__webpack_require__(/*! @swc/helpers/lib/_class_call_check.js */ \"./node_modules/@swc/helpers/lib/_class_call_check.js\")[\"default\"]);\nvar _createClass = (__webpack_require__(/*! @swc/helpers/lib/_create_class.js */ \"./node_modules/@swc/helpers/lib/_create_class.js\")[\"default\"]);\nvar _inherits = (__webpack_require__(/*! @swc/helpers/lib/_inherits.js */ \"./node_modules/@swc/helpers/lib/_inherits.js\")[\"default\"]);\nvar _createSuper = (__webpack_require__(/*! @swc/helpers/lib/_create_super.js */ \"./node_modules/@swc/helpers/lib/_create_super.js\")[\"default\"]);\nvar _tsGenerator = (__webpack_require__(/*! @swc/helpers/lib/_ts_generator.js */ \"./node_modules/@swc/helpers/lib/_ts_generator.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"AppInitialProps\", ({\n enumerable: true,\n get: function get() {\n return _utils.AppInitialProps;\n }\n}));\nObject.defineProperty(exports, \"NextWebVitalsMetric\", ({\n enumerable: true,\n get: function get() {\n return _utils.NextWebVitalsMetric;\n }\n}));\nObject.defineProperty(exports, \"AppType\", ({\n enumerable: true,\n get: function get() {\n return _utils.AppType;\n }\n}));\nexports[\"default\"] = void 0;\nvar _async_to_generator = (__webpack_require__(/*! @swc/helpers/lib/_async_to_generator.js */ \"./node_modules/@swc/helpers/lib/_async_to_generator.js\")[\"default\"]);\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _utils = __webpack_require__(/*! ../shared/lib/utils */ \"./node_modules/next/dist/shared/lib/utils.js\");\nfunction appGetInitialProps(_) {\n return _appGetInitialProps.apply(this, arguments);\n}\nfunction _appGetInitialProps() {\n _appGetInitialProps = /**\n * `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization.\n * This allows for keeping state between navigation, custom error handling, injecting additional data.\n */ _async_to_generator(function(param) {\n var Component, ctx, pageProps;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n Component = param.Component, ctx = param.ctx;\n return [\n 4,\n (0, _utils).loadGetInitialProps(Component, ctx)\n ];\n case 1:\n pageProps = _state.sent();\n return [\n 2,\n {\n pageProps: pageProps\n }\n ];\n }\n });\n });\n return _appGetInitialProps.apply(this, arguments);\n}\nvar _Component;\nvar App = /*#__PURE__*/ function(_superClass) {\n _inherits(App, _superClass);\n var _super = _createSuper(App);\n function App() {\n _classCallCheck(this, App);\n return _super.apply(this, arguments);\n }\n _createClass(App, [\n {\n key: \"render\",\n value: function render() {\n var _props = this.props, Component = _props.Component, pageProps = _props.pageProps;\n return /*#__PURE__*/ _react.default.createElement(Component, Object.assign({}, pageProps));\n }\n }\n ]);\n return App;\n}(_Component = _react.default.Component);\nApp.origGetInitialProps = appGetInitialProps;\nApp.getInitialProps = appGetInitialProps;\nexports[\"default\"] = App; //# sourceMappingURL=_app.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3BhZ2VzL19hcHAuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Ozs7Ozs7OztBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hILG1EQUFrRDtJQUM5Q0ksVUFBVSxFQUFFLElBQUk7SUFDaEJDLEdBQUcsRUFBRSxTQUFMQSxHQUFHLEdBQWE7UUFDWixPQUFPQyxNQUFNLENBQUNDLGVBQWUsQ0FBQztJQUNsQyxDQUFDO0N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xlbWVudCIsImFzc2lnbiIsImdldEluaXRpYWxQcm9wcyJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/pages/_app.js\n")); /***/ }), /***/ "./node_modules/next/dist/pages/_error.js": /*!************************************************!*\ !*** ./node_modules/next/dist/pages/_error.js ***! \************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _classCallCheck = (__webpack_require__(/*! @swc/helpers/lib/_class_call_check.js */ \"./node_modules/@swc/helpers/lib/_class_call_check.js\")[\"default\"]);\nvar _createClass = (__webpack_require__(/*! @swc/helpers/lib/_create_class.js */ \"./node_modules/@swc/helpers/lib/_create_class.js\")[\"default\"]);\nvar _inherits = (__webpack_require__(/*! @swc/helpers/lib/_inherits.js */ \"./node_modules/@swc/helpers/lib/_inherits.js\")[\"default\"]);\nvar _createSuper = (__webpack_require__(/*! @swc/helpers/lib/_create_super.js */ \"./node_modules/@swc/helpers/lib/_create_super.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _head = _interop_require_default(__webpack_require__(/*! ../shared/lib/head */ \"./node_modules/next/dist/shared/lib/head.js\"));\nvar statusCodes = {\n 400: \"Bad Request\",\n 404: \"This page could not be found\",\n 405: \"Method Not Allowed\",\n 500: \"Internal Server Error\"\n};\nfunction _getInitialProps(param) {\n var res = param.res, err = param.err;\n var statusCode = res && res.statusCode ? res.statusCode : err ? err.statusCode : 404;\n return {\n statusCode: statusCode\n };\n}\nvar styles = {\n error: {\n fontFamily: '-apple-system, BlinkMacSystemFont, Roboto, \"Segoe UI\", \"Fira Sans\", Avenir, \"Helvetica Neue\", \"Lucida Grande\", sans-serif',\n height: \"100vh\",\n textAlign: \"center\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\"\n },\n desc: {\n display: \"inline-block\",\n textAlign: \"left\",\n lineHeight: \"49px\",\n height: \"49px\",\n verticalAlign: \"middle\"\n },\n h1: {\n display: \"inline-block\",\n margin: 0,\n marginRight: \"20px\",\n padding: \"0 23px 0 0\",\n fontSize: \"24px\",\n fontWeight: 500,\n verticalAlign: \"top\",\n lineHeight: \"49px\"\n },\n h2: {\n fontSize: \"14px\",\n fontWeight: \"normal\",\n lineHeight: \"49px\",\n margin: 0,\n padding: 0\n }\n};\nvar _Component;\nvar Error = /*#__PURE__*/ function(_superClass) {\n _inherits(Error, _superClass);\n var _super = _createSuper(Error);\n function Error() {\n _classCallCheck(this, Error);\n return _super.apply(this, arguments);\n }\n _createClass(Error, [\n {\n key: \"render\",\n value: function render() {\n var _props = this.props, statusCode = _props.statusCode, _withDarkMode = _props.withDarkMode, withDarkMode = _withDarkMode === void 0 ? true : _withDarkMode;\n var title = this.props.title || statusCodes[statusCode] || \"An unexpected error has occurred\";\n return /*#__PURE__*/ _react.default.createElement(\"div\", {\n style: styles.error\n }, /*#__PURE__*/ _react.default.createElement(_head.default, null, /*#__PURE__*/ _react.default.createElement(\"title\", null, statusCode ? \"\".concat(statusCode, \": \").concat(title) : \"Application error: a client-side exception has occurred\")), /*#__PURE__*/ _react.default.createElement(\"div\", null, /*#__PURE__*/ _react.default.createElement(\"style\", {\n dangerouslySetInnerHTML: {\n __html: \"\\n body { margin: 0; color: #000; background: #fff; }\\n .next-error-h1 {\\n border-right: 1px solid rgba(0, 0, 0, .3);\\n }\\n\\n \".concat(withDarkMode ? \"@media (prefers-color-scheme: dark) {\\n body { color: #fff; background: #000; }\\n .next-error-h1 {\\n border-right: 1px solid rgba(255, 255, 255, .3);\\n }\\n }\" : \"\")\n }\n }), statusCode ? /*#__PURE__*/ _react.default.createElement(\"h1\", {\n className: \"next-error-h1\",\n style: styles.h1\n }, statusCode) : null, /*#__PURE__*/ _react.default.createElement(\"div\", {\n style: styles.desc\n }, /*#__PURE__*/ _react.default.createElement(\"h2\", {\n style: styles.h2\n }, this.props.title || statusCode ? title : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, \"Application error: a client-side exception has occurred (see the browser console for more information)\"), \".\"))));\n }\n }\n ]);\n return Error;\n}(_Component = _react.default.Component);\nError.displayName = \"ErrorPage\";\nError.getInitialProps = _getInitialProps;\nError.origGetInitialProps = _getInitialProps;\nexports[\"default\"] = Error; //# sourceMappingURL=_error.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3BhZ2VzL19lcnJvci5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTs7Ozs7Ozs7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxrQkFBZSxHQUFHLEtBQUssQ0FBQyxDQUFDO0FBQ3pCLElBQUlHLHdCQUF3QixHQUFHQyxtSkFBK0Q7QUFDOUYsSUFBSUMsTUFBTSxHQUFHRix3QkFBd0IsQ0FBQ0MsbUJBQU8sQ0FBQyw0Q0FBTyxDQUFDLENBQUM7QUFDdkQsSUFBSUUsS0FBSyxHQUFHSCx3QkFBd0IsQ0FBQ0MsbUJBQU8sQ0FBQyx1RUFBb0IsQ0FBQyxDQUFDO0FBQ25FLElBQU1HLFdBQVcsR0FBRztBQUNoQixPQUFHLEVBQUUsYUFBYTtBQUNsQixPQUFHLEVBQUUsOEJBQThCO0FBQ25DLE9BQUcsRUFBRSxvQkFBb0I7QUFDekIsT0FBRyxFQUFFLHVCQUF1QjtDQUMvQjtBQUNELFNBQVNDLGdCQUFnQixDQUFDLEtBQWMsRUFBRTtRQUFkQyxHQUFHLEdBQUwsS0FBYy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FkLmRlZmF1bHQsIG51bGwsIC8qI19fUFVSRV9fKi8gX3JlYWN0LmRlZmF1bHQuY3JlYXRlRWxlbWVudChcInRpdGxlXCIsIG51bGwsIHN0YXR1c0NvZGUgPyBgJHtzdGF0dXNDb2RlfTogJHt0aXRsZX1gIDogJ0FwcGxpY2F0aW9uIGVycm9yOiBhIGNsaWVudC1zaWRlIGV4Y2VwdGlvbiBoYXMgb2NjdXJyZWQnKSksIC8qI19fUFVSRV9fKi8gX3JlYWN0LmRlZmF1bHQuY3JlYXRlRWxlbWVudChcImRpdlwiLCBudWxsLCAvKiNfX1BVUkVfXyovIF9yZWFjdC5kZWZhdWx0LmNyZWF0ZUVsZW1lbnQoXCJzdHlsZVwiLCB7XG4gICAgICAgICAgICBkYW5nZXJvdXNseVNldElubmVySFRNTDoge1xuICAgICAgICAgICAgICAgIF9faHRtbDogYFxuICAgICAgICAgICAgICAgIGJvZHkgeyBtYXJnaW46IDA7IGNvbG9yOiAjMDAwOyBiYWNrZ3JvdW5kOiAjZmZmOyB9XG4gICAgICAgICAgICAgICAgLm5leHQtZXJyb3ItaDEge1xuICAgICAgICAgICAgICAgICAgYm9yZGVyLXJpZ2h0OiAxcHggc29saWQgcmdiYSgwLCAwLCAwLCAuMyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgJHt3aXRoRGFya01vZGUgPyBgQG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykge1xuICAgICAgICAgICAgICAgICAgYm9keSB7IGNvbG9yOiAjZmZmOyBiYWNrZ3JvdW5kOiAjMDAwOyB9XG4gICAgICAgICAgICAgICAgICAubmV4dC1lcnJvci1oMSB7XG4gICAgICAgICAgICAgICAgICAgIGJvcmRlci1yaWdodDogMXB4IHNvbGlkIHJnYmEoMjU1LCAyNTUsIDI1NSwgLjMpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1gIDogJyd9YFxuICAgICAgICAgICAgfVxu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uYW1lcyI6WyJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsImRlZmF1bHQiLCJfaW50ZXJvcF9yZXF1aXJlX2RlZmF1bHQiLCJyZXF1aXJlIiwiX3JlYWN0IiwiX2hlYWQiLCJzdGF0dXNDb2RlcyIsIl9nZXRJbml0aWFsUHJvcHMiLCJyZXMiLCJlcnIiLCJzdGF0dXNDb2RlIiwic3R5bGVzIiwiZXJyb3IiLCJmb250RmFtaWx5IiwiaGVpZ2h0IiwidGV4dEFsaWduIiwiZGlzcGxheSIsImZsZXhEaXJlY3Rpb24iLCJhbGlnbkl0ZW1zIiwianVzdGlmeUNvbnRlbnQiLCJkZXNjIiwibGluZUhlaWdodCIsInZlcnRpY2FsQWxpZ24iLCJoMSIsIm1hcmdpbiIsIm1hcmdpblJpZ2h0IiwicGFkZGluZyIsImZvbnRTaXplIiwiZm9udFdlaWdodCIsImgyIiwiX0NvbXBvbmVudCIsIkVycm9yIiwicmVuZGVyIiwicHJvcHMiLCJ3aXRoRGFya01vZGUiLCJ0aXRsZSIsImNyZWF0ZUVsZW1lbnQiLCJzdHlsZSIsImRhbmdlcm91c2x5U2V0SW5uZXJIVE1MIiwiX19odG1sIiwiY2xhc3NOYW1lIiwiRnJhZ21lbnQiLCJDb21wb25lbnQiLCJkaXNwbGF5TmFtZSIsImdldEluaXRpYWxQcm9wcyIsIm9yaWdHZXRJbml0aWFsUHJvcHMiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/pages/_error.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/amp-context.js": /*!**********************************************************!*\ !*** ./node_modules/next/dist/shared/lib/amp-context.js ***! \**********************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.AmpStateContext = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar AmpStateContext = _react.default.createContext({});\nexports.AmpStateContext = AmpStateContext;\nif (true) {\n AmpStateContext.displayName = \"AmpStateContext\";\n} //# sourceMappingURL=amp-context.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvYW1wLWNvbnRleHQuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCx1QkFBdUIsR0FBRyxLQUFLLENBQUMsQ0FBQztBQUNqQyxJQUFJRyx3QkFBd0IsR0FBR0MsbUpBQStEO0FBQzlGLElBQUlFLE1BQU0sR0FBR0gsd0JBQXdCLENBQUNDLG1CQUFPLENBQUMsNENBQU8sQ0FBQyxDQUFDO0FBQ3ZELElBQU1GLGVBQWUsR0FBR0ksTUFBTSxDQUFDRCxPQUFPLENBQUNFLGFBQWEsQ0FBQyxFQUFFLENBQUM7QUFDeERQLHVCQUF1QixHQUFHRSxlQUFlLENBQUM7QUFDMUMsSUFBSU0sSUFBcUMsRUFBRTtJQUN2Q04sZUFBZSxDQUFDTyxXQUFXLEdBQUcsaUJBQWlCLENBQUM7QUFDcEQsQ0FBQyxDQUVELHVDQUF1QyIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvYW1wLWNvbnRleHQuanM/ZTVhNyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuQW1wU3RhdGVDb250ZXh0ID0gdm9pZCAwO1xudmFyIF9pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdCA9IHJlcXVpcmUoXCJAc3djL2hlbHBlcnMvbGliL19pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdC5qc1wiKS5kZWZhdWx0O1xudmFyIF9yZWFjdCA9IF9pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdChyZXF1aXJlKFwicmVhY3RcIikpO1xuY29uc3QgQW1wU3RhdGVDb250ZXh0ID0gX3JlYWN0LmRlZmF1bHQuY3JlYXRlQ29udGV4dCh7fSk7XG5leHBvcnRzLkFtcFN0YXRlQ29udGV4dCA9IEFtcFN0YXRlQ29udGV4dDtcbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgQW1wU3RhdGVDb250ZXh0LmRpc3BsYXlOYW1lID0gJ0FtcFN0YXRlQ29udGV4dCc7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWFtcC1jb250ZXh0LmpzLm1hcCJdLCJuYW1lcyI6WyJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsIkFtcFN0YXRlQ29udGV4dCIsIl9pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdCIsInJlcXVpcmUiLCJkZWZhdWx0IiwiX3JlYWN0IiwiY3JlYXRlQ29udGV4dCIsInByb2Nlc3MiLCJkaXNwbGF5TmFtZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/amp-context.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/amp-mode.js": /*!*******************************************************!*\ !*** ./node_modules/next/dist/shared/lib/amp-mode.js ***! \*******************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.isInAmpMode = isInAmpMode;\nfunction isInAmpMode() {\n var ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ampFirst = ref.ampFirst, ampFirst = _ampFirst === void 0 ? false : _ampFirst, _hybrid = ref.hybrid, hybrid = _hybrid === void 0 ? false : _hybrid, _hasQuery = ref.hasQuery, hasQuery = _hasQuery === void 0 ? false : _hasQuery;\n return ampFirst || hybrid && hasQuery;\n} //# sourceMappingURL=amp-mode.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvYW1wLW1vZGUuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxtQkFBbUIsR0FBR0UsV0FBVyxDQUFDO0FBQ2xDLFNBQVNBLFdBQVcsR0FBZ0U7UUFBL0QsR0FBNkQsR0FBN0QsK0NBQTZELGtCQUFGLEVBQUUsY0FBN0QsR0FBNkQsQ0FBM0RDLFFBQVEsRUFBUkEsUUFBUSwwQkFBRSxLQUFLLHdCQUFqQixHQUE2RCxDQUF6Q0MsTUFBTSxFQUFOQSxNQUFNLHdCQUFFLEtBQUssd0JBQWpDLEdBQTZELENBQXpCQyxRQUFRLEVBQVJBLFFBQVEsMEJBQUUsS0FBSztJQUNwRSxPQUFPRixRQUFRLElBQUlDLE1BQU0sSUFBSUMsUUFBUSxDQUFDO0FBQzFDLENBQUMsQ0FFRCxvQ0FBb0MiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9zaGFyZWQvbGliL2FtcC1tb2RlLmpzPzYyMzEiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgICB2YWx1ZTogdHJ1ZVxufSk7XG5leHBvcnRzLmlzSW5BbXBNb2RlID0gaXNJbkFtcE1vZGU7XG5mdW5jdGlvbiBpc0luQW1wTW9kZSh7IGFtcEZpcnN0ID1mYWxzZSAsIGh5YnJpZCA9ZmFsc2UgLCBoYXNRdWVyeSA9ZmFsc2UgLCAgfSA9IHt9KSB7XG4gICAgcmV0dXJuIGFtcEZpcnN0IHx8IGh5YnJpZCAmJiBoYXNRdWVyeTtcbn1cblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9YW1wLW1vZGUuanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiaXNJbkFtcE1vZGUiLCJhbXBGaXJzdCIsImh5YnJpZCIsImhhc1F1ZXJ5Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/amp-mode.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/escape-regexp.js": /*!************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/escape-regexp.js ***! \************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.escapeStringRegexp = escapeStringRegexp;\n// regexp is based on https://github.com/sindresorhus/escape-string-regexp\nvar reHasRegExp = /[|\\\\{}()[\\]^$+*?.-]/;\nvar reReplaceRegExp = /[|\\\\{}()[\\]^$+*?.-]/g;\nfunction escapeStringRegexp(str) {\n // see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23\n if (reHasRegExp.test(str)) {\n return str.replace(reReplaceRegExp, \"\\\\$&\");\n }\n return str;\n} //# sourceMappingURL=escape-regexp.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ey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nRXhwID0gL1t8XFxcXHt9KClbXFxdXiQrKj8uLV0vO1xuY29uc3QgcmVSZXBsYWNlUmVnRXhwID0gL1t8XFxcXHt9KClbXFxdXiQrKj8uLV0vZztcbmZ1bmN0aW9uIGVzY2FwZVN0cmluZ1JlZ2V4cChzdHIpIHtcbiAgICAvLyBzZWUgYWxzbzogaHR0cHM6Ly9naXRodWIuY29tL2xvZGFzaC9sb2Rhc2gvYmxvYi8yZGEwMjRjM2I0Zjk5NDdhNDg1MTc2MzlkZTc1NjA0NTdjZDRlYzZjL2VzY2FwZVJlZ0V4cC5qcyNMMjNcbiAgICBpZiAocmVIYXNSZWdFeHAudGVzdChzdHIpKSB7XG4gICAgICAgIHJldHVybiBzdHIucmVwbGFjZShyZVJlcGxhY2VSZWdFeHAsICdcXFxcJCYnKTtcbiAgICB9XG4gICAgcmV0dXJuIHN0cjtcbn1cblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9ZXNjYXBlLXJlZ2V4cC5qcy5tYXAiXSwibmFtZXMiOlsiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJleHBvcnRzIiwidmFsdWUiLCJlc2NhcGVTdHJpbmdSZWdleHAiLCJyZUhhc1JlZ0V4cCIsInJlUmVwbGFjZVJlZ0V4cCIsInN0ciIsInRlc3QiLCJyZXBsYWNlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/escape-regexp.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/head-manager-context.js": /*!*******************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/head-manager-context.js ***! \*******************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.HeadManagerContext = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar HeadManagerContext = _react.default.createContext({});\nexports.HeadManagerContext = HeadManagerContext;\nif (true) {\n HeadManagerContext.displayName = \"HeadManagerContext\";\n} //# sourceMappingURL=head-manager-context.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvaGVhZC1tYW5hZ2VyLWNvbnRleHQuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCwwQkFBMEIsR0FBRyxLQUFLLENBQUMsQ0FBQztBQUNwQyxJQUFJRyx3QkFBd0IsR0FBR0MsbUpBQStEO0FBQzlGLElBQUlFLE1BQU0sR0FBR0gsd0JBQXdCLENBQUNDLG1CQUFPLENBQUMsNENBQU8sQ0FBQyxDQUFDO0FBQ3ZELElBQU1GLGtCQUFrQixHQUFHSSxNQUFNLENBQUNELE9BQU8sQ0FBQ0UsYUFBYSxDQUFDLEVBQUUsQ0FBQztBQUMzRFAsMEJBQTBCLEdBQUdFLGtCQUFrQixDQUFDO0FBQ2hELElBQUlNLElBQXFDLEVBQUU7SUFDdkNOLGtCQUFrQixDQUFDTyxXQUFXLEdBQUcsb0JBQW9CLENBQUM7QUFDMUQsQ0FBQyxDQUVELGdEQUFnRCIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvaGVhZC1tYW5hZ2VyLWNvbnRleHQuanM/NzZlYiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuSGVhZE1hbmFnZXJDb250ZXh0ID0gdm9pZCAwO1xudmFyIF9pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdCA9IHJlcXVpcmUoXCJAc3djL2hlbHBlcnMvbGliL19pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdC5qc1wiKS5kZWZhdWx0O1xudmFyIF9yZWFjdCA9IF9pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdChyZXF1aXJlKFwicmVhY3RcIikpO1xuY29uc3QgSGVhZE1hbmFnZXJDb250ZXh0ID0gX3JlYWN0LmRlZmF1bHQuY3JlYXRlQ29udGV4dCh7fSk7XG5leHBvcnRzLkhlYWRNYW5hZ2VyQ29udGV4dCA9IEhlYWRNYW5hZ2VyQ29udGV4dDtcbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgSGVhZE1hbmFnZXJDb250ZXh0LmRpc3BsYXlOYW1lID0gJ0hlYWRNYW5hZ2VyQ29udGV4dCc7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWhlYWQtbWFuYWdlci1jb250ZXh0LmpzLm1hcCJdLCJuYW1lcyI6WyJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsIkhlYWRNYW5hZ2VyQ29udGV4dCIsIl9pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdCIsInJlcXVpcmUiLCJkZWZhdWx0IiwiX3JlYWN0IiwiY3JlYXRlQ29udGV4dCIsInByb2Nlc3MiLCJkaXNwbGF5TmFtZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/head-manager-context.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/head.js": /*!***************************************************!*\ !*** ./node_modules/next/dist/shared/lib/head.js ***! \***************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nvar _s = $RefreshSig$();\n\"client\";\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.defaultHead = defaultHead;\nexports[\"default\"] = void 0;\nvar _extends = (__webpack_require__(/*! @swc/helpers/lib/_extends.js */ \"./node_modules/@swc/helpers/lib/_extends.js\")[\"default\"]);\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _interop_require_wildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ \"./node_modules/@swc/helpers/lib/_interop_require_wildcard.js\")[\"default\"]);\nvar _react = _interop_require_wildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _sideEffect = _interop_require_default(__webpack_require__(/*! ./side-effect */ \"./node_modules/next/dist/shared/lib/side-effect.js\"));\nvar _ampContext = __webpack_require__(/*! ./amp-context */ \"./node_modules/next/dist/shared/lib/amp-context.js\");\nvar _headManagerContext = __webpack_require__(/*! ./head-manager-context */ \"./node_modules/next/dist/shared/lib/head-manager-context.js\");\nvar _ampMode = __webpack_require__(/*! ./amp-mode */ \"./node_modules/next/dist/shared/lib/amp-mode.js\");\nvar _utils = __webpack_require__(/*! ./utils */ \"./node_modules/next/dist/shared/lib/utils.js\");\n\"client\";\nfunction defaultHead() {\n var inAmpMode = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;\n var head = [\n /*#__PURE__*/ _react.default.createElement(\"meta\", {\n charSet: \"utf-8\"\n })\n ];\n if (!inAmpMode) {\n head.push(/*#__PURE__*/ _react.default.createElement(\"meta\", {\n name: \"viewport\",\n content: \"width=device-width\"\n }));\n }\n return head;\n}\nfunction onlyReactElement(list, child) {\n // React children can be \"string\" or \"number\" in this case we ignore them for backwards compat\n if (typeof child === \"string\" || typeof child === \"number\") {\n return list;\n }\n // Adds support for React.Fragment\n if (child.type === _react.default.Fragment) {\n return list.concat(_react.default.Children.toArray(child.props.children).reduce(function(fragmentList, fragmentChild) {\n if (typeof fragmentChild === \"string\" || typeof fragmentChild === \"number\") {\n return fragmentList;\n }\n return fragmentList.concat(fragmentChild);\n }, []));\n }\n return list.concat(child);\n}\nvar METATYPES = [\n \"name\",\n \"httpEquiv\",\n \"charSet\",\n \"itemProp\"\n];\n/*\n returns a function for filtering head child elements\n which shouldn't be duplicated, like \n Also adds support for deduplicated `key` properties\n*/ function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function(h) {\n var isUnique = true;\n var hasKey = false;\n if (h.key && typeof h.key !== \"number\" && h.key.indexOf(\"$\") > 0) {\n hasKey = true;\n var key = h.key.slice(h.key.indexOf(\"$\") + 1);\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n }\n // eslint-disable-next-line default-case\n switch(h.type){\n case \"title\":\n case \"base\":\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n break;\n case \"meta\":\n for(var i = 0, len = METATYPES.length; i < len; i++){\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n if (metatype === \"charSet\") {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n if ((metatype !== \"name\" || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n break;\n }\n return isUnique;\n };\n}\n/**\n *\n * @param headChildrenElements List of children of <Head>\n */ function reduceComponents(headChildrenElements, props) {\n var inAmpMode = props.inAmpMode;\n return headChildrenElements.reduce(onlyReactElement, []).reverse().concat(defaultHead(inAmpMode).reverse()).filter(unique()).reverse().map(function(c, i) {\n var key = c.key || i;\n if (false) { var newProps; }\n if (true) {\n // omit JSON-LD structured data snippets from the warning\n if (c.type === \"script\" && c.props[\"type\"] !== \"application/ld+json\") {\n var srcMessage = c.props[\"src\"] ? '<script> tag with src=\"'.concat(c.props[\"src\"], '\"') : \"inline <script>\";\n (0, _utils).warnOnce(\"Do not add <script> tags using next/head (see \".concat(srcMessage, \"). Use next/script instead. \\nSee more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component\"));\n } else if (c.type === \"link\" && c.props[\"rel\"] === \"stylesheet\") {\n (0, _utils).warnOnce('Do not add stylesheets using next/head (see <link rel=\"stylesheet\"> tag with href=\"'.concat(c.props[\"href\"], '\"). Use Document instead. \\nSee more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component'));\n }\n }\n return /*#__PURE__*/ _react.default.cloneElement(c, {\n key: key\n });\n });\n}\n/**\n * This component injects elements to `<head>` of your page.\n * To avoid duplicated `tags` in `<head>` you can use the `key` property, which will make sure every tag is only rendered once.\n */ function Head(param) {\n var children = param.children;\n _s();\n var ampState = (0, _react).useContext(_ampContext.AmpStateContext);\n var headManager = (0, _react).useContext(_headManagerContext.HeadManagerContext);\n return /*#__PURE__*/ _react.default.createElement(_sideEffect.default, {\n reduceComponentsToState: reduceComponents,\n headManager: headManager,\n inAmpMode: (0, _ampMode).isInAmpMode(ampState)\n }, children);\n}\n_s(Head, \"sCUayZmr5V93tUjujy03KdMBCec=\");\n_c = Head;\nvar _default = Head;\nexports[\"default\"] = _default;\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=head.js.map\nvar _c;\n$RefreshReg$(_c, \"Head\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvaGVhZC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFDYTs7QUFEYixRQUFRLENBQUM7QUFFVEEsOENBQTZDO0lBQ3pD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BTZXQoKTtcbiAgICBjb25zdCBtZXRhQ2F0ZWdvcmllcyA9IHt9O1xuICAgIHJldHVybiAoaCk9PntcbiAgICAgICAgbGV0IGlzVW5pcXVlID0gdHJ1ZTtcbiAgICAgICAgbGV0IGhhc0tleSA9IGZhbHNlO1xuICAgICAgICBpZiAoaC5rZXkgJiYgdHlwZW9mIGgua2V5ICE9PSAnbnVtYmVyJyAmJiBoLmtleS5pbmRleE9mKCckJykgPiAwKSB7XG4gICAgICAgICAgICBoYXNLZXkgPSB0cnVlO1xuICAgICAgICAgICAgY29uc3Qga2V5ID0gaC5rZXkuc2xpY2UoaC5rZXkuaW5kZXhPZignJCcpICsgMSk7XG4gICAgICAgICAgICBpZiAoa2V5cy5oYXMoa2V5KSkge1xuICAgICAgICAgICAgICAgIGlzVW5pcXVlID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGtleXMuYWRkKGtleSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGRlZmF1bHQtY2FzZVxuICAgICAgICBzd2l0Y2goaC50eXBlKXtcbiAgICAgICAgICAgIGNhc2UgJ3RpdGxlJzpcbiAgICAgICAgICAgIGNhc2UgJ2Jhc2UnOlxuICAgICAgICAgICAgICAgIGlmICh0YWdzLmhhcyhoLnR5cGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlzVW5pcXVlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGFncy5hZGQoaC50eXBlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdtZXRhJzpcbiAgICAgICAgICAgICAgICBmb3IobGV0IGkgPSAwLCBsZW4gPSBNRVRBVFlQRVMubGVuZ3RoOyBpIDwgbGVuOyBpKyspe1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBtZXRhdHlwZSA9IE1FVEFUWVBFU1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFoLnByb3BzLmhhc093blByb3BlcnR5KG1ldGF0eXBlKSkgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXRhdHlwZSA9PT0gJ2NoYXJTZXQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWV0YVR5cGVzLmhhcyhtZXRhdHlwZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1VuaXF1ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRhVHlwZXMuYWRkKG1ldGF0eXBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNhdGVnb3J5ID0gaC5wcm9wc1ttZXRhdHlwZV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjYXRlZ29yaWVzID0gbWV0YUNhdGVnb3JpZXNbbWV0YXR5cGVdIHx8IG5ldyBTZXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobWV0YXR5cGUgIT09ICduYW1lJyB8fCAhaGFzS2V5KSAmJiBjYXRlZ29yaWVzLmhhcyhjYXRlZ29yeSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1VuaXF1ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLmFkZChjYXRlZ29yeSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0YUNhdGVnb3JpZXNbbWV0YXR5cGVdID0gY2F0ZWdvcmllcztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1c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iLCJyZXZlcnNlIiwiZmlsdGVyIiwibWFwIiwiYyIsInByb2Nlc3MiLCJlbnYiLCJfX05FWFRfT1BUSU1JWkVfRk9OVFMiLCJzb21lIiwidXJsIiwic3RhcnRzV2l0aCIsIm5ld1Byb3BzIiwidW5kZWZpbmVkIiwiY2xvbmVFbGVtZW50IiwiX19ORVhUX1JFQUNUX1JPT1QiLCJzcmNNZXNzYWdlIiwid2Fybk9uY2UiLCJIZWFkIiwiYW1wU3RhdGUiLCJ1c2VDb250ZXh0IiwiQW1wU3RhdGVDb250ZXh0IiwiaGVhZE1hbmFnZXIiLCJIZWFkTWFuYWdlckNvbnRleHQiLCJyZWR1Y2VDb21wb25lbnRzVG9TdGF0ZSIsImlzSW5BbXBNb2RlIiwiX2RlZmF1bHQiLCJfX2VzTW9kdWxlIiwiYXNzaWduIiwibW9kdWxlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/head.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js": /*!*************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js ***! \*************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.normalizeLocalePath = normalizeLocalePath;\nfunction normalizeLocalePath(pathname, locales) {\n var detectedLocale;\n // first item will be empty string from splitting at first char\n var pathnameParts = pathname.split(\"/\");\n (locales || []).some(function(locale) {\n if (pathnameParts[1] && pathnameParts[1].toLowerCase() === locale.toLowerCase()) {\n detectedLocale = locale;\n pathnameParts.splice(1, 1);\n pathname = pathnameParts.join(\"/\") || \"/\";\n return true;\n }\n return false;\n });\n return {\n pathname: pathname,\n detectedLocale: detectedLocale\n };\n} //# sourceMappingURL=normalize-locale-path.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9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lY3RlZExvY2FsZVxuICAgIH07XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPW5vcm1hbGl6ZS1sb2NhbGUtcGF0aC5qcy5tYXAiXSwibmFtZXMiOlsiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJleHBvcnRzIiwidmFsdWUiLCJub3JtYWxpemVMb2NhbGVQYXRoIiwicGF0aG5hbWUiLCJsb2NhbGVzIiwiZGV0ZWN0ZWRMb2NhbGUiLCJwYXRobmFtZVBhcnRzIiwic3BsaXQiLCJzb21lIiwibG9jYWxlIiwidG9Mb3dlckNhc2UiLCJzcGxpY2UiLCJqb2luIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/image-config-context.js": /*!*******************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/image-config-context.js ***! \*******************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.ImageConfigContext = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar _imageConfig = __webpack_require__(/*! ./image-config */ \"./node_modules/next/dist/shared/lib/image-config.js\");\nvar ImageConfigContext = _react.default.createContext(_imageConfig.imageConfigDefault);\nexports.ImageConfigContext = ImageConfigContext;\nif (true) {\n ImageConfigContext.displayName = \"ImageConfigContext\";\n} //# sourceMappingURL=image-config-context.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvaW1hZ2UtY29uZmlnLWNvbnRleHQuanMuanMiLC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F9pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdChyZXF1aXJlKFwicmVhY3RcIikpO1xudmFyIF9pbWFnZUNvbmZpZyA9IHJlcXVpcmUoXCIuL2ltYWdlLWNvbmZpZ1wiKTtcbmNvbnN0IEltYWdlQ29uZmlnQ29udGV4dCA9IF9yZWFjdC5kZWZhdWx0LmNyZWF0ZUNvbnRleHQoX2ltYWdlQ29uZmlnLmltYWdlQ29uZmlnRGVmYXVsdCk7XG5leHBvcnRzLkltYWdlQ29uZmlnQ29udGV4dCA9IEltYWdlQ29uZmlnQ29udGV4dDtcbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgSW1hZ2VDb25maWdDb250ZXh0LmRpc3BsYXlOYW1lID0gJ0ltYWdlQ29uZmlnQ29udGV4dCc7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWltYWdlLWNvbmZpZy1jb250ZXh0LmpzLm1hcCJdLCJuYW1lcyI6WyJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsIkltYWdlQ29uZmlnQ29udGV4dCIsIl9pbnRlcm9wX3JlcXVpcmVfZGVmYXVsdCIsInJlcXVpcmUiLCJkZWZhdWx0IiwiX3JlYWN0IiwiX2ltYWdlQ29uZmlnIiwiY3JlYXRlQ29udGV4dCIsImltYWdlQ29uZmlnRGVmYXVsdCIsInByb2Nlc3MiLCJkaXNwbGF5TmFtZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/image-config-context.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/image-config.js": /*!***********************************************************!*\ !*** ./node_modules/next/dist/shared/lib/image-config.js ***! \***********************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.imageConfigDefault = exports.VALID_LOADERS = void 0;\nvar VALID_LOADERS = [\n \"default\",\n \"imgix\",\n \"cloudinary\",\n \"akamai\",\n \"custom\", \n];\nexports.VALID_LOADERS = VALID_LOADERS;\nvar imageConfigDefault = {\n deviceSizes: [\n 640,\n 750,\n 828,\n 1080,\n 1200,\n 1920,\n 2048,\n 3840\n ],\n imageSizes: [\n 16,\n 32,\n 48,\n 64,\n 96,\n 128,\n 256,\n 384\n ],\n path: \"/_next/image\",\n loader: \"default\",\n domains: [],\n disableStaticImages: false,\n minimumCacheTTL: 60,\n formats: [\n \"image/webp\"\n ],\n dangerouslyAllowSVG: false,\n contentSecurityPolicy: \"script-src 'none'; frame-src 'none'; sandbox;\",\n remotePatterns: [],\n unoptimized: false\n};\nexports.imageConfigDefault = imageConfigDefault; //# sourceMappingURL=image-config.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvaW1hZ2UtY29uZmlnLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsMEJBQTBCLEdBQUdBLHFCQUFxQixHQUFHLEtBQUssQ0FBQyxDQUFDO0FBQzVELElBQU1HLGFBQWEsR0FBRztJQUNsQixTQUFTO0lBQ1QsT0FBTztJQUNQLFlBQVk7SUFDWixRQUFRO0lBQ1IsUUFBUTtDQUNYO0FBQ0RILHFCQUFxQixHQUFHRyxhQUFhLENBQUM7QUFDdEMsSUFBTUQsa0JBQWtCLEdBQUc7SUFDdkJFLFdBQVcsRUFBRTtBQUNULFdBQUc7QUFDSCxXQUFHO0FBQ0gsV0FBRztBQUNILFlBQUk7QUFDSixZQUFJO0FBQ0osWUFBSTtBQUNKLFlBQUk7QUFDSixZQUFJO0tBQ1A7SUFDREMsVUFBVSxFQUFFO0FBQ1IsVU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wYXRoIiwibG9hZGVyIiwiZG9tYWlucyIsImRpc2FibGVTdGF0aWNJbWFnZXMiLCJtaW5pbXVtQ2FjaGVUVEwiLCJmb3JtYXRzIiwiZGFuZ2Vyb3VzbHlBbGxvd1NWRyIsImNvbnRlbnRTZWN1cml0eVBvbGljeSIsInJlbW90ZVBhdHRlcm5zIiwidW5vcHRpbWl6ZWQiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/image-config.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/is-plain-object.js": /*!**************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/is-plain-object.js ***! \**************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getObjectClassLabel = getObjectClassLabel;\nexports.isPlainObject = isPlainObject;\nfunction getObjectClassLabel(value) {\n return Object.prototype.toString.call(value);\n}\nfunction isPlainObject(value) {\n if (getObjectClassLabel(value) !== \"[object Object]\") {\n return false;\n }\n var prototype = Object.getPrototypeOf(value);\n /**\n * this used to be previously:\n *\n * `return prototype === null || prototype === Object.prototype`\n *\n * but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.\n *\n * It was changed to the current implementation since it's resilient to serialization.\n */ return prototype === null || prototype.hasOwnProperty(\"isPrototypeOf\");\n} //# sourceMappingURL=is-plain-object.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvaXMtcGxhaW4tb2JqZWN0LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsMkJBQTJCLEdBQUdFLG1CQUFtQixDQUFDO0FBQ2xERixxQkFBcUIsR0FBR0csYU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/shared/lib/is-plain-object.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/mitt.js": /*!***************************************************!*\ !*** ./node_modules/next/dist/shared/lib/mitt.js ***! \***************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _toConsumableArray = (__webpack_require__(/*! @swc/helpers/lib/_to_consumable_array.js */ \"./node_modules/@swc/helpers/lib/_to_consumable_array.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = mitt;\nfunction mitt() {\n var all = Object.create(null);\n return {\n on: function on(type, handler) {\n (all[type] || (all[type] = [])).push(handler);\n },\n off: function off(type, handler) {\n if (all[type]) {\n all[type].splice(all[type].indexOf(handler) >>> 0, 1);\n }\n },\n emit: function emit(type) {\n for(var _len = arguments.length, evts = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){\n evts[_key - 1] = arguments[_key];\n }\n (all[type] || []).slice().map(function(handler) {\n handler.apply(void 0, _toConsumableArray(evts));\n });\n }\n };\n} //# sourceMappingURL=mitt.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvbWl0dC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTs7Ozs7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxrQkFBZSxHQUFHRyxJQUFJLENBQUM7QUFDdkIsU0FBU0EsSUFBSSxHQUFHO0lBQ1osSUFBTUMsR0FBRyxHQUFHTixNQUFNLENBQUNPLE1BQU0sQ0FBQyxJQUFJLENBQUM7SUFDL0IsT0FBTztRQUNIQyxFQUFFLEVBQUZBLFNBQUFBLEVBQUUsQ0FBRUMsSUFBSSxFQUFFQyxPQUFPLEVBQ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b3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiZGVmYXVsdCIsIm1pdHQiLCJhbGwiLCJjcmVhdGUiLCJvbiIsInR5cGUiLCJoYW5kbGVyIiwicHVzaCIsIm9mZiIsInNwbGljZSIsImluZGV4T2YiLCJlbWl0IiwiZXZ0cyIsInNsaWNlIiwibWFwIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/mitt.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js": /*!******************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js ***! \******************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.denormalizePagePath = denormalizePagePath;\nvar _utils = __webpack_require__(/*! ../router/utils */ \"./node_modules/next/dist/shared/lib/router/utils/index.js\");\nvar _normalizePathSep = __webpack_require__(/*! ./normalize-path-sep */ \"./node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js\");\nfunction denormalizePagePath(page) {\n var _page = (0, _normalizePathSep).normalizePathSep(page);\n return _page.startsWith(\"/index/\") && !(0, _utils).isDynamicRoute(_page) ? _page.slice(6) : _page !== \"/index\" ? _page : \"/\";\n} //# sourceMappingURL=denormalize-page-path.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcGFnZS1wYXRoL2Rlbm9ybWFsaXplLXBhZ2UtcGF0aC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELDJCQUEyQixHQUFHRSxtQkFBbUIsQ0FBQztBQUNsRCxJQUFJQyxNQUFNLEdBQUdDLG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AgbGV0IF9wYWdlID0gKDAsIF9ub3JtYWxpemVQYXRoU2VwKS5ub3JtYWxpemVQYXRoU2VwKHBhZ2UpO1xuICAgIHJldHVybiBfcGFnZS5zdGFydHNXaXRoKCcvaW5kZXgvJykgJiYgISgwLCBfdXRpbHMpLmlzRHluYW1pY1JvdXRlKF9wYWdlKSA/IF9wYWdlLnNsaWNlKDYpIDogX3BhZ2UgIT09ICcvaW5kZXgnID8gX3BhZ2UgOiAnLyc7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWRlbm9ybWFsaXplLXBhZ2UtcGF0aC5qcy5tYXAiXSwibmFtZXMiOlsiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJleHBvcnRzIiwidmFsdWUiLCJkZW5vcm1hbGl6ZVBhZ2VQYXRoIiwiX3V0aWxzIiwicmVxdWlyZSIsIl9ub3JtYWxpemVQYXRoU2VwIiwicGFnZSIsIl9wYWdlIiwibm9ybWFsaXplUGF0aFNlcCIsInN0YXJ0c1dpdGgiLCJpc0R5bmFtaWNSb3V0ZSIsInNsaWNlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js": /*!***************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js ***! \***************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.normalizePathSep = normalizePathSep;\nfunction normalizePathSep(path) {\n return path.replace(/\\\\/g, \"/\");\n} //# sourceMappingURL=normalize-path-sep.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcGFnZS1wYXRoL25vcm1hbGl6ZS1wYXRoLXNlcC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELHdCQUF3QixHQUFHRSxnQkFBZ0IsQ0FBQztBQUM1QyxTQUFTQSxnQkFBZ0IsQ0FBQ0MsSUFBSSxFQUFFO0lBQzVCLE9BQU9BLElBQUksQ0FBQ0MsT0FBTyxRQUFRLEdBQUcsQ0FBQyxDQUFDO0FBQ3BDLENBQUMsQ0FFRCw4Q0FBOEMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9zaGFyZWQvbGliL3BhZ2UtcGF0aC9ub3JtYWxpemUtcGF0aC1zZXAuanM/YmFiOCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMubm9ybWFsaXplUGF0aFNlcCA9IG5vcm1hbGl6ZVBhdGhTZXA7XG5mdW5jdGlvbiBub3JtYWxpemVQYXRoU2VwKHBhdGgpIHtcbiAgICByZXR1cm4gcGF0aC5yZXBsYWNlKC9cXFxcL2csICcvJyk7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPW5vcm1hbGl6ZS1wYXRoLXNlcC5qcy5tYXAiXSwibmFtZXMiOlsiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJleHBvcnRzIiwidmFsdWUiLCJub3JtYWxpemVQYXRoU2VwIiwicGF0aCIsInJlcGxhY2UiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router-context.js": /*!*************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router-context.js ***! \*************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.RouterContext = void 0;\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _react = _interop_require_default(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar RouterContext = _react.default.createContext(null);\nexports.RouterContext = RouterContext;\nif (true) {\n RouterContext.displayName = \"RouterContext\";\n} //# sourceMappingURL=router-context.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyLWNvbnRleHQuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxxQkFBcUIsR0FBRyxLQUFLLENBQUMsQ0FBQztBQUMvQixJQUFJRyx3QkFBd0IsR0FBR0MsbUpBQStEO0FBQzlGLElBQUlFLE1BQU0sR0FBR0gsd0JBQXdCLENBQUNDLG1CQUFPLENBQUMsNENBQU8sQ0FBQyxDQUFDO0FBQ3ZELElBQU1GLGFBQWEsR0FBR0ksTUFBTSxDQUFDRCxPQUFPLENBQUNFLGFBQWEsQ0FBQyxJQUFJLENBQUM7QUFDeERQLHFCQUFxQixHQUFHRSxhQUFhLENBQUM7QUFDdEMsSUFBSU0sSUFBcUMsRUFBRTtJQUN2Q04sYUFBYSxDQUFDTyxXQUFXLEdBQUcsZUFBZSxDQUFDO0FBQ2hELENBQUMsQ0FFRCwwQ0FBMEMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9za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***/ "./node_modules/next/dist/shared/lib/router/router.js": /*!************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/router.js ***! \************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _classCallCheck = (__webpack_require__(/*! @swc/helpers/lib/_class_call_check.js */ \"./node_modules/@swc/helpers/lib/_class_call_check.js\")[\"default\"]);\nvar _createClass = (__webpack_require__(/*! @swc/helpers/lib/_create_class.js */ \"./node_modules/@swc/helpers/lib/_create_class.js\")[\"default\"]);\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nvar _tsGenerator = (__webpack_require__(/*! @swc/helpers/lib/_ts_generator.js */ \"./node_modules/@swc/helpers/lib/_ts_generator.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.matchesMiddleware = matchesMiddleware;\nexports.isLocalURL = isLocalURL;\nexports.interpolateAs = interpolateAs;\nexports.resolveHref = resolveHref;\nexports.createKey = createKey;\nexports[\"default\"] = void 0;\nvar _async_to_generator = (__webpack_require__(/*! @swc/helpers/lib/_async_to_generator.js */ \"./node_modules/@swc/helpers/lib/_async_to_generator.js\")[\"default\"]);\nvar _extends = (__webpack_require__(/*! @swc/helpers/lib/_extends.js */ \"./node_modules/@swc/helpers/lib/_extends.js\")[\"default\"]);\nvar _interop_require_default = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_default.js */ \"./node_modules/@swc/helpers/lib/_interop_require_default.js\")[\"default\"]);\nvar _interop_require_wildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ \"./node_modules/@swc/helpers/lib/_interop_require_wildcard.js\")[\"default\"]);\nvar _normalizeTrailingSlash = __webpack_require__(/*! ../../../client/normalize-trailing-slash */ \"./node_modules/next/dist/client/normalize-trailing-slash.js\");\nvar _removeTrailingSlash = __webpack_require__(/*! ./utils/remove-trailing-slash */ \"./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js\");\nvar _routeLoader = __webpack_require__(/*! ../../../client/route-loader */ \"./node_modules/next/dist/client/route-loader.js\");\nvar _script = __webpack_require__(/*! ../../../client/script */ \"./node_modules/next/dist/client/script.js\");\nvar _isError = _interop_require_wildcard(__webpack_require__(/*! ../../../lib/is-error */ \"./node_modules/next/dist/lib/is-error.js\"));\nvar _denormalizePagePath = __webpack_require__(/*! ../page-path/denormalize-page-path */ \"./node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js\");\nvar _normalizeLocalePath = __webpack_require__(/*! ../i18n/normalize-locale-path */ \"./node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js\");\nvar _mitt = _interop_require_default(__webpack_require__(/*! ../mitt */ \"./node_modules/next/dist/shared/lib/mitt.js\"));\nvar _utils = __webpack_require__(/*! ../utils */ \"./node_modules/next/dist/shared/lib/utils.js\");\nvar _isDynamic = __webpack_require__(/*! ./utils/is-dynamic */ \"./node_modules/next/dist/shared/lib/router/utils/is-dynamic.js\");\nvar _parseRelativeUrl = __webpack_require__(/*! ./utils/parse-relative-url */ \"./node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js\");\nvar _querystring = __webpack_require__(/*! ./utils/querystring */ \"./node_modules/next/dist/shared/lib/router/utils/querystring.js\");\nvar _resolveRewrites = _interop_require_default(__webpack_require__(/*! ./utils/resolve-rewrites */ \"?506d\"));\nvar _routeMatcher = __webpack_require__(/*! ./utils/route-matcher */ \"./node_modules/next/dist/shared/lib/router/utils/route-matcher.js\");\nvar _routeRegex = __webpack_require__(/*! ./utils/route-regex */ \"./node_modules/next/dist/shared/lib/router/utils/route-regex.js\");\nvar _formatUrl = __webpack_require__(/*! ./utils/format-url */ \"./node_modules/next/dist/shared/lib/router/utils/format-url.js\");\nvar _detectDomainLocale = __webpack_require__(/*! ../../../client/detect-domain-locale */ \"./node_modules/next/dist/client/detect-domain-locale.js\");\nvar _parsePath = __webpack_require__(/*! ./utils/parse-path */ \"./node_modules/next/dist/shared/lib/router/utils/parse-path.js\");\nvar _addLocale = __webpack_require__(/*! ../../../client/add-locale */ \"./node_modules/next/dist/client/add-locale.js\");\nvar _removeLocale = __webpack_require__(/*! ../../../client/remove-locale */ \"./node_modules/next/dist/client/remove-locale.js\");\nvar _removeBasePath = __webpack_require__(/*! ../../../client/remove-base-path */ \"./node_modules/next/dist/client/remove-base-path.js\");\nvar _addBasePath = __webpack_require__(/*! ../../../client/add-base-path */ \"./node_modules/next/dist/client/add-base-path.js\");\nvar _hasBasePath = __webpack_require__(/*! ../../../client/has-base-path */ \"./node_modules/next/dist/client/has-base-path.js\");\nvar _getNextPathnameInfo = __webpack_require__(/*! ./utils/get-next-pathname-info */ \"./node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js\");\nvar _formatNextPathnameInfo = __webpack_require__(/*! ./utils/format-next-pathname-info */ \"./node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js\");\nvar _compareStates = __webpack_require__(/*! ./utils/compare-states */ \"./node_modules/next/dist/shared/lib/router/utils/compare-states.js\");\nvar _isBot = __webpack_require__(/*! ./utils/is-bot */ \"./node_modules/next/dist/shared/lib/router/utils/is-bot.js\");\nfunction buildCancellationError() {\n return Object.assign(new Error(\"Route Cancelled\"), {\n cancelled: true\n });\n}\nfunction matchesMiddleware(options) {\n return _matchesMiddleware.apply(this, arguments);\n}\nfunction _matchesMiddleware() {\n _matchesMiddleware = _async_to_generator(function(options) {\n var matchers, ref, asPathname, cleanedAs, asWithBasePathAndLocale;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n return [\n 4,\n Promise.resolve(options.router.pageLoader.getMiddleware())\n ];\n case 1:\n matchers = _state.sent();\n if (!matchers) return [\n 2,\n false\n ];\n ref = (0, _parsePath).parsePath(options.asPath), asPathname = ref.pathname;\n cleanedAs = (0, _hasBasePath).hasBasePath(asPathname) ? (0, _removeBasePath).removeBasePath(asPathname) : asPathname;\n asWithBasePathAndLocale = (0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, options.locale));\n // Check only path match on client. Matching \"has\" should be done on server\n // where we can access more info such as headers, HttpOnly cookie, etc.\n return [\n 2,\n matchers.some(function(m) {\n return new RegExp(m.regexp).test(asWithBasePathAndLocale);\n })\n ];\n }\n });\n });\n return _matchesMiddleware.apply(this, arguments);\n}\nfunction stripOrigin(url) {\n var origin = (0, _utils).getLocationOrigin();\n return url.startsWith(origin) ? url.substring(origin.length) : url;\n}\nfunction omit(object, keys) {\n var omitted = {};\n Object.keys(object).forEach(function(key) {\n if (!keys.includes(key)) {\n omitted[key] = object[key];\n }\n });\n return omitted;\n}\nfunction isLocalURL(url) {\n // prevent a hydration mismatch on href for url with anchor refs\n if (!(0, _utils).isAbsoluteUrl(url)) return true;\n try {\n // absolute urls can be local if they are on the same origin\n var locationOrigin = (0, _utils).getLocationOrigin();\n var resolved = new URL(url, locationOrigin);\n return resolved.origin === locationOrigin && (0, _hasBasePath).hasBasePath(resolved.pathname);\n } catch (_) {\n return false;\n }\n}\nfunction interpolateAs(route, asPathname, query) {\n var interpolatedRoute = \"\";\n var dynamicRegex = (0, _routeRegex).getRouteRegex(route);\n var dynamicGroups = dynamicRegex.groups;\n var dynamicMatches = (asPathname !== route ? (0, _routeMatcher).getRouteMatcher(dynamicRegex)(asPathname) : \"\") || // Fall back to reading the values from the href\n // TODO: should this take priority; also need to change in the router.\n query;\n interpolatedRoute = route;\n var params = Object.keys(dynamicGroups);\n if (!params.every(function(param) {\n var value = dynamicMatches[param] || \"\";\n var _param = dynamicGroups[param], repeat = _param.repeat, optional = _param.optional;\n // support single-level catch-all\n // TODO: more robust handling for user-error (passing `/`)\n var replaced = \"[\".concat(repeat ? \"...\" : \"\").concat(param, \"]\");\n if (optional) {\n replaced = \"\".concat(!value ? \"/\" : \"\", \"[\").concat(replaced, \"]\");\n }\n if (repeat && !Array.isArray(value)) value = [\n value\n ];\n return (optional || param in dynamicMatches) && // Interpolate group into data URL if present\n (interpolatedRoute = interpolatedRoute.replace(replaced, repeat ? value.map(// path delimiter escaped since they are being inserted\n // into the URL and we expect URL encoded segments\n // when parsing dynamic route params\n function(segment) {\n return encodeURIComponent(segment);\n }).join(\"/\") : encodeURIComponent(value)) || \"/\");\n })) {\n interpolatedRoute = \"\" // did not satisfy all requirements\n ;\n // n.b. We ignore this error because we handle warning for this case in\n // development in the `<Link>` component directly.\n }\n return {\n params: params,\n result: interpolatedRoute\n };\n}\nfunction resolveHref(router, href, resolveAs) {\n // we use a dummy base url for relative urls\n var base;\n var urlAsString = typeof href === \"string\" ? href : (0, _formatUrl).formatWithValidation(href);\n // repeated slashes and backslashes in the URL are considered\n // invalid and will never match a Next.js page/file\n var urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\\/\\//);\n var urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;\n var urlParts = urlAsStringNoProto.split(\"?\");\n if ((urlParts[0] || \"\").match(/(\\/\\/|\\\\)/)) {\n console.error(\"Invalid href passed to next/router: \".concat(urlAsString, \", repeated forward-slashes (//) or backslashes \\\\ are not valid in the href\"));\n var normalizedUrl = (0, _utils).normalizeRepeatedSlashes(urlAsStringNoProto);\n urlAsString = (urlProtoMatch ? urlProtoMatch[0] : \"\") + normalizedUrl;\n }\n // Return because it cannot be routed by the Next.js router\n if (!isLocalURL(urlAsString)) {\n return resolveAs ? [\n urlAsString\n ] : urlAsString;\n }\n try {\n base = new URL(urlAsString.startsWith(\"#\") ? router.asPath : router.pathname, \"http://n\");\n } catch (_) {\n // fallback to / for invalid asPath values e.g. //\n base = new URL(\"/\", \"http://n\");\n }\n try {\n var finalUrl = new URL(urlAsString, base);\n finalUrl.pathname = (0, _normalizeTrailingSlash).normalizePathTrailingSlash(finalUrl.pathname);\n var interpolatedAs = \"\";\n if ((0, _isDynamic).isDynamicRoute(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {\n var query = (0, _querystring).searchParamsToUrlQuery(finalUrl.searchParams);\n var ref = interpolateAs(finalUrl.pathname, finalUrl.pathname, query), result = ref.result, params = ref.params;\n if (result) {\n interpolatedAs = (0, _formatUrl).formatWithValidation({\n pathname: result,\n hash: finalUrl.hash,\n query: omit(query, params)\n });\n }\n }\n // if the origin didn't change, it means we received a relative href\n var resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;\n return resolveAs ? [\n resolvedHref,\n interpolatedAs || resolvedHref\n ] : resolvedHref;\n } catch (_1) {\n return resolveAs ? [\n urlAsString\n ] : urlAsString;\n }\n}\nfunction prepareUrlAs(router, url, as) {\n // If url and as provided as an object representation,\n // we'll format them into the string version here.\n var ref = _slicedToArray(resolveHref(router, url, true), 2), resolvedHref = ref[0], resolvedAs = ref[1];\n var origin = (0, _utils).getLocationOrigin();\n var hrefHadOrigin = resolvedHref.startsWith(origin);\n var asHadOrigin = resolvedAs && resolvedAs.startsWith(origin);\n resolvedHref = stripOrigin(resolvedHref);\n resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs;\n var preparedUrl = hrefHadOrigin ? resolvedHref : (0, _addBasePath).addBasePath(resolvedHref);\n var preparedAs = as ? stripOrigin(resolveHref(router, as)) : resolvedAs || resolvedHref;\n return {\n url: preparedUrl,\n as: asHadOrigin ? preparedAs : (0, _addBasePath).addBasePath(preparedAs)\n };\n}\nfunction resolveDynamicRoute(pathname, pages) {\n var cleanPathname = (0, _removeTrailingSlash).removeTrailingSlash((0, _denormalizePagePath).denormalizePagePath(pathname));\n if (cleanPathname === \"/404\" || cleanPathname === \"/_error\") {\n return pathname;\n }\n // handle resolving href for dynamic routes\n if (!pages.includes(cleanPathname)) {\n // eslint-disable-next-line array-callback-return\n pages.some(function(page) {\n if ((0, _isDynamic).isDynamicRoute(page) && (0, _routeRegex).getRouteRegex(page).re.test(cleanPathname)) {\n pathname = page;\n return true;\n }\n });\n }\n return (0, _removeTrailingSlash).removeTrailingSlash(pathname);\n}\nfunction getMiddlewareData(source, response, options) {\n var nextConfig = {\n basePath: options.router.basePath,\n i18n: {\n locales: options.router.locales\n },\n trailingSlash: Boolean(false)\n };\n var rewriteHeader = response.headers.get(\"x-nextjs-rewrite\");\n var rewriteTarget = rewriteHeader || response.headers.get(\"x-nextjs-matched-path\");\n var matchedPath = response.headers.get(\"x-matched-path\");\n if (matchedPath && !rewriteTarget && !matchedPath.includes(\"__next_data_catchall\") && !matchedPath.includes(\"/_error\") && !matchedPath.includes(\"/404\")) {\n // leverage x-matched-path to detect next.config.js rewrites\n rewriteTarget = matchedPath;\n }\n if (rewriteTarget) {\n if (rewriteTarget.startsWith(\"/\")) {\n var parsedRewriteTarget = (0, _parseRelativeUrl).parseRelativeUrl(rewriteTarget);\n var pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(parsedRewriteTarget.pathname, {\n nextConfig: nextConfig,\n parseData: true\n });\n var fsPathname = (0, _removeTrailingSlash).removeTrailingSlash(pathnameInfo.pathname);\n return Promise.all([\n options.router.pageLoader.getPageList(),\n (0, _routeLoader).getClientBuildManifest(), \n ]).then(function(param) {\n var _param = _slicedToArray(param, 2), pages = _param[0], ref = _param[1], rewrites = ref.__rewrites;\n var as = (0, _addLocale).addLocale(pathnameInfo.pathname, pathnameInfo.locale);\n if ((0, _isDynamic).isDynamicRoute(as) || !rewriteHeader && pages.includes((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(as), options.router.locales).pathname)) {\n var parsedSource = (0, _getNextPathnameInfo).getNextPathnameInfo((0, _parseRelativeUrl).parseRelativeUrl(source).pathname, {\n parseData: true\n });\n as = (0, _addBasePath).addBasePath(parsedSource.pathname);\n parsedRewriteTarget.pathname = as;\n }\n if (false) { var result; } else if (!pages.includes(fsPathname)) {\n var resolvedPathname = resolveDynamicRoute(fsPathname, pages);\n if (resolvedPathname !== fsPathname) {\n fsPathname = resolvedPathname;\n }\n }\n var resolvedHref = !pages.includes(fsPathname) ? resolveDynamicRoute((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(parsedRewriteTarget.pathname), options.router.locales).pathname, pages) : fsPathname;\n if ((0, _isDynamic).isDynamicRoute(resolvedHref)) {\n var matches = (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(resolvedHref))(as);\n Object.assign(parsedRewriteTarget.query, matches || {});\n }\n return {\n type: \"rewrite\",\n parsedAs: parsedRewriteTarget,\n resolvedHref: resolvedHref\n };\n });\n }\n var src = (0, _parsePath).parsePath(source);\n var pathname = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src.pathname, {\n nextConfig: nextConfig,\n parseData: true\n }), {\n defaultLocale: options.router.defaultLocale,\n buildId: \"\"\n }));\n return Promise.resolve({\n type: \"redirect-external\",\n destination: \"\".concat(pathname).concat(src.query).concat(src.hash)\n });\n }\n var redirectTarget = response.headers.get(\"x-nextjs-redirect\");\n if (redirectTarget) {\n if (redirectTarget.startsWith(\"/\")) {\n var src1 = (0, _parsePath).parsePath(redirectTarget);\n var pathname1 = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src1.pathname, {\n nextConfig: nextConfig,\n parseData: true\n }), {\n defaultLocale: options.router.defaultLocale,\n buildId: \"\"\n }));\n return Promise.resolve({\n type: \"redirect-internal\",\n newAs: \"\".concat(pathname1).concat(src1.query).concat(src1.hash),\n newUrl: \"\".concat(pathname1).concat(src1.query).concat(src1.hash)\n });\n }\n return Promise.resolve({\n type: \"redirect-external\",\n destination: redirectTarget\n });\n }\n return Promise.resolve({\n type: \"next\"\n });\n}\nfunction withMiddlewareEffects(options) {\n return matchesMiddleware(options).then(function(matches) {\n if (matches && options.fetchData) {\n return options.fetchData().then(function(data) {\n return getMiddlewareData(data.dataHref, data.response, options).then(function(effect) {\n return {\n dataHref: data.dataHref,\n cacheKey: data.cacheKey,\n json: data.json,\n response: data.response,\n text: data.text,\n effect: effect\n };\n });\n }).catch(function(_err) {\n /**\n * TODO: Revisit this in the future.\n * For now we will not consider middleware data errors to be fatal.\n * maybe we should revisit in the future.\n */ return null;\n });\n }\n return null;\n });\n}\nvar manualScrollRestoration = false && 0;\nvar SSG_DATA_NOT_FOUND = Symbol(\"SSG_DATA_NOT_FOUND\");\nfunction fetchRetry(url, attempts, options) {\n return fetch(url, {\n // Cookies are required to be present for Next.js' SSG \"Preview Mode\".\n // Cookies may also be required for `getServerSideProps`.\n //\n // > `fetch` won’t send cookies, unless you set the credentials init\n // > option.\n // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\n //\n // > For maximum browser compatibility when it comes to sending &\n // > receiving cookies, always supply the `credentials: 'same-origin'`\n // > option instead of relying on the default.\n // https://github.com/github/fetch#caveats\n credentials: \"same-origin\",\n method: options.method || \"GET\",\n headers: Object.assign({}, options.headers, {\n \"x-nextjs-data\": \"1\"\n })\n }).then(function(response) {\n return !response.ok && attempts > 1 && response.status >= 500 ? fetchRetry(url, attempts - 1, options) : response;\n });\n}\nvar backgroundCache = {};\nfunction handleSmoothScroll(fn) {\n var htmlElement = document.documentElement;\n var existing = htmlElement.style.scrollBehavior;\n htmlElement.style.scrollBehavior = \"auto\";\n fn();\n htmlElement.style.scrollBehavior = existing;\n}\nfunction tryToParseAsJSON(text) {\n try {\n return JSON.parse(text);\n } catch (error) {\n return null;\n }\n}\nfunction fetchNextData(param) {\n var dataHref = param.dataHref, inflightCache = param.inflightCache, isPrefetch = param.isPrefetch, hasMiddleware = param.hasMiddleware, isServerRender = param.isServerRender, parseJSON = param.parseJSON, persistCache = param.persistCache, isBackground = param.isBackground, unstable_skipClientCache = param.unstable_skipClientCache;\n var ref = new URL(dataHref, window.location.href), cacheKey = ref.href;\n var ref1;\n var getData = function(params) {\n return fetchRetry(dataHref, isServerRender ? 3 : 1, {\n headers: isPrefetch ? {\n purpose: \"prefetch\"\n } : {},\n method: (ref1 = params == null ? void 0 : params.method) != null ? ref1 : \"GET\"\n }).then(function(response) {\n if (response.ok && (params == null ? void 0 : params.method) === \"HEAD\") {\n return {\n dataHref: dataHref,\n response: response,\n text: \"\",\n json: {},\n cacheKey: cacheKey\n };\n }\n return response.text().then(function(text) {\n if (!response.ok) {\n /**\n * When the data response is a redirect because of a middleware\n * we do not consider it an error. The headers must bring the\n * mapped location.\n * TODO: Change the status code in the handler.\n */ if (hasMiddleware && [\n 301,\n 302,\n 307,\n 308\n ].includes(response.status)) {\n return {\n dataHref: dataHref,\n response: response,\n text: text,\n json: {},\n cacheKey: cacheKey\n };\n }\n if (!hasMiddleware && response.status === 404) {\n var ref;\n if ((ref = tryToParseAsJSON(text)) == null ? void 0 : ref.notFound) {\n return {\n dataHref: dataHref,\n json: {\n notFound: SSG_DATA_NOT_FOUND\n },\n response: response,\n text: text,\n cacheKey: cacheKey\n };\n }\n }\n var error = new Error(\"Failed to load static props\");\n /**\n * We should only trigger a server-side transition if this was\n * caused on a client-side transition. Otherwise, we'd get into\n * an infinite loop.\n */ if (!isServerRender) {\n (0, _routeLoader).markAssetError(error);\n }\n throw error;\n }\n return {\n dataHref: dataHref,\n json: parseJSON ? tryToParseAsJSON(text) : null,\n response: response,\n text: text,\n cacheKey: cacheKey\n };\n });\n }).then(function(data) {\n if (!persistCache || \"development\" !== \"production\" || 0) {\n delete inflightCache[cacheKey];\n }\n return data;\n }).catch(function(err) {\n delete inflightCache[cacheKey];\n throw err;\n });\n };\n // when skipping client cache we wait to update\n // inflight cache until successful data response\n // this allows racing click event with fetching newer data\n // without blocking navigation when stale data is available\n if (unstable_skipClientCache && persistCache) {\n return getData({}).then(function(data) {\n inflightCache[cacheKey] = Promise.resolve(data);\n return data;\n });\n }\n if (inflightCache[cacheKey] !== undefined) {\n return inflightCache[cacheKey];\n }\n return inflightCache[cacheKey] = getData(isBackground ? {\n method: \"HEAD\"\n } : {});\n}\nfunction createKey() {\n return Math.random().toString(36).slice(2, 10);\n}\nfunction handleHardNavigation(param) {\n var url = param.url, router = param.router;\n // ensure we don't trigger a hard navigation to the same\n // URL as this can end up with an infinite refresh\n if (url === (0, _addBasePath).addBasePath((0, _addLocale).addLocale(router.asPath, router.locale))) {\n throw new Error(\"Invariant: attempted to hard navigate to the same URL \".concat(url, \" \").concat(location.href));\n }\n window.location.href = url;\n}\nvar getCancelledHandler = function(param) {\n var route = param.route, router = param.router;\n var cancelled = false;\n var cancel = router.clc = function() {\n cancelled = true;\n };\n var handleCancelled = function() {\n if (cancelled) {\n var error = new Error('Abort fetching component for route: \"'.concat(route, '\"'));\n error.cancelled = true;\n throw error;\n }\n if (cancel === router.clc) {\n router.clc = null;\n }\n };\n return handleCancelled;\n};\nvar Router = /*#__PURE__*/ function() {\n function Router(pathname1, query1, as1, param) {\n var initialProps = param.initialProps, pageLoader = param.pageLoader, App = param.App, wrapApp = param.wrapApp, Component = param.Component, err = param.err, subscription = param.subscription, isFallback = param.isFallback, locale = param.locale, locales = param.locales, defaultLocale = param.defaultLocale, domainLocales = param.domainLocales, isPreview = param.isPreview;\n var _this = this;\n _classCallCheck(this, Router);\n // Server Data Cache\n this.sdc = {};\n this.isFirstPopStateEvent = true;\n this._key = createKey();\n this.onPopState = function(e) {\n var isFirstPopStateEvent = _this.isFirstPopStateEvent;\n _this.isFirstPopStateEvent = false;\n var state = e.state;\n if (!state) {\n // We get state as undefined for two reasons.\n // 1. With older safari (< 8) and older chrome (< 34)\n // 2. When the URL changed with #\n //\n // In the both cases, we don't need to proceed and change the route.\n // (as it's already changed)\n // But we can simply replace the state with the new changes.\n // Actually, for (1) we don't need to nothing. But it's hard to detect that event.\n // So, doing the following for (1) does no harm.\n var pathname = _this.pathname, query = _this.query;\n _this.changeState(\"replaceState\", (0, _formatUrl).formatWithValidation({\n pathname: (0, _addBasePath).addBasePath(pathname),\n query: query\n }), (0, _utils).getURL());\n return;\n }\n // __NA is used to identify if the history entry can be handled by the app-router.\n if (state.__NA) {\n window.location.reload();\n return;\n }\n if (!state.__N) {\n return;\n }\n // Safari fires popstateevent when reopening the browser.\n if (isFirstPopStateEvent && _this.locale === state.options.locale && state.as === _this.asPath) {\n return;\n }\n var forcedScroll;\n var url = state.url, as = state.as, options = state.options, key = state.key;\n if (false) { var v; }\n _this._key = key;\n var pathname1 = (0, _parseRelativeUrl).parseRelativeUrl(url).pathname;\n // Make sure we don't re-render on initial load,\n // can be caused by navigating back from an external site\n if (_this.isSsr && as === (0, _addBasePath).addBasePath(_this.asPath) && pathname1 === (0, _addBasePath).addBasePath(_this.pathname)) {\n return;\n }\n // If the downstream application returns falsy, return.\n // They will then be responsible for handling the event.\n if (_this._bps && !_this._bps(state)) {\n return;\n }\n _this.change(\"replaceState\", url, as, Object.assign({}, options, {\n shallow: options.shallow && _this._shallow,\n locale: options.locale || _this.defaultLocale,\n // @ts-ignore internal value not exposed on types\n _h: 0\n }), forcedScroll);\n };\n // represents the current component key\n var route = (0, _removeTrailingSlash).removeTrailingSlash(pathname1);\n // set up the component cache (by route keys)\n this.components = {};\n // We should not keep the cache, if there's an error\n // Otherwise, this cause issues when when going back and\n // come again to the errored page.\n if (pathname1 !== \"/_error\") {\n this.components[route] = {\n Component: Component,\n initial: true,\n props: initialProps,\n err: err,\n __N_SSG: initialProps && initialProps.__N_SSG,\n __N_SSP: initialProps && initialProps.__N_SSP\n };\n }\n this.components[\"/_app\"] = {\n Component: App,\n styleSheets: []\n };\n // Backwards compat for Router.router.events\n // TODO: Should be remove the following major version as it was never documented\n this.events = Router.events;\n this.pageLoader = pageLoader;\n // if auto prerendered and dynamic route wait to update asPath\n // until after mount to prevent hydration mismatch\n var autoExportDynamic = (0, _isDynamic).isDynamicRoute(pathname1) && self.__NEXT_DATA__.autoExport;\n this.basePath = false || \"\";\n this.sub = subscription;\n this.clc = null;\n this._wrapApp = wrapApp;\n // make sure to ignore extra popState in safari on navigating\n // back from external site\n this.isSsr = true;\n this.isLocaleDomain = false;\n this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !autoExportDynamic && !self.location.search && !false);\n if (false) {}\n this.state = {\n route: route,\n pathname: pathname1,\n query: query1,\n asPath: autoExportDynamic ? pathname1 : as1,\n isPreview: !!isPreview,\n locale: false ? 0 : undefined,\n isFallback: isFallback\n };\n this._initialMatchesMiddlewarePromise = Promise.resolve(false);\n if (true) {\n // make sure \"as\" doesn't start with double slashes or else it can\n // throw an error as it's considered invalid\n if (!as1.startsWith(\"//\")) {\n // in order for `e.state` to work on the `onpopstate` event\n // we have to register the initial route upon initialization\n var options = {\n locale: locale\n };\n var asPath = (0, _utils).getURL();\n this._initialMatchesMiddlewarePromise = matchesMiddleware({\n router: this,\n locale: locale,\n asPath: asPath\n }).then(function(matches) {\n options._shouldResolveHref = as1 !== pathname1;\n _this.changeState(\"replaceState\", matches ? asPath : (0, _formatUrl).formatWithValidation({\n pathname: (0, _addBasePath).addBasePath(pathname1),\n query: query1\n }), asPath, options);\n return matches;\n });\n }\n window.addEventListener(\"popstate\", this.onPopState);\n // enable custom scroll restoration handling when available\n // otherwise fallback to browser's default handling\n if (false) {}\n }\n }\n _createClass(Router, [\n {\n key: \"reload\",\n value: function reload() {\n window.location.reload();\n }\n },\n {\n /**\n * Go back in history\n */ key: \"back\",\n value: function back() {\n window.history.back();\n }\n },\n {\n /**\n * Performs a `pushState` with arguments\n * @param url of the route\n * @param as masks `url` for the browser\n * @param options object you can define `shallow` and other options\n */ key: \"push\",\n value: function push(url, as) {\n var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};\n if (false) {}\n var ref;\n ref = prepareUrlAs(this, url, as), url = ref.url, as = ref.as, ref;\n return this.change(\"pushState\", url, as, options);\n }\n },\n {\n /**\n * Performs a `replaceState` with arguments\n * @param url of the route\n * @param as masks `url` for the browser\n * @param options object you can define `shallow` and other options\n */ key: \"replace\",\n value: function replace(url, as) {\n var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};\n var ref;\n ref = prepareUrlAs(this, url, as), url = ref.url, as = ref.as, ref;\n return this.change(\"replaceState\", url, as, options);\n }\n },\n {\n key: \"change\",\n value: function change(method, url, as, options, forcedScroll) {\n var _this = this;\n return _async_to_generator(function() {\n var isQueryUpdating, shouldResolveHref, nextState, readyStateChange, isSsr, prevLocale, parsedAs, localePathResult, didNavigate, ref, detectedDomain, asNoBasePath, _shallow, shallow, _scroll, scroll, routeProps, cleanedAs, localeChange, err, parsed, pathname, query, pages, rewrites, ref1, ref2, err1, resolvedAs, isMiddlewareMatch, rewritesResult, route, routeMatch, parsedAs1, asPathname, routeRegex, shouldInterpolate, interpolatedAs, missingParams, ref21, ref3, routeInfo, cleanedParsedPathname, prefixedAs, rewriteAs, localeResult, routeRegex1, curRouteMatch, error, props, __N_SSG, __N_SSP, component, scripts, destination, parsedHref, ref4, newUrl, newAs, notFoundRoute, _, _route, isValidShallowRoute, _scroll1, shouldScroll, resetScroll, upcomingRouterState, upcomingScrollState, canSkipUpdating, hashRegex, err11;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n if (!isLocalURL(url)) {\n handleHardNavigation({\n url: url,\n router: _this\n });\n return [\n 2,\n false\n ];\n }\n isQueryUpdating = options._h;\n shouldResolveHref = isQueryUpdating || options._shouldResolveHref || (0, _parsePath).parsePath(url).pathname === (0, _parsePath).parsePath(as).pathname;\n nextState = _extends({}, _this.state);\n readyStateChange = _this.isReady !== true;\n _this.isReady = true;\n isSsr = _this.isSsr;\n if (!isQueryUpdating) {\n _this.isSsr = false;\n }\n // if a route transition is already in progress before\n // the query updating is triggered ignore query updating\n if (isQueryUpdating && _this.clc) {\n return [\n 2,\n false\n ];\n }\n prevLocale = nextState.locale;\n if (false) {}\n // marking route changes as a navigation start entry\n if (_utils.ST) {\n performance.mark(\"routeChange\");\n }\n _shallow = options.shallow, shallow = _shallow === void 0 ? false : _shallow, _scroll = options.scroll, scroll = _scroll === void 0 ? true : _scroll;\n routeProps = {\n shallow: shallow\n };\n if (_this._inFlightRoute && _this.clc) {\n if (!isSsr) {\n Router.events.emit(\"routeChangeError\", buildCancellationError(), _this._inFlightRoute, routeProps);\n }\n _this.clc();\n _this.clc = null;\n }\n as = (0, _addBasePath).addBasePath((0, _addLocale).addLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, options.locale, _this.defaultLocale));\n cleanedAs = (0, _removeLocale).removeLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, nextState.locale);\n _this._inFlightRoute = as;\n localeChange = prevLocale !== nextState.locale;\n if (!(!isQueryUpdating && _this.onlyAHashChange(cleanedAs) && !localeChange)) return [\n 3,\n 5\n ];\n nextState.asPath = cleanedAs;\n Router.events.emit(\"hashChangeStart\", as, routeProps);\n // TODO: do we need the resolved href when only a hash change?\n _this.changeState(method, url, as, _extends({}, options, {\n scroll: false\n }));\n if (scroll) {\n _this.scrollToHash(cleanedAs);\n }\n _state.label = 1;\n case 1:\n _state.trys.push([\n 1,\n 3,\n ,\n 4\n ]);\n return [\n 4,\n _this.set(nextState, _this.components[nextState.route], null)\n ];\n case 2:\n _state.sent();\n return [\n 3,\n 4\n ];\n case 3:\n err = _state.sent();\n if ((0, _isError).default(err) && err.cancelled) {\n Router.events.emit(\"routeChangeError\", err, cleanedAs, routeProps);\n }\n throw err;\n case 4:\n Router.events.emit(\"hashChangeComplete\", as, routeProps);\n return [\n 2,\n true\n ];\n case 5:\n parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);\n pathname = parsed.pathname, query = parsed.query;\n _state.label = 6;\n case 6:\n _state.trys.push([\n 6,\n 8,\n ,\n 9\n ]);\n return [\n 4,\n Promise.all([\n _this.pageLoader.getPageList(),\n (0, _routeLoader).getClientBuildManifest(),\n _this.pageLoader.getMiddleware()\n ])\n ];\n case 7:\n ref1 = _slicedToArray.apply(void 0, [\n _state.sent(),\n 2\n ]), pages = ref1[0], ref2 = ref1[1], rewrites = ref2.__rewrites, ref2, ref1;\n return [\n 3,\n 9\n ];\n case 8:\n err1 = _state.sent();\n // If we fail to resolve the page list or client-build manifest, we must\n // do a server-side transition:\n handleHardNavigation({\n url: as,\n router: _this\n });\n return [\n 2,\n false\n ];\n case 9:\n // If asked to change the current URL we should reload the current page\n // (not location.reload() but reload getInitialProps and other Next.js stuffs)\n // We also need to set the method = replaceState always\n // as this should not go into the history (That's how browsers work)\n // We should compare the new asPath to the current asPath, not the url\n if (!_this.urlIsNew(cleanedAs) && !localeChange) {\n method = \"replaceState\";\n }\n resolvedAs = as;\n // url and as should always be prefixed with basePath by this\n // point by either next/link or router.push/replace so strip the\n // basePath from the pathname to match the pages dir 1-to-1\n pathname = pathname ? (0, _removeTrailingSlash).removeTrailingSlash((0, _removeBasePath).removeBasePath(pathname)) : pathname;\n return [\n 4,\n matchesMiddleware({\n asPath: as,\n locale: nextState.locale,\n router: _this\n })\n ];\n case 10:\n isMiddlewareMatch = _state.sent();\n if (options.shallow && isMiddlewareMatch) {\n pathname = _this.pathname;\n }\n if (shouldResolveHref && pathname !== \"/_error\") {\n options._shouldResolveHref = true;\n if (false) {} else {\n parsed.pathname = resolveDynamicRoute(pathname, pages);\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname;\n parsed.pathname = (0, _addBasePath).addBasePath(pathname);\n if (!isMiddlewareMatch) {\n url = (0, _formatUrl).formatWithValidation(parsed);\n }\n }\n }\n }\n if (!isLocalURL(as)) {\n if (true) {\n throw new Error('Invalid href: \"'.concat(url, '\" and as: \"').concat(as, '\", received relative href and external as') + \"\\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as\");\n }\n handleHardNavigation({\n url: as,\n router: _this\n });\n return [\n 2,\n false\n ];\n }\n resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(resolvedAs), nextState.locale);\n route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);\n routeMatch = false;\n if ((0, _isDynamic).isDynamicRoute(route)) {\n parsedAs1 = (0, _parseRelativeUrl).parseRelativeUrl(resolvedAs);\n asPathname = parsedAs1.pathname;\n routeRegex = (0, _routeRegex).getRouteRegex(route);\n routeMatch = (0, _routeMatcher).getRouteMatcher(routeRegex)(asPathname);\n shouldInterpolate = route === asPathname;\n interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};\n if (!routeMatch || shouldInterpolate && !interpolatedAs.result) {\n missingParams = Object.keys(routeRegex.groups).filter(function(param) {\n return !query[param];\n });\n if (missingParams.length > 0 && !isMiddlewareMatch) {\n if (true) {\n console.warn(\"\".concat(shouldInterpolate ? \"Interpolating href\" : \"Mismatching `as` and `href`\", \" failed to manually provide \") + \"the params: \".concat(missingParams.join(\", \"), \" in the `href`'s `query`\"));\n }\n throw new Error((shouldInterpolate ? \"The provided `href` (\".concat(url, \") value is missing query values (\").concat(missingParams.join(\", \"), \") to be interpolated properly. \") : \"The provided `as` value (\".concat(asPathname, \") is incompatible with the `href` value (\").concat(route, \"). \")) + \"Read more: https://nextjs.org/docs/messages/\".concat(shouldInterpolate ? \"href-interpolation-failed\" : \"incompatible-href-as\"));\n }\n } else if (shouldInterpolate) {\n as = (0, _formatUrl).formatWithValidation(Object.assign({}, parsedAs1, {\n pathname: interpolatedAs.result,\n query: omit(query, interpolatedAs.params)\n }));\n } else {\n // Merge params into `query`, overwriting any specified in search\n Object.assign(query, routeMatch);\n }\n }\n if (!isQueryUpdating) {\n Router.events.emit(\"routeChangeStart\", as, routeProps);\n }\n _state.label = 11;\n case 11:\n _state.trys.push([\n 11,\n 21,\n ,\n 22\n ]);\n return [\n 4,\n _this.getRouteInfo({\n route: route,\n pathname: pathname,\n query: query,\n as: as,\n resolvedAs: resolvedAs,\n routeProps: routeProps,\n locale: nextState.locale,\n isPreview: nextState.isPreview,\n hasMiddleware: isMiddlewareMatch\n })\n ];\n case 12:\n routeInfo = _state.sent();\n if (\"route\" in routeInfo && isMiddlewareMatch) {\n pathname = routeInfo.route || route;\n route = pathname;\n if (!routeProps.shallow) {\n query = Object.assign({}, routeInfo.query || {}, query);\n }\n cleanedParsedPathname = (0, _hasBasePath).hasBasePath(parsed.pathname) ? (0, _removeBasePath).removeBasePath(parsed.pathname) : parsed.pathname;\n if (routeMatch && pathname !== cleanedParsedPathname) {\n Object.keys(routeMatch).forEach(function(key) {\n if (routeMatch && query[key] === routeMatch[key]) {\n delete query[key];\n }\n });\n }\n if ((0, _isDynamic).isDynamicRoute(pathname)) {\n prefixedAs = !routeProps.shallow && routeInfo.resolvedAs ? routeInfo.resolvedAs : (0, _addBasePath).addBasePath((0, _addLocale).addLocale(new URL(as, location.href).pathname, nextState.locale), true);\n rewriteAs = prefixedAs;\n if ((0, _hasBasePath).hasBasePath(rewriteAs)) {\n rewriteAs = (0, _removeBasePath).removeBasePath(rewriteAs);\n }\n if (false) {}\n routeRegex1 = (0, _routeRegex).getRouteRegex(pathname);\n curRouteMatch = (0, _routeMatcher).getRouteMatcher(routeRegex1)(rewriteAs);\n if (curRouteMatch) {\n Object.assign(query, curRouteMatch);\n }\n }\n }\n // If the routeInfo brings a redirect we simply apply it.\n if (\"type\" in routeInfo) {\n if (routeInfo.type === \"redirect-internal\") {\n return [\n 2,\n _this.change(method, routeInfo.newUrl, routeInfo.newAs, options)\n ];\n } else {\n handleHardNavigation({\n url: routeInfo.destination,\n router: _this\n });\n return [\n 2,\n new Promise(function() {})\n ];\n }\n }\n error = routeInfo.error, props = routeInfo.props, __N_SSG = routeInfo.__N_SSG, __N_SSP = routeInfo.__N_SSP;\n component = routeInfo.Component;\n if (component && component.unstable_scriptLoader) {\n scripts = [].concat(component.unstable_scriptLoader());\n scripts.forEach(function(script) {\n (0, _script).handleClientScriptLoad(script.props);\n });\n }\n if (!((__N_SSG || __N_SSP) && props)) return [\n 3,\n 18\n ];\n if (props.pageProps && props.pageProps.__N_REDIRECT) {\n // Use the destination from redirect without adding locale\n options.locale = false;\n destination = props.pageProps.__N_REDIRECT;\n // check if destination is internal (resolves to a page) and attempt\n // client-navigation if it is falling back to hard navigation if\n // it's not\n if (destination.startsWith(\"/\") && props.pageProps.__N_REDIRECT_BASE_PATH !== false) {\n parsedHref = (0, _parseRelativeUrl).parseRelativeUrl(destination);\n parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);\n ref4 = prepareUrlAs(_this, destination, destination), newUrl = ref4.url, newAs = ref4.as;\n return [\n 2,\n _this.change(method, newUrl, newAs, options)\n ];\n }\n handleHardNavigation({\n url: destination,\n router: _this\n });\n return [\n 2,\n new Promise(function() {})\n ];\n }\n nextState.isPreview = !!props.__N_PREVIEW;\n if (!(props.notFound === SSG_DATA_NOT_FOUND)) return [\n 3,\n 18\n ];\n _state.label = 13;\n case 13:\n _state.trys.push([\n 13,\n 15,\n ,\n 16\n ]);\n return [\n 4,\n _this.fetchComponent(\"/404\")\n ];\n case 14:\n _state.sent();\n notFoundRoute = \"/404\";\n return [\n 3,\n 16\n ];\n case 15:\n _ = _state.sent();\n notFoundRoute = \"/_error\";\n return [\n 3,\n 16\n ];\n case 16:\n return [\n 4,\n _this.getRouteInfo({\n route: notFoundRoute,\n pathname: notFoundRoute,\n query: query,\n as: as,\n resolvedAs: resolvedAs,\n routeProps: {\n shallow: false\n },\n locale: nextState.locale,\n isPreview: nextState.isPreview\n })\n ];\n case 17:\n routeInfo = _state.sent();\n if (\"type\" in routeInfo) {\n throw new Error(\"Unexpected middleware effect on /404\");\n }\n _state.label = 18;\n case 18:\n Router.events.emit(\"beforeHistoryChange\", as, routeProps);\n _this.changeState(method, url, as, options);\n if (isQueryUpdating && pathname === \"/_error\" && ((ref21 = self.__NEXT_DATA__.props) == null ? void 0 : (ref3 = ref21.pageProps) == null ? void 0 : ref3.statusCode) === 500 && (props == null ? void 0 : props.pageProps)) {\n // ensure statusCode is still correct for static 500 page\n // when updating query information\n props.pageProps.statusCode = 500;\n }\n isValidShallowRoute = options.shallow && nextState.route === ((_route = routeInfo.route) != null ? _route : route);\n shouldScroll = (_scroll1 = options.scroll) != null ? _scroll1 : !options._h && !isValidShallowRoute;\n resetScroll = shouldScroll ? {\n x: 0,\n y: 0\n } : null;\n upcomingRouterState = _extends({}, nextState, {\n route: route,\n pathname: pathname,\n query: query,\n asPath: cleanedAs,\n isFallback: false\n });\n upcomingScrollState = forcedScroll != null ? forcedScroll : resetScroll;\n canSkipUpdating = options._h && !upcomingScrollState && !readyStateChange && !localeChange && (0, _compareStates).compareRouterStates(upcomingRouterState, _this.state);\n if (!!canSkipUpdating) return [\n 3,\n 20\n ];\n return [\n 4,\n _this.set(upcomingRouterState, routeInfo, upcomingScrollState).catch(function(e) {\n if (e.cancelled) error = error || e;\n else throw e;\n })\n ];\n case 19:\n _state.sent();\n if (error) {\n if (!isQueryUpdating) {\n Router.events.emit(\"routeChangeError\", error, cleanedAs, routeProps);\n }\n throw error;\n }\n if (false) {}\n if (!isQueryUpdating) {\n Router.events.emit(\"routeChangeComplete\", as, routeProps);\n }\n hashRegex = /#.+$/;\n if (shouldScroll && hashRegex.test(as)) {\n _this.scrollToHash(as);\n }\n _state.label = 20;\n case 20:\n return [\n 2,\n true\n ];\n case 21:\n err11 = _state.sent();\n if ((0, _isError).default(err11) && err11.cancelled) {\n return [\n 2,\n false\n ];\n }\n throw err11;\n case 22:\n return [\n 2\n ];\n }\n });\n })();\n }\n },\n {\n key: \"changeState\",\n value: function changeState(method, url, as) {\n var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};\n if (true) {\n if (typeof window.history === \"undefined\") {\n console.error(\"Warning: window.history is not available.\");\n return;\n }\n if (typeof window.history[method] === \"undefined\") {\n console.error(\"Warning: window.history.\".concat(method, \" is not available\"));\n return;\n }\n }\n if (method !== \"pushState\" || (0, _utils).getURL() !== as) {\n this._shallow = options.shallow;\n window.history[method]({\n url: url,\n as: as,\n options: options,\n __N: true,\n key: this._key = method !== \"pushState\" ? this._key : createKey()\n }, // Passing the empty string here should be safe against future changes to the method.\n // https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState\n \"\", as);\n }\n }\n },\n {\n key: \"handleRouteInfoError\",\n value: function handleRouteInfoError(err, pathname, query, as, routeProps, loadErrorFail) {\n var _this = this;\n return _async_to_generator(function() {\n var props, ref, Component, styleSheets, routeInfo, gipErr, routeInfoErr;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n console.error(err);\n if (err.cancelled) {\n // bubble up cancellation errors\n throw err;\n }\n if ((0, _routeLoader).isAssetError(err) || loadErrorFail) {\n Router.events.emit(\"routeChangeError\", err, as, routeProps);\n // If we can't load the page it could be one of following reasons\n // 1. Page doesn't exists\n // 2. Page does exist in a different zone\n // 3. Internal error while loading the page\n // So, doing a hard reload is the proper way to deal with this.\n handleHardNavigation({\n url: as,\n router: _this\n });\n // Changing the URL doesn't block executing the current code path.\n // So let's throw a cancellation error stop the routing logic.\n throw buildCancellationError();\n }\n _state.label = 1;\n case 1:\n _state.trys.push([\n 1,\n 7,\n ,\n 8\n ]);\n return [\n 4,\n _this.fetchComponent(\"/_error\")\n ];\n case 2:\n ref = _state.sent(), Component = ref.page, styleSheets = ref.styleSheets;\n routeInfo = {\n props: props,\n Component: Component,\n styleSheets: styleSheets,\n err: err,\n error: err\n };\n if (!!routeInfo.props) return [\n 3,\n 6\n ];\n _state.label = 3;\n case 3:\n _state.trys.push([\n 3,\n 5,\n ,\n 6\n ]);\n return [\n 4,\n _this.getInitialProps(Component, {\n err: err,\n pathname: pathname,\n query: query\n })\n ];\n case 4:\n routeInfo.props = _state.sent();\n return [\n 3,\n 6\n ];\n case 5:\n gipErr = _state.sent();\n console.error(\"Error in error page `getInitialProps`: \", gipErr);\n routeInfo.props = {};\n return [\n 3,\n 6\n ];\n case 6:\n return [\n 2,\n routeInfo\n ];\n case 7:\n routeInfoErr = _state.sent();\n return [\n 2,\n _this.handleRouteInfoError((0, _isError).default(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + \"\"), pathname, query, as, routeProps, true)\n ];\n case 8:\n return [\n 2\n ];\n }\n });\n })();\n }\n },\n {\n key: \"getRouteInfo\",\n value: function getRouteInfo(param) {\n var requestedRoute = param.route, pathname = param.pathname, query = param.query, as = param.as, resolvedAs = param.resolvedAs, routeProps = param.routeProps, locale = param.locale, hasMiddleware = param.hasMiddleware, isPreview = param.isPreview, unstable_skipClientCache = param.unstable_skipClientCache;\n var _this = this;\n return _async_to_generator(function() {\n var route, ref, ref4, ref5, handleCancelled, existingInfo, cachedRouteInfo, fetchNextDataParams, data, routeInfo, _tmp, isValidElementType, shouldFetchData, ref1, props, cacheKey, err;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n route = requestedRoute;\n _state.label = 1;\n case 1:\n _state.trys.push([\n 1,\n 6,\n ,\n 7\n ]);\n handleCancelled = getCancelledHandler({\n route: route,\n router: _this\n });\n existingInfo = _this.components[route];\n if (routeProps.shallow && existingInfo && _this.route === route) {\n return [\n 2,\n existingInfo\n ];\n }\n if (hasMiddleware) {\n existingInfo = undefined;\n }\n cachedRouteInfo = existingInfo && !(\"initial\" in existingInfo) && \"development\" !== \"development\" ? 0 : undefined;\n fetchNextDataParams = {\n dataHref: _this.pageLoader.getDataHref({\n href: (0, _formatUrl).formatWithValidation({\n pathname: pathname,\n query: query\n }),\n skipInterpolation: true,\n asPath: resolvedAs,\n locale: locale\n }),\n hasMiddleware: true,\n isServerRender: _this.isSsr,\n parseJSON: true,\n inflightCache: _this.sdc,\n persistCache: !isPreview,\n isPrefetch: false,\n unstable_skipClientCache: unstable_skipClientCache\n };\n return [\n 4,\n withMiddlewareEffects({\n fetchData: function() {\n return fetchNextData(fetchNextDataParams);\n },\n asPath: resolvedAs,\n locale: locale,\n router: _this\n })\n ];\n case 2:\n data = _state.sent();\n handleCancelled();\n if ((data == null ? void 0 : (ref = data.effect) == null ? void 0 : ref.type) === \"redirect-internal\" || (data == null ? void 0 : (ref4 = data.effect) == null ? void 0 : ref4.type) === \"redirect-external\") {\n return [\n 2,\n data.effect\n ];\n }\n if ((data == null ? void 0 : (ref5 = data.effect) == null ? void 0 : ref5.type) === \"rewrite\") {\n route = (0, _removeTrailingSlash).removeTrailingSlash(data.effect.resolvedHref);\n pathname = data.effect.resolvedHref;\n query = _extends({}, query, data.effect.parsedAs.query);\n resolvedAs = (0, _removeBasePath).removeBasePath((0, _normalizeLocalePath).normalizeLocalePath(data.effect.parsedAs.pathname, _this.locales).pathname);\n // Check again the cache with the new destination.\n existingInfo = _this.components[route];\n if (routeProps.shallow && existingInfo && _this.route === route && !hasMiddleware) {\n // If we have a match with the current route due to rewrite,\n // we can copy the existing information to the rewritten one.\n // Then, we return the information along with the matched route.\n return [\n 2,\n _extends({}, existingInfo, {\n route: route\n })\n ];\n }\n }\n if (route === \"/api\" || route.startsWith(\"/api/\")) {\n handleHardNavigation({\n url: as,\n router: _this\n });\n return [\n 2,\n new Promise(function() {})\n ];\n }\n _tmp = cachedRouteInfo;\n if (_tmp) return [\n 3,\n 4\n ];\n return [\n 4,\n _this.fetchComponent(route).then(function(res) {\n return {\n Component: res.page,\n styleSheets: res.styleSheets,\n __N_SSG: res.mod.__N_SSG,\n __N_SSP: res.mod.__N_SSP\n };\n })\n ];\n case 3:\n _tmp = _state.sent();\n _state.label = 4;\n case 4:\n routeInfo = _tmp;\n if (true) {\n isValidElementType = (__webpack_require__(/*! next/dist/compiled/react-is */ \"./node_modules/next/dist/compiled/react-is/index.js\").isValidElementType);\n if (!isValidElementType(routeInfo.Component)) {\n throw new Error('The default export is not a React Component in page: \"'.concat(pathname, '\"'));\n }\n }\n shouldFetchData = routeInfo.__N_SSG || routeInfo.__N_SSP;\n return [\n 4,\n _this._getData(_async_to_generator(function() {\n var ref, json, _cacheKey, _tmp, _tmp1;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n if (!shouldFetchData) return [\n 3,\n 4\n ];\n if (!(data == null ? void 0 : data.json)) return [\n 3,\n 1\n ];\n _tmp = data;\n return [\n 3,\n 3\n ];\n case 1:\n return [\n 4,\n fetchNextData({\n dataHref: _this.pageLoader.getDataHref({\n href: (0, _formatUrl).formatWithValidation({\n pathname: pathname,\n query: query\n }),\n asPath: resolvedAs,\n locale: locale\n }),\n isServerRender: _this.isSsr,\n parseJSON: true,\n inflightCache: _this.sdc,\n persistCache: !isPreview,\n isPrefetch: false,\n unstable_skipClientCache: unstable_skipClientCache\n })\n ];\n case 2:\n _tmp = _state.sent();\n _state.label = 3;\n case 3:\n ref = _tmp, json = ref.json, _cacheKey = ref.cacheKey;\n return [\n 2,\n {\n cacheKey: _cacheKey,\n props: json || {}\n }\n ];\n case 4:\n _tmp1 = {\n headers: {},\n cacheKey: \"\"\n };\n return [\n 4,\n _this.getInitialProps(routeInfo.Component, {\n pathname: pathname,\n query: query,\n asPath: as,\n locale: locale,\n locales: _this.locales,\n defaultLocale: _this.defaultLocale\n })\n ];\n case 5:\n return [\n 2,\n (_tmp1.props = _state.sent(), _tmp1)\n ];\n }\n });\n }))\n ];\n case 5:\n ref1 = _state.sent(), props = ref1.props, cacheKey = ref1.cacheKey;\n // Only bust the data cache for SSP routes although\n // middleware can skip cache per request with\n // x-middleware-cache: no-cache as well\n if (routeInfo.__N_SSP && fetchNextDataParams.dataHref) {\n delete _this.sdc[cacheKey];\n }\n // we kick off a HEAD request in the background\n // when a non-prefetch request is made to signal revalidation\n if (!_this.isPreview && routeInfo.__N_SSG && \"development\" !== \"development\") {}\n props.pageProps = Object.assign({}, props.pageProps);\n routeInfo.props = props;\n routeInfo.route = route;\n routeInfo.query = query;\n routeInfo.resolvedAs = resolvedAs;\n _this.components[route] = routeInfo;\n return [\n 2,\n routeInfo\n ];\n case 6:\n err = _state.sent();\n return [\n 2,\n _this.handleRouteInfoError((0, _isError).getProperError(err), pathname, query, as, routeProps)\n ];\n case 7:\n return [\n 2\n ];\n }\n });\n })();\n }\n },\n {\n key: \"set\",\n value: function set(state, data, resetScroll) {\n this.state = state;\n return this.sub(data, this.components[\"/_app\"].Component, resetScroll);\n }\n },\n {\n /**\n * Callback to execute before replacing router state\n * @param cb callback to be executed\n */ key: \"beforePopState\",\n value: function beforePopState(cb) {\n this._bps = cb;\n }\n },\n {\n key: \"onlyAHashChange\",\n value: function onlyAHashChange(as) {\n if (!this.asPath) return false;\n var ref = _slicedToArray(this.asPath.split(\"#\"), 2), oldUrlNoHash = ref[0], oldHash = ref[1];\n var ref1 = _slicedToArray(as.split(\"#\"), 2), newUrlNoHash = ref1[0], newHash = ref1[1];\n // Makes sure we scroll to the provided hash if the url/hash are the same\n if (newHash && oldUrlNoHash === newUrlNoHash && oldHash === newHash) {\n return true;\n }\n // If the urls are change, there's more than a hash change\n if (oldUrlNoHash !== newUrlNoHash) {\n return false;\n }\n // If the hash has changed, then it's a hash only change.\n // This check is necessary to handle both the enter and\n // leave hash === '' cases. The identity case falls through\n // and is treated as a next reload.\n return oldHash !== newHash;\n }\n },\n {\n key: \"scrollToHash\",\n value: function scrollToHash(as) {\n var ref = _slicedToArray(as.split(\"#\"), 2), tmp = ref[1], hash = tmp === void 0 ? \"\" : tmp;\n // Scroll to top if the hash is just `#` with no value or `#top`\n // To mirror browsers\n if (hash === \"\" || hash === \"top\") {\n handleSmoothScroll(function() {\n return window.scrollTo(0, 0);\n });\n return;\n }\n // Decode hash to make non-latin anchor works.\n var rawHash = decodeURIComponent(hash);\n // First we check if the element by id is found\n var idEl = document.getElementById(rawHash);\n if (idEl) {\n handleSmoothScroll(function() {\n return idEl.scrollIntoView();\n });\n return;\n }\n // If there's no element with the id, we check the `name` property\n // To mirror browsers\n var nameEl = document.getElementsByName(rawHash)[0];\n if (nameEl) {\n handleSmoothScroll(function() {\n return nameEl.scrollIntoView();\n });\n }\n }\n },\n {\n key: \"urlIsNew\",\n value: function urlIsNew(asPath) {\n return this.asPath !== asPath;\n }\n },\n {\n /**\n * Prefetch page code, you may wait for the data during page rendering.\n * This feature only works in production!\n * @param url the href of prefetched page\n * @param asPath the as path of the prefetched page\n */ key: \"prefetch\",\n value: function prefetch(url) {\n var asPath = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : url, options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};\n var _this = this;\n return _async_to_generator(function() {\n var parsed, pathname, query, parsedAs, localePathResult, pages, resolvedAs, locale, rewrites, ref, rewritesResult, route;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n if ( true && (0, _isBot).isBot(window.navigator.userAgent)) {\n // No prefetches for bots that render the link since they are typically navigating\n // links via the equivalent of a hard navigation and hence never utilize these\n // prefetches.\n return [\n 2\n ];\n }\n parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);\n pathname = parsed.pathname, query = parsed.query;\n if (false) {}\n return [\n 4,\n _this.pageLoader.getPageList()\n ];\n case 1:\n pages = _state.sent();\n resolvedAs = asPath;\n locale = typeof options.locale !== \"undefined\" ? options.locale || undefined : _this.locale;\n if (true) return [\n 3,\n 3\n ];\n return [\n 4,\n (0, _routeLoader).getClientBuildManifest()\n ];\n case 2:\n ref = _state.sent(), rewrites = ref.__rewrites, ref;\n rewritesResult = (0, _resolveRewrites).default((0, _addBasePath).addBasePath((0, _addLocale).addLocale(asPath, _this.locale), true), pages, rewrites, parsed.query, function(p) {\n return resolveDynamicRoute(p, pages);\n }, _this.locales);\n if (rewritesResult.externalDest) {\n return [\n 2\n ];\n }\n resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(rewritesResult.asPath), _this.locale);\n if (rewritesResult.matchedPage && rewritesResult.resolvedHref) {\n // if this directly matches a page we need to update the href to\n // allow the correct page chunk to be loaded\n pathname = rewritesResult.resolvedHref;\n parsed.pathname = pathname;\n url = (0, _formatUrl).formatWithValidation(parsed);\n }\n _state.label = 3;\n case 3:\n parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);\n if ((0, _isDynamic).isDynamicRoute(parsed.pathname)) {\n pathname = parsed.pathname;\n parsed.pathname = pathname;\n Object.assign(query, (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(parsed.pathname))((0, _parsePath).parsePath(asPath).pathname) || {});\n url = (0, _formatUrl).formatWithValidation(parsed);\n }\n // Prefetch is not supported in development mode because it would trigger on-demand-entries\n if (true) {\n return [\n 2\n ];\n }\n route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);\n return [\n 4,\n Promise.all([\n _this.pageLoader._isSsg(route).then(function(isSsg) {\n return isSsg ? fetchNextData({\n dataHref: _this.pageLoader.getDataHref({\n href: url,\n asPath: resolvedAs,\n locale: locale\n }),\n isServerRender: false,\n parseJSON: true,\n inflightCache: _this.sdc,\n persistCache: !_this.isPreview,\n isPrefetch: true,\n unstable_skipClientCache: options.unstable_skipClientCache || options.priority && !!true\n }).then(function() {\n return false;\n }) : false;\n }),\n _this.pageLoader[options.priority ? \"loadPage\" : \"prefetch\"](route)\n ])\n ];\n case 4:\n _state.sent();\n return [\n 2\n ];\n }\n });\n })();\n }\n },\n {\n key: \"fetchComponent\",\n value: function fetchComponent(route) {\n var _this = this;\n return _async_to_generator(function() {\n var handleCancelled, componentResult, err;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n handleCancelled = getCancelledHandler({\n route: route,\n router: _this\n });\n _state.label = 1;\n case 1:\n _state.trys.push([\n 1,\n 3,\n ,\n 4\n ]);\n return [\n 4,\n _this.pageLoader.loadPage(route)\n ];\n case 2:\n componentResult = _state.sent();\n handleCancelled();\n return [\n 2,\n componentResult\n ];\n case 3:\n err = _state.sent();\n handleCancelled();\n throw err;\n case 4:\n return [\n 2\n ];\n }\n });\n })();\n }\n },\n {\n key: \"_getData\",\n value: function _getData(fn) {\n var _this = this;\n var cancelled = false;\n var cancel = function() {\n cancelled = true;\n };\n this.clc = cancel;\n return fn().then(function(data) {\n if (cancel === _this.clc) {\n _this.clc = null;\n }\n if (cancelled) {\n var err = new Error(\"Loading initial props cancelled\");\n err.cancelled = true;\n throw err;\n }\n return data;\n });\n }\n },\n {\n key: \"_getFlightData\",\n value: function _getFlightData(dataHref) {\n // Do not cache RSC flight response since it's not a static resource\n return fetchNextData({\n dataHref: dataHref,\n isServerRender: true,\n parseJSON: false,\n inflightCache: this.sdc,\n persistCache: false,\n isPrefetch: false\n }).then(function(param) {\n var text = param.text;\n return {\n data: text\n };\n });\n }\n },\n {\n key: \"getInitialProps\",\n value: function getInitialProps(Component, ctx) {\n var ref = this.components[\"/_app\"], App = ref.Component;\n var AppTree = this._wrapApp(App);\n ctx.AppTree = AppTree;\n return (0, _utils).loadGetInitialProps(App, {\n AppTree: AppTree,\n Component: Component,\n router: this,\n ctx: ctx\n });\n }\n },\n {\n key: \"route\",\n get: function get() {\n return this.state.route;\n }\n },\n {\n key: \"pathname\",\n get: function get() {\n return this.state.pathname;\n }\n },\n {\n key: \"query\",\n get: function get() {\n return this.state.query;\n }\n },\n {\n key: \"asPath\",\n get: function get() {\n return this.state.asPath;\n }\n },\n {\n key: \"locale\",\n get: function get() {\n return this.state.locale;\n }\n },\n {\n key: \"isFallback\",\n get: function get() {\n return this.state.isFallback;\n }\n },\n {\n key: \"isPreview\",\n get: function get() {\n return this.state.isPreview;\n }\n }\n ]);\n return Router;\n}();\nRouter.events = (0, _mitt).default();\nexports[\"default\"] = Router; //# sourceMappingURL=router.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3JvdXRlci5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTs7Ozs7Ozs7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCx5QkFBeUIsR0FBR0UsaUJBQWlCLENBQUM7QUFDOUNGLGtCQUFrQixHQUFHRyxVQUFVLENBQUM7QUFDaENILHFCQUFxQixHQUFHSSxhQUFhLENBQUM7QUFDdENKLG1CQUFtQixHQUFHSyxXQUFXLENBQUM7QUFDbENMLGlCQUFpQixHQUFHTSxTQUFTLENBQUM7QUF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ZXQucGF0aG5hbWUgPSBhcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHByb2Nlc3MuZW52Ll9fTkVYVF9IQVNfUkVXUklURVMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gKDAsIF9yZXNvbHZlUmV3cml0ZXMpLmRlZmF1bHQoYXMsIHBhZ2VzLCByZXdyaXRlcywgcGFyc2VkUmV3cml0ZVRhcmdldC5xdWVyeSwgKHBhdGgpPT5yZXNvbHZlRHluYW1pY1JvdXRlKHBhdGgsIHBhZ2VzKSwgb3B0aW9ucy5yb3V0ZXIubG9jYWxlcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQubWF0Y2hlZFBhZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlZFJld3JpdGVUYXJnZXQucGF0aG5hbWUgPSByZXN1bHQucGFyc2VkQXMucGF0aG5hbWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBhcyA9IHBhcnNlZFJld3JpdGVUYXJnZXQucGF0aG5hbWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKHBhcnNlZFJld3JpdGVUYXJnZXQucXVlcnksIHJlc3VsdC5wYXJzZWRBcy5xdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFwYWdlcy5pbmNsdWRlcyhmc1BhdGhuYW1lKSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCByZXNvbHZlZFBhdGhuYW1lID0gcmVzb2x2ZUR5bmFtaWNSb3V0ZShmc1BhdGhuYW1lLCBwYWdlcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXNvbHZlZFBhdGhuYW1lICE9PSBmc1BhdGhuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmc1BhdGhuYW1lID0gcmVzb2x2ZWRQYXRobmFtZTtcbiAgICAgICAg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LCB7XG4gICAgICAgICAgICAgICAgbmV4dENvbmZpZyxcbiAgICAgICAgICAgICAgICBwYXJzZURhdGE6IHRydWVcbiAgICAgICAgICAgIH0pLCB7XG4gICAgICAgICAgICAgICAgZGVmYXVsdExvY2FsZTogb3B0aW9ucy5yb3V0ZXIuZGVmYXVsdExvY2FsZSxcbiAgICAgICAgICAgICAgICBidWlsZElkOiAnJ1xuICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZSh7XG4gICAgICAgICAgICAgICAgdHlwZTogJ3JlZGlyZWN0LWludGVybmFsJyxcbiAgICAgICAgICAgICAgICBuZXdBczogYCR7cGF0aG5hbWV9JHtzcmMucXVlcnl9JHtzcmMuaGFzaH1gLFxuICAgICAgICAgICAgICAgIG5ld1VybDogYCR7cGF0aG5hbWV9JHtzcmMucXVlcnl9JHtzcmMuaGFzaH1gXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHtcbiAgICAgICAgICAgIHR5cGU6ICdyZWRpcmVjdC1leHRlcm5hbCcsXG4gICAgICAgICAgICBkZXN0aW5hdGlvbjogcmVkaXJlY3RUYXJnZXRcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoe1xuICAgICAgICB0eXBlOiAnbmV4dCdcbiAgICB9KTtcbn1cbmZ1bmN0aW9uIHdpdGhNaWRkbGV3YXJlRWZmZWN0cyhvcHRpb25zKSB7XG4gICAgcmV0dXJuIG1hdGNoZXNNaWRkbGV3YXJlKG9wdGlvbnMpLnRoZW4oKG1hdGNoZXMpPT57XG4gICAgICAgIGlmIChtYXRjaGVzICYmIG9wdGlvbnMuZmV0Y2hEYXRhKSB7XG4gICAgICAgICAgICByZXR1cm4gb3B0aW9ucy5mZXRjaERhdGEoKS50aGVuKChkYXRhKT0+Z2V0TWlkZGxld2FyZURhdGEoZGF0YS5kYXRhSHJlZiwgZGF0YS5yZXNwb25zZSwgb3B0aW9ucykudGhlbigoZWZmZWN0KT0+KHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFIcmVmOiBkYXRhLmRhdGFIcmVmLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVLZXk6IGRhdGEuY2FjaGVLZXksXG4gICAgICAgICAgICAgICAgICAgICAgICBqc29uOiBkYXRhLmpzb24sXG4gICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZTogZGF0YS5yZXNwb25zZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IGRhdGEudGV4dCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVmZmVjdFxuICAgICAgICAgICAgICAgICAgICB9KSkpLmNhdGNoKChfZXJyKT0+e1xuICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIFRPRE86IFJldmlzaXQgdGhpcyBpbiB0aGUgZnV0dXJlLlxuICAgICAgICAgICAqIEZvciBub3cgd2Ugd2lsbCBub3QgY29uc2lkZXIgbWlkZGxld2FyZSBkYXRhIGVycm9ycyB0byBiZSBmYXRhbC5cbiAgICAgICAgICAgKiBtYXliZSB3ZSBzaG91bGQgcmV2aXNpdCBpbiB0aGUgZnV0dXJlLlxuICAgICAgICAgICAqLyByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH0pO1xufVxuY29uc3QgbWFudWFsU2Nyb2xsUmVzdG9yYXRpb24gPSBwcm9jZXNzLmVudi5fX05FWFRfU0NST0xMX1JFU1RPUkFUSU9OICYmIHR5cGVvZiB3aW5kb3cgIT09ICd1bmRlZmluZWQnICYmICdzY3JvbGxSZXN0b3JhdGlvbicgaW4gd2luZG93Lmhpc3RvcnkgJiYgISFmdW5jdGlvbigpIHtcbiAgICB0cnkge1xuICAgICAgICBsZXQgdiA9ICdfX25leHQnO1xuICAgICAgICAvLyBlc2xp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bDtcbiAgICB9XG59XG5mdW5jdGlvbiBmZXRjaE5leHREYXRhKHsgZGF0YUhyZWYgLCBpbmZsaWdodENhY2hlICwgaXNQcmVmZXRjaCAsIGhhc01pZGRsZXdhcmUgLCBpc1NlcnZlclJlbmRlciAsIHBhcnNlSlNPTiAsIHBlcnNpc3RDYWNoZSAsIGlzQmFja2dyb3VuZCAsIHVuc3RhYmxlX3NraXBDbGllbnRDYWNoZSAgfSkge1xuICAgIGNvbnN0IHsgaHJlZjogY2FjaGVLZXkgIH0gPSBuZXcgVVJMKGRhdGFIcmVmLCB3aW5kb3cubG9jYXRpb24uaHJlZik7XG4gICAgdmFyIHJlZjE7XG4gICAgY29uc3QgZ2V0RGF0YSA9IChwYXJhbXMpPT57XG4gICAgICAgIHJldHVybiBmZXRjaFJldHJ5KGRhdGFIcmVmLCBpc1NlcnZlclJlbmRlciA/IDMgOiAxLCB7XG4gICAgICAgICAgICBoZWFkZXJzOiBpc1ByZWZldGNoID8ge1xuICAgICAgICAgICAgICAgIHB1cnBvc2U6ICdwcmVmZXRjaCdcbiAgICAgICAgICAgIH0gOiB7fSxcbiAgICAgICAgICAgIG1ldGhvZDogKHJlZjEgPSBwYXJhbXMgPT0gbnVsbCA/IHZvaWQgMCA6IHBhcmFtcy5tZXRob2QpICE9IG51bGwgPyByZWYxIDogJ0dFVCdcbiAgICAgICAgfSkudGhlbigocmVzcG9uc2UpPT57XG4gICAgICAgICAgICBpZiAocmVzcG9uc2Uub2sgJiYgKHBhcmFtcyA9PSBudWxsID8gdm9pZCAwIDogcGFyYW1zLm1ldGhvZCkgPT09ICdIRUFEJykge1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFIcmVmLFxuICAgICAgICAgICAgICAgICAgICByZXNwb25zZSxcbiAgICAgICAgICAgICAgICAgICAgdGV4dDogJycsXG4gICAgICAgICAgICAgICAgICAgIGpzb246IHt9LFxuICAgICAgICAgICAgICAgICAgICBjYWNoZUtleVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2UudGV4dCgpLnRoZW4oKHRleHQpPT57XG4gICAgICAgICAgICAgICAgaWYgKCFyZXNwb25zZS5vaykge1xuICAgICAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIFdoZW4gdGhlIGRhdGEgcmVzcG9uc2UgaXMgYSByZWRpcmVjdCBiZWNhdXNlIG9mIGEgbWlkZGxld2FyZVxuICAgICAgICAgICAgICogd2UgZG8gbm90IGNvbnNpZGVyIGl0IGFuIGVycm9yLiBUaGUgaGVhZGVycyBtdXN0IGJyaW5nIHRoZVxuICAgICAgICAgICAgICogbWFwcGVkIGxvY2F0aW9uLlxuICAgICAgICAgICAgICogVE9ETzogQ2hhbmdlIHRoZSBzdGF0dXMgY29kZSBpbiB0aGUgaGFuZGxlci5cbiAgICAgICAgICAgICAqLyBpZiAoaGFzTWlkZGxld2FyZSAmJiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAzMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAzMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAzMDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAzMDhcbiAgICAgICAgICAgICAgICAgICAgXS5pbmNsdWRlcyhyZXNwb25zZS5zdGF0dXMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFIcmVmLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoge30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVLZXlcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFoYXNNaWRkbGV3YXJlICYmIHJlc3BvbnNlLnN0YXR1cyA9PT0gNDA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVmO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChyZWYgPSB0cnlUb1BhcnNlQXNKU09OKHRleHQpKSA9PSBudWxsID8gdm9pZCAwIDogcmVmLm5vdEZvdW5kKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUhyZWYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdEZvdW5kOiBTU0dfREFUQV9OT1RfRk9VTkRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlS2V5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvciA9IG5ldyBFcnJvcihgRmFpbGVkIHRvIGxvYWQgc3RhdGljIHByb3BzYCk7XG4gICAgICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogV2Ugc2hvdWxkIG9ubHkgdHJpZ2dlciBhIHNlcnZlci1zaWRlIHRyYW5zaXRpb24gaWYgdGhpcyB3YXNcbiAgICAgICAgICAgICAqIGNhdXNlZCBvbiBhIGNsaWVudC1zaWRlIHRyYW5zaXRpb24uIE90aGVyd2lzZSwgd2UnZCBnZXQgaW50b1xuICAgICAgICAgICAgICogYW4gaW5maW5pdGUgbG9vcC5cbiAgICAgICAgICAgICAqLyBpZiAoIWlzU2VydmVyUmVuZGVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAoMCwgX3JvdXRlTG9hZGVyKS5tYXJrQXNzZXRFcnJvcihlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZXJyb3I7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFIcmVmLFxuICAgICAgICAgICAgICAgICAgICBqc29uOiBwYXJzZUpTT04gPyB0cnlUb1BhcnNlQXNKU09OKHRleHQpIDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UsXG4gICAgICAgICAgICAgICAgICAgIHRleHQsXG4gICAgICAgICAgICAgICAgICAgIGNhY2hlS2V5XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KS50aGVuKChkYXRhKT0+e1xuICAgICAgICAgICAgaWYgKCFwZXJzaXN0Q2FjaGUgfHwgcHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJyB8fCBkYXRhLnJlc3BvbnNlLmhlYWRlcnMuZ2V0KCd4LW1pZGRsZXdhcmUtY2FjaGUnKSA9PT0gJ25vLWNhY2hlJykge1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBpbmZsaWdodENhY2hlW2NhY2hlS2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBkYXRhO1xuICAgICAgICB9KS5jYXRjaCgoZXJyKT0+e1xuICAgICAgICAgICAgZGVsZXRlIGluZmxpZ2h0Q2FjaGVbY2FjaGVLZXldO1xuICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIC8vIHdoZW4gc2tpcHBpbmcgY2xpZW50IGNhY2hlIHdlIHdhaXQgdG8gdXBkYXRlX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aCkucmVtb3ZlQmFzZVBhdGgoYXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlSGFyZE5hdmlnYXRpb24oe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogYGh0dHAke2RldGVjdGVkRG9tYWluLmh0dHAgPyAnJyA6ICdzJ306Ly8ke2RldGVjdGVkRG9tYWluLmRvbWFpbn0keygwLCBfYWRkQmFzZVBhdGgpLmFkZEJhc2VQYXRoKGAke25leHRTdGF0ZS5sb2NhbGUgPT09IGRldGVjdGVkRG9tYWluLmRlZmF1bHRMb2NhbGUgPyAnJyA6IGAvJHtuZXh0U3RhdGUubG9jYWxlfWB9JHthc05vQmFzZVBhdGggPT09ICcvJyA/ICcnIDogYXNOb0Jhc2VQYXRofWAgfHwgJy8nKX1gLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdXRlcjogX3RoaXNcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyB3YXMgcHJldmlvdXNseSBhIHJldHVybiBidXQgd2FzIHJlbW92ZWQgaW4gZmF2b3JcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9mIGJldHRlciBkZWFkIGNvZGUgZWxpbWluYXRpb24gd2l0aCByZWdlbmVyYXRvciBydW50aW1lXG4gICAgICAgICAgICAgICAgICAgICAgICBkaWROYXZpZ2F0ZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGRpZE5hdmlnYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgoKT0+e30pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIG1hcmtpbmcgcm91dGUgY2hhbmdlcyBhcyBhIG5hdmlnYXRpb24gc3RhcnQgZW50cnlcbiAgICAgICAgICAgIGlmI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ICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgeWllbGQgX3RoaXMuc2V0KG5leHRTdGF0ZSwgX3RoaXMuY29tcG9uZW50c1tuZXh0U3RhdGUucm91dGVdLCBudWxsKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgwLCBfaXNFcnJvcikuZGVmYXVsdChlcnIpICYmIGVyci5jYW5jZWxsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFJvdXRlci5ldmVudHMuZW1pdCgncm91dGVDaGFuZ2VFcnJvcicsIGVyciwgY2xlYW5lZEFzLCByb3V0ZVByb3BzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIFJvdXRlci5ldmVudHMuZW1pdCgnaGFzaENoYW5nZUNvbXBsZXRlJywgYXMsIHJvdXRlUHJvcHMpO1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHBhcnNlZCA9ICgwLCBfcGFyc2VSZWxhdGl2ZVVybCkucGFyc2VSZWxhdGl2ZVVybCh1cmwpO1xuICAgICAgICAgICAgbGV0IHsgcGF0aG5hbWUgLCBxdWVyeSAgfSA9IHBhcnNlZDtcbiAgICAgICAgICAgIC8vIFRoZSBidWlsZCBtYW5pZmVzdCBuZWVkcyB0byBiZSBsb2FkZWQgYmVmb3JlIGF1dG8tc3RhdGljIGR5bmFtaWMgcGFnZXNcbiAgICAgICAgICAgIC8vIGdldCB0aGVpciBxdWVyeSBwYXJhbWV0ZXJzIHRvIGFsbG93IGVuc3VyaW5nIHRoZXkgY2FuIGJlIHBhcnNlZCBwcm9wZXJseVxuICAgICAgICAgICAgLy8gd2hlbiByZXdyaXR0ZW4gdG9cbiAgICAgICAgICAgIGxldCBwYWdlcywgcmV3cml0ZXM7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIFtwYWdlcywgeyBfX3Jld3JpdGVzOiByZXdyaXRlcyAgfV0gPSB5aWVsZCBQcm9taXNlLmFsbChbXG4gICAgICAgICAgICAgICAgICAgIF90aGlzLnBhZ2VMb2FkZXIuZ2V0UGFnZUxpc3QoKSxcbiAgICAgICAgICAgICAgICAgICAgKDAsIF9yb3V0ZUxvYWRlcikuZ2V0Q2xpZW50QnVpbGRNYW5pZmVzdCgpLFxuICAgICAgICAgICAgICAgICAgICBfdGhpcy5wYWdlTG9hZGVyLmdldE1pZGRsZXdhcmUoKSwgXG4gICAgICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgICAvLyBJZiB3ZSBmYWlsIHRvIHJlc29sdmUgdGhlIHBhZ2UgbGlzdCBvciBjbGllbnQtYnVpbGQgbWFuaWZlc3QsIHdlIG11c3RcbiAgICAgICAgICAgICAgICAvLyBkbyBhIHNlcnZlci1zaWRlIHRyYW5zaXRpb246XG4gICAgICAgICAgICAgICAgaGFuZGxlSGFyZE5hdmlnYXRpb24oe1xuICAgICAgICAgICAgICAgICAgICB1cmw6IGFzLFxuICAgICAgICAgICAgICAgICAgICByb3V0ZXI6IF90aGlzXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gSWYgYXNrZWQgdG8gY2hhbmdlIHRoZSBjdXJyZW50IFVSTCB3ZSBzaG91bGQgcmVsb2FkIHRoZSBjdXJyZW50IHBhZ2VcbiAgICAgICAgICAgIC8vIChub3QgbG9jYXRpb24ucmVsb2FkKCkgYnV0IHJlbG9hZCBnZXRJbml0aWFsUHJvcHMgYW5kIG90aGVyIE5leHQuanMgc3R1ZmZzKVxuICAgICAgICAgICAgLy8gV2UgYWxzbyBuZWVkIHRvIHNldCB0a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CB0cnVlKSwgcGFnZXMsIHJld3JpdGVzLCBxdWVyeSwgKHApPT5yZXNvbHZlRHluYW1pY1JvdXRlKHAsIHBhZ2VzKSwgX3RoaXMubG9jYWxlcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXdyaXRlc1Jlc3VsdC5leHRlcm5hbERlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUhhcmROYXZpZ2F0aW9uKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGFzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdXRlcjogX3RoaXNcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc01pZGRsZXdhcmVNYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZWRBcyA9IHJld3JpdGVzUmVzdWx0LmFzUGF0aDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAocmV3cml0ZXNSZXN1bHQubWF0Y2hlZFBhZ2UgJiYgcmV3cml0ZXNSZXN1bHQucmVzb2x2ZWRIcmVmKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGlzIGRpcmVjdGx5IG1hdGNoZXMgYSBwYWdlIHdlIG5lZWQgdG8gdXBkYXRlIHRoZSBocmVmIHRvXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBhbGxvdyB0aGUgY29ycmVjdCBwYWdlIGNodW5rIHRvIGJlIGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aG5hbWUgPSByZXdyaXRlc1Jlc3VsdC5yZXNvbHZlZEhyZWY7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZWQucGF0aG5hbWUgPSAoMCwgX2FkZEJhc2VQYXRoKS5hZGRCYXNlUGF0aChwYXRobmFtZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTWlkZGxld2FyZU1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gKDAsIF9mb3JtYXRVcmwpLmZvcm1hdFdpdGhWYWxpZGF0aW9uKHBhcnNlZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZWQucGF0aG5hbWUgPSByZXNvbHZlRHluYW1pY1JvdXRlKHBhdGhuYW1lLCBwYWdlcyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJzZWQucGF0aG5hbWUgIT09IHBhdGhuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRobmFtZSA9IHBhcnNlZC5wYXRobmFtZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlZC5wYXRobmFtZSA9ICgwLCBfYWRkQmFzZVBhdGgpLmFkZEJhc2VQYXRoKHBhdGhuYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNNaWRkbGV3YXJlTWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAoMCwgX2Zvcm1hdFVybCkuZm9ybWF0V2l0aFZhbGlkYXRpb24ocGFyc2VkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghaXNMb2NhbFVSTChhcykpIHtcbiAgICAgICAgICAgICAgICBpZiAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgaHJlZjogXCIke3V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gICAgICAgICAvLyBNZXJnZSBwYXJhbXMgaW50byBgcXVlcnlgLCBvdmVyd3JpdGluZyBhbnkgc3BlY2lmaWVkIGluIHNlYXJjaFxuICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKHF1ZXJ5LCByb3V0ZU1hdGNoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWlzUXVlcnlVcGRhdGluZykge1xuICAgICAgICAgICAgICAgIFJvdXRlci5ldmVudHMuZW1pdCgncm91dGVDaGFuZ2VTdGFydCcsIGFzLCByb3V0ZVByb3BzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFyIHJlZjIsIHJlZjM7XG4gICAgICAgICAgICAgICAgbGV0IHJvdXRlSW5mbyA9IHlpZWxkIF90aGlzLmdldFJvdXRlSW5mbyh7XG4gICAgICAgICAgICAgICAgICAgIHJvdXRlLFxuICAgICAgICAgICAgICAgICAgICBwYXRobmFtZSxcbiAgICAgICAgICAgICAgICAgICAgcXVlcnksXG4gICAgICAgICAgICAgICAgICAgIGFzLFxuICAgICAgICAgICAgICAgICAgICByZXNvbHZlZEFzLFxuICAgICAgICAgICAgICAgICAgICByb3V0ZVByb3BzLFxuICAgICAgICAgICAgICAgICAgICBsb2NhbGU6IG5leHRTdGF0ZS5sb2NhbGUsXG4gICAgICAgICAgICAgICAgICAgIGlzUHJldmlldzogbmV4dFN0YXRlLmlzUHJldmlldyxcbiAgICAgICAgICAgICAgICAgICAgaGFzTWlkZGxld2FyZTogaXNNaWRkbGV3YXJlTWF0Y2hcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBpZiAoJ3JvdXRlJyBpbiByb3V0ZUluZm8gJiYgaXNNaWRkbGV3YXJlTWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcGF0aG5hbWUgPSByb3V0ZUluZm8ucm91dGUgfHwgcm91dGU7XG4gICAgICAgICAgICAgICAgICAgIHJvdXRlID0gcGF0aG5hbWU7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm91dGVQcm9wcy5zaGFsbG93KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxdWVyeSA9IE9iamVjdC5hc3NpZ24oe30sIHJvdXRlSW5mby5xdWVyeSB8fCB7fSwgcXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNsZWFuZWRQYXJzZWRQYXRobmFtZSA9ICgwLCBfaGFzQmFzZVBhdGgpLmhhc0Jhc2VQYXRoKHBhcnNlZC5wYXRobmFtZSkgPyAoMCwgX3JlbW92ZUJhc2VQYXRoKS5yZW1vdmVCYXNlUGF0aChwYXJzZWQucGF0aG5hbWUpIDogcGFyc2VkLnBhdGhuYW1lO1xuICAgICAgICAgICAgICAgICAgICBpZiAocm91dGVNYXRjaCAmJiBwYXRobmFtZSAhPT0gY2xlYW5lZFBhcnNlZFBhdGhuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhyb3V0ZU1hdGNoKS5mb3JFYWNoKChrZXkpPT57XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJvdXRlTWF0Y2ggJiYgcXVlcnlba2V5XSA9PT0gcm91dGVNYXRjaFtrZXldKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBxdWVyeVtrZXldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoMCwgX2lzRHluYW1pYykuaXNEeW5hbWljUm91dGUocGF0aG5hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBwcmVmaXhlZEFzID0gIXJvdXRlUHJvcHMuc2hhbGxvdyAmJiByb3V0ZU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0ZVJlZ2V4KHBhdGhuYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGN1clJvdXRlTWF0Y2ggPSAoMCwgX3JvdXRlTWF0Y2hlcikuZ2V0Um91dGVNYXRjaGVyKHJvdXRlUmVnZXgpKHJld3JpdGVBcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VyUm91dGVNYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24ocXVlcnksIGN1clJvdXRlTWF0Y2gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIElmIHRoZSByb3V0ZUluZm8gYnJpbmdzIGEgcmVkaXJlY3Qgd2Ugc2ltcGx5IGFwcGx5IGl0LlxuICAgICAgICAgICAgICAgIGlmICgndHlwZScgaW4gcm91dGVJbmZvKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyb3V0ZUluZm8udHlwZSA9PT0gJ3JlZGlyZWN0LWludGVybmFsJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLmNoYW5nZShtZXRob2QsIHJvdXRlSW5mby5uZXdVcmwsIHJvdXRlSW5mby5uZXdBcywgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVIYXJkTmF2aWdhdGlvbih7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiByb3V0ZUluZm8uZGVzdGluYXRpb24sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcm91dGVyOiBfdGhpc1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKCk9Pnt9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsZXQgeyBlcnJvciAsIHByb3BzICwgX19OX1NTRyAsIF9fTl9TU1AgIH0gPSByb3V0ZUluZm87XG4gICAgICAgICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gcm91dGVJbmZvLkNvbXBvbmVudDtcbiAgICAgICAgICAgICAgICBpZiAoY29tcG9uZW50ICYmIGNvbXBvbmVudC51bnN0YWJsZV9zY3JpcHRMb2FkZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2NyaXB0cyA9IFtdLmNvbmNhdChjb21wb25lbnQudW5zdGFibGVfc2NyaXB0TG9hZGVyKCkpO1xuICAgICAgICAgICAgICAgICAgICBzY3JpcHRzLmZvckVhY2goKHNjcmlwdCk9PntcbiAgICAgICAgICAgICAgICAgICAgICAgICgwLCBfc2NyaXB0KS5oYW5kbGVDbGllbnRTY3JpcHRMb2FkKHNjcmlwdC5wcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBoYW5kbGUgcmVkaXJlY3Qgb24gY2xpZW50LXRyYW5zaXRpb25cbiAgICAgICAgICAgICAgICBpZiAoKF9fTl9TU0cgfHwgX19OX1NTUCkgJiYgcHJvcHMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByb3BzLnBhZ2VQcm9wcyAmJiBwcm9wcy5wYWdlUHJvcHMuX19OX1JFRElSRUNUKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBVc2UgdGhlIGRlc3RpbmF0aW9uIGZyb20gcmVkaXJlY3Qgd2l0aG91dCBhZGRpbmcgbG9jYWxlXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmxvY2FsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZGVzdGluYXRpb24gPSBwcm9wcy5wYWdlUHJvcHMuX19OX1JFRElSRUNUO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgZGVzdGluYXRpb24gaXMgaW50ZXJuYWwgKHJlc29sdmVzIHRvIGEgcGFnZSkgYW5kIGF0dGVtcHRcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNsaWVudC1uYXZpZ2F0aW9uIGlmIGl0IGlzIGZhbGxpbmcgYmFjayB0byBoYXJkIG5hdmlnYXRpb24gaWZcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGl0J3Mgbm90XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVzdGluYXRpb24uc3RhcnRzV2l0aCgnLycpICYmIHByb3BzLnBhZ2VQcm9wcy5fX05fUkVESVJFQ1RfQkFTRV9QQVRIICE9PSBmYWxzZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhcnNlZEhyZWYgPSAoMCwgX3BhcnNlUmVsYXRpdmVVcmwpLnBhcnNlUmVsYXRpdmVVcmwoZGVzdGluYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlZEhyZWYucGF0aG5hbWUgPSByZXNvbHZlRHluYW1pY1JvdXRlKHBhcnNlZEhyZWYucGF0aG5hbWUsIHBhZ2VzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB7IHVybDogbmV3VXJsICwgYXM6IG5ld0FzICB9ID0gcHJlcGFyZVVybEFzKF90aGlzLCBkZXN0aW5hdGlvbiwgZGVzdGluYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5jaGFuZ2UobWV0aG9kLCBuZXdVcmwsIG5ld0FzLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUhhcmROYXZpZ2F0aW9uKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGRlc3RpbmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdXRlcjogX3RoaXNcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKCgpPT57fSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmlzUHJldmlldyA9ICEhcHJvcHMuX19OX1BSRVZJRVc7XG4gICAgICAgICAgICAgICAgICAgIC8vIGhhbmRsZSBTU0cgZGF0YSA0MDRcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByb3BzLm5vdEZvdW5kID09PSBTU0dfREFUQV9OT1RfRk9VTkQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3RGb3VuZFJvdXRlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5aWVsZCBfdGhpcy5mZXRjaENvbXBvbmVudCgnLzQwNCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdEZvdW5kUm91dGUgPSAnLzQwNCc7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChfKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm90Rm91bmRSb3V0ZSA9ICcvX2Vycm9yJztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJvdXRlSW5mbyA9IHlpZWxkIF90aGlzLmdldFJvdXRlSW5mbyh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcm91dGU6IG5vdEZvdW5kUm91dGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aG5hbWU6IG5vdEZvdW5kUm91dGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVlcnksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZWRBcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3V0ZVByb3BzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYWxsb3c6IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGU6IG5leHRTdGF0ZS5sb2NhbGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmV2aWV3OiBuZXh0U3RhdGUuaXNQcmV2aWV3XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgndHlwZScgaW4gcm91dGVJbmZvKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBVbmV4cGVjdGVkIG1pZGRsZXdhcmUgZWZmZWN0IG9uIC80MDRgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBSb3V0ZXIuZXZlbnRzLmVtaXQoJ2JlZm9yZUhpc3RvcnlDaGFuZ2UnLCBhcywgcm91dGVQcm9wcyk7XG4gICAgICAgICAgICAgICAgX3RoaXMuY2hhbmdlU3RhdGUobWV0aG9kLCB1cmwsIGFzLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICBpZiAoaXNRdWVyeVVwZGF0aW5nICYmIHBhdGhuYW1lID09PSAnL19lcnJvcicgJiYgKChyZWYyID0gc2VsZi5fX05FWFRfREFUQV9fLnByb3BzKSA9PSBudWxsID8gdm9pZCAwIDogKHJlZjMgPSByZWYyLnBhZ2VQcm9wcykgPT0gbnVsbCA/IHZvaWQgMCA6IHJlZjMuc3RhdHVzQ29kZSkgPT09IDUwMCAmJiAocHJvcHMgPT0gbnVsbCA/IHZvaWQgMCA6IHByb3BzLnBhZ2VQcm9wcykpIHtcbiAgICAgICAgICAgICAg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gICAgICAgICAgICAgICAgICAgIGlmIChlLmNhbmNlbGxlZCkgZXJyb3IgPSBlcnJvciB8fCBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzUXVlcnlVcGRhdGluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJvdXRlci5ldmVudHMuZW1pdCgncm91dGVDaGFuZ2VFcnJvcicsIGVycm9yLCBjbGVhbmVkQXMsIHJvdXRlUHJvcHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgZXJyb3I7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHByb2Nlc3MuZW52Ll9fTkVYVF9JMThOX1NVUFBPUlQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0U3RhdGUubG9jYWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmxhbmcgPSBuZXh0U3RhdGUubG9jYWxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghaXNRdWVyeVVwZGF0aW5nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBSb3V0ZXIuZXZlbnRzLmVtaXQoJ3JvdXRlQ2hhbmdlQ29tcGxldGUnLCBhcywgcm91dGVQcm9wcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gQSBoYXNoIG1hcmsgIyBpcyB0aGUgb3B0aW9uYWwgbGFzdCBwYXJ0IG9mIGEgVVJMXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGhhc2hSZWdleCA9IC8jLiskLztcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNob3VsZFNjcm9sbCAmJiBoYXNoUmVnZXgudGVzdChhcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnNjcm9sbFRvSGFzaChhcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnIxKSB7XG4gICAgICAgICAgICAgICAgaWYgKCgwLCBfaXNFcnJvcikuZGVmYXVsdChlcnIxKSAmJiBlcnIxLmNhbmNlbGxlZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRocm93IGVycjE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pKCk7XG4gICAgfVxuICAgIGNoYW5nZVN0YXRlKG1ldGhvZCwgdXJsLCBhcywgb3B0aW9ucyA9IHt9KSB7XG4gICAgICAgIGlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHdpbmRvdy5oaXN0b3J5ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoYFdhcm5pbmc6IHdpbmRvdy5oaXN0b3J5IGlzIG5vdCBhdmFpbGFibGUuYCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiB3aW5kb3cuaGlzdG9yeVttZXRob2RdID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoYFdhcm5pbmc6IHdpbmRvdy5oaXN0b3J5LiR7bWV0aG9kfSBpcyBub3QgYXZhaWxhYmxlYCk7XG4gICAgICAgICAg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Z2VuZXJhdG9yKGZ1bmN0aW9uKigpIHtcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyKTtcbiAgICAgICAgICAgIGlmIChlcnIuY2FuY2VsbGVkKSB7XG4gICAgICAgICAgICAgICAgLy8gYnViYmxlIHVwIGNhbmNlbGxhdGlvbiBlcnJvcnNcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoKDAsIF9yb3V0ZUxvYWRlcikuaXNBc3NldEVycm9yKGVycikgfHwgbG9hZEVycm9yRmFpbCkge1xuICAgICAgICAgICAgICAgIFJvdXRlci5ldmVudHMuZW1pdCgncm91dGVDaGFuZ2VFcnJvcicsIGVyciwgYXMsIHJvdXRlUHJvcHMpO1xuICAgICAgICAgICAgICAgIC8vIElmIHdlIGNhbid0IGxvYWQgdGhlIHBhZ2UgaXQgY291bGQgYmUgb25lIG9mIGZvbGxvd2luZyByZWFzb25zXG4gICAgICAgICAgICAgICAgLy8gIDEuIFBhZ2UgZG9lc24ndCBleGlzdHNcbiAgICAgICAgICAgICAgICAvLyAgMi4gUGFnZSBkb2VzIGV4aXN0IGluIGEgZGlmZmVyZW50IHpvbmVcbiAgICAgICAgICAgICAgICAvLyAgMy4gSW50ZXJuYWwgZXJyb3Igd2hpbGUgbG9hZGluZyB0aGUgcGFnZVxuICAgICAgICAgICAgICAgIC8vIFNvLCBkb2luZyBhIGhhcmQgcmVsb2FkIGlzIHRoZSBwcm9wZXIgd2F5IHRvIGRlYWwgd2l0aCB0aGlzLlxuICAgICAgICAgICAgICAgIGhhbmRsZUhhcmROYXZpZ2F0aW9uKHtcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBhcyxcbiAgICAgICAgICAgICAgICAgICAgcm91dGVyOiBfdGhpc1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIC8vIENoYW5naW5nIHRoZSBVUkwgZG9lc24ndCBibG9jayBleGVjdXRpbmcgdGhlIGN1cnJlbnQgY29kZSBwYXRoLlxuICAgICAgICAgICAgICAgIC8vIFNvIGxldCdzIHRocm93IGEgY2FuY2VsbGF0aW9uIGVycm9yIHN0b3AgdGhlIHJvdXRpbmcgbG9naWMuXG4gICAgICAgICAgICAgICAgdGhyb3cgYnVpbGRDYW5jZWxsYXRpb25FcnJvcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBsZXQgcHJvcHM7XG4gICAgICAgICAgICAgICAgY29uc3QgeyBwYWdlOiBDb21wb25lbnQgLCBzdHlsZVNoZWV0cyAgfSA9IHlpZWxkIF90aGlzLmZldGNoQ29tcG9uZW50KCcvX2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgY29uc3Qgcm91dGVJbmZvID0ge1xuICAgICAgICAgICAgICAgICAgICBwcm9wcyxcbiAgICAgICAgICAgICAgICAgICAgQ29tcG9uZW50LFxuICAgICAgICAgICAgICAgICAgICBzdHlsZVNoZWV0cyxcbiAgICAgICAgICAgICAgICAgICAgZXJyLFxuICAgICAgICAgICAgICAgICAgICBlcnJvcjogZXJyXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoIXJvdXRlSW5mby5wcm9wcykge1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcm91dGVJbmZvLnByb3BzID0geWllbGQgX3RoaXMuZ2V0SW5pdGlhbFByb3BzKENvbXBvbmVudCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRobmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWVyeVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGdpcEVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignRXJyb3IgaW4gZX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IGZvciBpdCBhbmQgYXZvaWQgcmUtcmVxdWVzdGluZyBldmVyeSB0aW1lXG4gICAgICogZm9yIHNoYWxsb3cgcm91dGluZyBwdXJwb3Nlcy5cbiAgICAgKi8gbGV0IHJvdXRlID0gcmVxdWVzdGVkUm91dGU7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHZhciByZWYsIHJlZjQsIHJlZjU7XG4gICAgICAgICAgICAgICAgY29uc3QgaGFuZGxlQ2FuY2VsbGVkID0gZ2V0Q2FuY2VsbGVkSGFuZGxlcih7XG4gICAgICAgICAgICAgICAgICAgIHJvdXRlLFxuICAgICAgICAgICAgICAgICAgICByb3V0ZXI6IF90aGlzXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgbGV0IGV4aXN0aW5nSW5mbyA9IF90aGlzLmNvbXBvbmVudHNbcm91dGVdO1xuICAgICAgICAgICAgICAgIGlmIChyb3V0ZVByb3BzLnNoYWxsb3cgJiYgZXhpc3RpbmdJbmZvICYmIF90aGlzLnJvdXRlID09PSByb3V0ZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXhpc3RpbmdJbmZvO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaGFzTWlkZGxld2FyZSkge1xuICAgICAgICAgICAgICAgICAgICBleGlzdGluZ0luZm8gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxldCBjYWNoZWRSb3V0ZUluZm8gPSBleGlzdGluZ0luZm8gJiYgISgnaW5pdGlhbCcgaW4gZXhpc3RpbmdJbmZvKSAmJiBwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ2RldmVsb3BtZW50JyA/IGV4aXN0aW5nSW5mbyA6IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBjb25zdCBmZXRjaE5leHREYXRhUGFyYW1zID0ge1xuICAgICAgICAgICAgICAgICAgICBkYXRhSHJlZjogX3RoaXMucGFnZUxvYWRlci5nZXREYXRhSHJlZih7XG4gICAgICAgICAgICAgICAgICAgICAgICBocmVmOiAoMCwgX2Zvcm1hdFVybCkuZm9ybWF0V2l0aFZhbGlkYXRpb24oe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhuYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXJ5XG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNraXBJbnRlcnBvbGF0aW9uOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgYXNQYXRoOiByZXNvbHZlZEFzLFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxlXG4gICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICBoYXNNaWRkbGV3YXJlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBpc1NlcnZlclJlbmRlcjogX3RoaXMuaXNTc3IsXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlSlNPTjogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgaW5mbGlnaHRDYWNoZTogX3RoaXMuc2RjLFxuICAgICAgICAgICAgICAgICAgICBwZXJzaXN0Q2FjaGU6ICFpc1ByZXZpZXcsXG4gICAgICAgICAgICAgICAgICAgIGlzUHJlZmV0Y2g6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICB1bnN0YWJsZV9za2lwQ2xpZW50Q2FjaGVcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSB5aWVsZCB3aXRoTWlkZGxld2FyZUVmZmVjdHMoe1xuICAgICAgICAgICAgICAgICAgICBmZXRjaERhdGE6ICgpPT5mZXRjaE5leHREYXRhKGZldGNoTmV4dERhdGFQYXJhbXMpLFxuICAgICAgICAgICAgICAgICAgICBhc1BhdGg6IHJlc29sdmVkQXMsXG4gICAgICAgICAgICAgICAgICAgIGxvY2FsZTogbG9jYWxlLFxuICAgICAgICAgICAgICAgICAgICByb3V0ZXI6IF90aGlzXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgaGFuZGxlQ2FuY2VsbGVkKCk7XG4gICAgICAgICAgICAgICAgaWYgKChkYXRhID09IG51bGwgPyB2b2lkIDAgOiAocmVmID0gZGF0YS5lZmZlY3QpID09IG51bGwgPyB2b2lkIDAgOiByZWYudHlwZSkgPT09ICdyZWRpcmVjdC1pbnRlcm5hbCcgfHwgKGRhdGEgPT0gbnVsbCA/IHZvaWQgMCA6IChyZWY0ID0gZGF0YS5lZmZlY3QpID09IG51bGwgPyB2b2lkIDAgOiByZWY0LnR5cGUpID09PSAncmVkaXJlY3QtZXh0ZXJuYWwnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXRhLmVmZmVjdDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChkYXRhID09IG51bGwgPyB2b2lkIDAgOiAocmVmNSA9IGRhdGEuZWZmZWN0KSA9PSBudWxsID8gdm9pZCAwIDogcmVmNS50eXBlKSA9PT0gJ3Jld3JpdGUnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJvdXRlID0gKDAsIF9yZW1vdmVUcmFpbGluZ1NsYXNoKS5yZW1vdmVUcmFpbGluZ1NsYXNoKGRhdGEuZWZmZWN0LnJlc29sdmVkSHJlZik7XG4gICAgICAgICAgICAgICAgICAgIHBhdGhuYW1lID0gZGF0YS5lZmZlY3QucmVzb2x2ZWRIcmVmO1xuICAgICAgICAgICAgICAgICAgICBxdWVyeSA9IF9leHRlbmRzKHt9LCBxdWVyeSwgZGF0YS5lZmZlY3QucGFyc2VkQXMucXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlZEFzID0gKDAsIF9yZW1vdmVCYXNlUGF0aCkucmVtb3ZlQmFzZVBhdGgoKDAsIF9ub3JtYWxpemVMb2NhbGVQYXRoKS5ub3JtYWxpemVMb2NhbGVQYXRoKGRhdGEuZWZmZWN0LnBhcnNlZEFzLnBhdGhuYW1lLCBfdGhpcy5sb2NhbGVzKS5wYXRobmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIC8vIENoZWNrIGFnYWluIHRoZSBjYWNoZSB3aXRoIHRoZSBuZXcgZGVzdGluYXRpb24uXG4gICAgICAgICAgICAgICAgICAgIGV4aXN0aW5nSW5mbyA9IF90aGlzLmNvbXBvbmVudHNbcm91dGVdO1xuICAgICAgICAgICAgICAgICAgICBpZiAocm91dGVQcm9wcy5zaGFsbG93ICYmIGV4aXN0aW5nSW5mbyAmJiBfdGhpcy5yb3V0ZSA9PT0gcm91dGUgJiYgIWhhc01pZGRsZXdhcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHdlIGhhdmUgYSBtYXRjaCB3aXRoIHRoZSBjdXJyZW50IHJvdXRlIGR1ZSB0byByZXdyaXRlLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgY2FuIGNvcHkgdGhlIGV4aXN0aW5nIGluZm9ybWF0aW9uIHRvIHRoZSByZXdyaXR0ZW4gb25lLlxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlbiwgd2UgcmV0dXJuIHRoZSBpbmZvcm1hdGlvbiBhbG9uZyB3aXRoIHRoZSBtYXRjaGVkIHJvdXRlLlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9leHRlbmRzKHt9LCBleGlzdGluZ0luZm8sIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3V0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHJvdXRlID09PSAnL2FwaScgfHwgcm91dGUuc3RhcnRzV2l0aCgnL2FwaS8nKSkge1xuICAgICAgICAgICAgICAgICAgICBoYW5kbGVIYXJkTmF2aWdhdGlvbih7XG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGFzLFxuICAgICAgICAgICAgICAgICAgICAgICAgcm91dGVyOiBfdGhpc1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKCgpPT57fSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IHJvdXRlSW5mbyA9IGNhY2hlZFJvdXRlSW5mbyB8fCAoeWllbGQgX3RoaXMuZmV0Y2hDb21wb25lbnQocm91dGUpLnRoZW4oKHJlcyk9Pih7XG4gICAgICAgICAgICAgICAgICAgICAgICBDb21wb25lbnQ6IHJlcy5wYWdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGVTaGVldHM6IHJlcy5zdHlsZVNoZWV0cyxcbiAgICAgICAgICAgICAgICAgICAgICAgIF9fTl9TU0c6IHJlcy5tb2QuX19OX1NTRyxcbiAgICAgICAgICAgICAgICAgICAgICAgIF9fTl9TU1A6IHJlcy5tb2QuX19OX1NTUFxuICAgICAgICAgICAgICAgICAgICB9KSkpO1xuICAgICAgICAgICAgICAgIGlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHsgaXNWYWxpZEVsZW1lbnRUeXBlICB9ID0gcmVxdWlyZSgnbmV4dC9kaXN0L2NvbXBpbGVkL3JlYWN0LWlzJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghaXNWYWxpZEVsZW1lbnRUeXBlKHJvdXRlSW5mby5Db21wb25lbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFRoZSBkZWZhdWx0IGV4cG9ydCBpcyBub3QgYSBSZWFjdCBDb21wb25lbnQgaW4gcGFnZTogXCIke3BhdGhuYW1lfVwiYCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29uc3Qgc2hvdWxkRmV0Y2hEYXRhID0gcm91dGVJbmZvLl9fTl9TU0cgfHwgcm91dGVJbmZvLl9fTl9TU1A7XG4gICAgICAgICAgICAgICAgY29uc3QgeyBwcm9wcyAsIGNhY2hlS2V5ICB9ID0geWllbGQgX3RoaXMuX2dldERhdGEoX2FzeW5jX3RvX2dlbmVyYXRvcihmdW5jdGlvbiooKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzaG91bGRGZXRjaERhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHsganNvbiAsIGNhY2hlS2V5OiBfY2FjaGVLZXkgIH0gPSAoZGF0YSA9PSBudWxsID8gdm9pZCAwIDogZGF0YS5qc29uKSA/IGRhdGEgOiB5aWVsZCBmZXRjaE5leHREYXRhKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhSHJlZjogX3RoaXMucGFnZUxvYWRlci5nZXREYXRhSHJlZih7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhyZWY6ICgwLCBfZm9ybWF0VXJsKS5mb3JtYXRXaXRoVmFsaWRhdGlvbih7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRobmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXJ5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc1BhdGg6IHJlc29sdmVkQXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzU2VydmVyUmVuZGVyOiBfdGhpcy5pc1NzcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZUpTT046IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5mbGlnaHRDYWNoZTogX3RoaXMuc2RjLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcnNpc3RDYWNoZTogIWlzUHJldmlldyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1ByZWZldGNoOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnN0YWJsZV9za2lwQ2xpZW50Q2FjaGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZUtleTogX2NhY2hlS2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BzOiBqc29uIHx8IHt9XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlS2V5OiAnJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3BzOiB5aWVsZCBfdGhpcy5nZXRJbml0aWFsUHJvcHMocm91dGVJbmZvLkNvbXBvbmVudCwgLy8gd2UgcHJvdmlkZSBBcHBUcmVlIGxhdGVyIHNvIHRoaXMgbmVlZHMgdG8gYmUgYGFueWBcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRobmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc1BhdGg6IGFzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGVzOiBfdGhpcy5sb2NhbGVzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRMb2NhbGU6IF90aGlzLmRlZmF1bHRMb2NhbGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgIC8vIE9ubHkgYnVzdCB0aGUgZGF0YSBjYWNoZSBmb3IgU1NQIHJvdXRlcyBhbHRob3VnaFxuICAgICAgICAgICAgICAgIC8vIG1pZGRsZXdhcmUgY2FuIHNraXAgY2FjaGUgcGVyIHJlcXVlc3Qgd2l0aFxuICAgICAgICAgICAgICAgIC8vIHgtbWlkZGxld2FyZS1jYWNoZTogbm8tY2FjaGUgYXMgd2VsbFxuICAgICAgICAgICAgICAgIGlmIChyb3V0ZUluZm8uX19OX1NTUCAmJiBmZXRjaE5leHREYXRhUGFyYW1zLmRhdGFIcmVmKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBfdGhpcy5zZGNbY2FjaGVLZXldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyB3ZSBraWNrIG9mZiBhIEhFQUQgcmVxdWVzdCBpbiB0aGUgYmFja2dyb3VuZFxuICAgICAgICAgICAgICAgIC8vIHdoZW4gYSBub24tcHJlZmV0Y2ggcmVxdWVzdCBpcyBtYWRlIHRvIHNpZ25hbCByZXZhbGlkYXRpb25cbiAgICAgICAgICAgICAgICBpZiAoIV90aGlzLmlzUHJldmlldyAmJiByb3V0ZUluZm8uX19OX1NTRyAmJiBwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ2RldmVsb3BtZW50Jykge1xuICAgICAgICAgICAgICAgICAgICBmZXRjaE5leHREYXRhKE9iamVjdC5hc3NpZ24oe30sIGZldGNoTmV4dERhdGFQYXJhbXMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlzQmFja2dyb3VuZDogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBlcnNpc3RDYWNoZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmZsaWdodENhY2hlOiBiYWNrZ3JvdW5kQ2FjaGVcbiAgICAgICAgICAgICAgICAgICAgfSkpLmNhdGNoKCgpPT57fSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHByb3BzLnBhZ2VQcm9wcyA9IE9iamVjdC5hc3NpZ24oe30sIHByb3BzLnBhZ2VQcm9wcyk7XG4gICAgICAgICAgICAgICAgcm91dGVJbmZvLnByb3BzID0gcHJvcHM7XG4gICAgICAgICAgICAgICAgcm91dGVJbmZvLnJvdXRlID0gcm91dGU7XG4gICAgICAgICAgICAgICAgcm91dGVJbmZvLnF1ZXJ5ID0gcXVlcnk7XG4gICAgICAgICAgICAgICAgcm91dGVJbmZvLnJlc29sdmVkQXMgPSByZXNvbHZlZEFzO1xuICAgICAgICAgICAgICAgIF90aGlzLmNvbXBvbmVudHNbcm91dGVdID0gcm91dGVJbmZvO1xuICAgICAgICAgICAgICAgIHJldHVybiByb3V0ZUluZm87XG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX3RoaXMuaGFuZGxlUm91dGVJbmZvRXJyb3IoKDAsIF9pc0Vycm9yKS5nZXRQcm9wZXJFcnJvcihlcnIpLCBwYXRobmFtZSwgcXVlcnksIGFzLCByb3V0ZVByb3BzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSkoKTtcbiAgICB9XG4gICAgc2V0KHN0YXRlLCBkYXRhLCByZXNldFNjcm9sbCkge1xuICAgICAgICB0aGlzLnN0YXRlID0gc3RhdGU7XG4gICAgICAgIHJldHVybiB0aGlzLnN1YihkYXRhLCB0aGlzLmNvbXBvbmVudHNbJy9fYXBwJ10uQ29tcG9uZW50LCByZXNldFNjcm9sbCk7XG4gICAgfVxuICAgIC8qKlxuICAgKiBDYWxsYmFjayB0byBleGVjdXRlIGJlZm9yZSByZXBsYWNpbmcgcm91dGVyIHN0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b2FkZXIuX2lzU3NnKHJvdXRlKS50aGVuKChpc1NzZyk9PntcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlzU3NnID8gZmV0Y2hOZXh0RGF0YSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhSHJlZjogX3RoaXMucGFnZUxvYWRlci5nZXREYXRhSHJlZih7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaHJlZjogdXJsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzUGF0aDogcmVzb2x2ZWRBcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGU6IGxvY2FsZVxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgICBpc1NlcnZlclJlbmRlcjogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZUpTT046IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmZsaWdodENhY2hlOiBfdGhpcy5zZGMsXG4gICAgICAgICAgICAgICAgICAgICAgICBwZXJzaXN0Q2FjaGU6ICFfdGhpcy5pc1ByZXZpZXcsXG4gICAgICAgICAgICAgICAgICAgICAgICBpc1ByZWZldGNoOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgdW5zdGFibGVfc2tpcENsaWVudENhY2hlOiBvcHRpb25zLnVuc3RhYmxlX3NraXBDbGllbnRDYWNoZSB8fCBvcHRpb25zLnByaW9yaXR5ICYmICEhcHJvY2Vzcy5lbnYuX19ORVhUX09QVElNSVNUSUNfQ0xJRU5UX0NBQ0hFXG4gICAgICAgICAgICAgICAgICAgIH0pLnRoZW4oKCk9PmZhbHNlKSA6IGZhbHNlO1xuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgIF90aGlzLnBhZ2VMb2FkZXJbb3B0aW9ucy5wcmlvcml0eSA/ICdsb2FkUGFnZScgOiAncHJlZmV0Y2gnXShyb3V0ZSksIFxuICAgICAgICAgICAgXSk7XG4gICAgICAgIH0pKCk7XG4gICAgfVxuICAgIGZldGNoQ29tcG9uZW50KHJvdXRlKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHJldHVybiBfYXN5bmNfdG9fZ2VuZXJhdG9yKGZ1bmN0aW9uKigpIHtcbiAgICAgICAgICAgIGNvbnN0IGhhbmRsZUNhbmNlbGxlZCA9IGdldENhbmNlbGxlZEhhbmRsZXIoe1xuICAgICAgICAgICAgICAgIHJvdXRlLFxuICAgICAgICAgICAgICAgIHJvdXRlcjogX3RoaXNcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBjb25zdCBjb21wb25lbnRSZXN1bHQgPSB5aWVsZCBfdGhpcy5wYWdlTG9hZGVyLmxvYWRQYWdlKHJvdXRlKTtcbiAgICAgICAgICAgICAgICBoYW5kbGVDYW5jZWxsZWQoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29tcG9uZW50UmVzdWx0O1xuICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICAgICAgaGFuZGxlQ2FuY2VsbGVkKCk7XG4gICAgICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KSgpO1xuICAgIH1cbiAgICBfZ2V0RGF0YShmbikge1xuICAgICAgICBsZXQgY2FuY2VsbGVkID0gZmFsc2U7XG4gICAgICAgIGNvbnN0IGNhbmNlbCA9ICgpPT57XG4gICAgICAgICAgICBjYW5jZWxsZWQgPSB0cnVlO1xuICAgICAgICB9O1xuICAgICAgICB0aGlzLmNsYyA9IGNhbmNlbDtcbiAgICAgICAgcmV0dXJuIGZuKCkudGhlbigoZGF0YSk9PntcbiAgICAgICAgICAgIGlmIChjYW5jZWwgPT09IHRoaXMuY2xjKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jbGMgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGNhbmNlbGxlZCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGVyciA9IG5ldyBFcnJvcignTG9hZGluZyBpbml0aWFsIHByb3BzIGNhbmNlbGxlZCcpO1xuICAgICAgICAgICAgICAgIGVyci5jYW5jZWxsZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBkYXRhO1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgX2dldEZsaWdodERhdGEoZGF0YUhyZWYpIHtcbiAgICAgICAgLy8gRG8gbm90IGNhY2hlIFJTQyBmbGlnaHQgcmVzcG9uc2Ugc2luY2UgaXQncyBub3QgYSBzdGF0aWMgcmVzb3VyY2VcbiAgICAgICAgcmV0dXJuIGZldGNoTmV4dERhdGEoe1xuICAgICAgICAgICAgZGF0YUhyZWYsXG4gICAgICAgICAgICBpc1NlcnZlclJlbmRlcjogdHJ1ZSxcbiAgICAgICAgICAgIHBhcnNlSlNPTjogZmFsc2UsXG4gICAgICAgICAgICBpbmZsaWdodENhY2hlOiB0aGlzLnNkYyxcbiAgICAgICAgICAgIHBlcnNpc3RDYWNoZTogZmFsc2UsXG4gICAgICAgICAgICBpc1ByZWZldGNoOiBmYWxzZVxuICAgICAgICB9KS50aGVuKCh7IHRleHQgIH0pPT4oe1xuICAgICAgICAgICAgICAgIGRhdGE6IHRleHRcbiAgICAgICAgICAgIH0pKTtcbiAgICB9XG4gICAgZ2V0SW5pdGlhbFByb3BzKENvbXBvbmVudCwgY3R4KSB7XG4gICAgICAgIGNvbnN0IHsgQ29tcG9uZW50OiBBcHAgIH0gPSB0aGlzLmNvbXBvbmVudHNbJy9fYXBwJ107XG4gICAgICAgIGNvbnN0IEFwcFRyZWUgPSB0aGlzLl93cmFwQXBwKEFwcCk7XG4gICAgICAgIGN0eC5BcHBUcmVlID0gQXBwVHJlZTtcbiAgICAgICAgcmV0dXJuICgwLCBfdXRpbHMpL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2luZyB0aGUgZm9sbG93aW5nIGZvciAoMSkgZG9lcyBubyBoYXJtLlxuICAgICAgICAgICAgICAgIGNvbnN0IHsgcGF0aG5hbWUgLCBxdWVyeSAgfSA9IHRoaXM7XG4gICAgICAgICAgICAgICAgdGhpcy5jaGFuZ2VTdGF0ZSgncmVwbGFjZVN0YXRlJywgKDAsIF9mb3JtYXRVcmwpLmZvcm1hdFdpdGhWYWxpZGF0aW9uKHtcbiAgICAgICAgICAgICAgICAgICAgcGF0aG5hbWU6ICgwLCBfYWRkQmFzZVBhdGgpLmFkZEJhc2VQYXRoKHBhdGhuYW1lKSxcbiAgICAgICAgICAgICAgICAgICAgcXVlcnlcbiAgICAgICAgICAgICAgICB9KSwgKDAsIF91dGlscykuZ2V0VVJMKCkpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIF9fTkEgaXMgdXNlZCB0byBpZGVudGlmeSBpZiB0aGUgaGlzdG9yeSBlbnRyeSBjYW4gYmUgaGFuZGxlZCBieSB0aGUgYXBwLXJvdXRlci5cbiAgICAgICAgICAgIGlmIChzdGF0ZS5fX05BKSB7XG4gICAgICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLnJlbG9hZCgpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghc3RhdGUuX19OKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gU2FmYXJpIGZpcmVzIHBvcHN0YXRlZXZlbnQgd2hlbiByZW9wZW5pbmcgdGhlIGJyb3dzZXIuXG4gICAgICAgICAgICBpZiAoaXNGaXJzdFBvcFN0YXRlRXZlbnQgJiYgdGhpcy5sb2NhbGUgPT09IHN0YXRlLm9wdGlvbnMubG9jYWxlICYmIHN0YXRlLmFzID09PSB0aGlzLmFzUGF0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBmb3JjZWRTY3JvbGw7XG4gICAgICAgICAgICBjb25zdCB7IHVybCAsIGFzICwgb3B0aW9ucyAsIGtleSAgfSA9IHN0YXRlO1xuICAgICAgICAgICAgaWYgKHByb2Nlc3MuZW52Ll9fTkVYVF9TQ1JPTExfUkVTVE9SQVRJT04pIHtcbiAgICAgICAgICAgICAgICBpZiAobWFudWFsU2Nyb2xsUmVzdG9yYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2tleSAhPT0ga2V5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBTbmFwc2hvdCBjdXJyZW50IHNjcm9sbCBwb3NpdGlvbjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvblN0b3JhZ2Uuc2V0SXRlbSgnX19uZXh0X3Njcm9sbF8nICsgdGhpcy5fa2V5LCBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHg6IHNlbGYucGFnZVhPZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHk6IHNlbGYucGFnZVlPZmZzZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVzdG9yZSBvbGQgc2Nyb2xsIHBvc2l0aW9uOlxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2ID0gc2Vzc2lvblN0b3JhZ2UuZ2V0SXRlbSgnX19uZXh0X3Njcm9sbF8nICsga2V5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JjZWRTY3JvbGwgPSBKU09OLnBhcnNlKHYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JjZWRTY3JvbGwgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHg6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHk6IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5fa2V5ID0ga2V5O1xuICAgICAgICAgICAgY29uc3QgeyBwYXRobmFtZSAgfSA9ICgwLCBfcGFyc2VSZWxhdGl2ZVVybCkucGFyc2VSZWxhdGl2ZVVybCh1cmwpO1xuICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHdlIGRvbid0IHJlLXJlbmRlciBvbiBpbml0aWFsIGxvYWQsXG4gICAgICAgICAgICAvLyBjYW4gYmUgY2F1c2VkIGJ5IG5hdmlnYXRpbmcgYmFjayBmcm9tIGFuIGV4dGVybmFsIHNpdGVcbiAgICAgICAgICAgIGlmICh0aGlzLmlzU3NyICYmIGFzID09PSAoMCwgX2FkZEJhc2VQYXRoKS5hZGRCYXNlUGF0aCh0aGlzLmFzUGF0aCkgJiYgcGF0aG5hbWUgPT09ICgwLCBfYWRkQmFzZVBhdGgpLmFkZEJhc2VQYXRoKHRoaXMucGF0aG5hbWUpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gSWYgdGhlIGRvd25zdHJlYW0gYXBwbGljYXRpb24gcmV0dXJucyBmYWxzeSwgcmV0dXJuLlxuICAgICAgICAgICAgLy8gVGhleSB3aWxsIHRoZW4gYmUgcmVzcG9uc2libGUgZm9yIGhhbmRsaW5nIHRoZSBldmVudC5cbiAgICAgICAgICAgIGlmICh0aGlzLl9ic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B1cG9uIGluaXRpYWxpemF0aW9uXG4gICAgICAgICAgICAgICAgY29uc3Qgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgICAgICAgbG9jYWxlXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBjb25zdCBhc1BhdGggPSAoMCwgX3V0aWxzKS5nZXRVUkwoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9pbml0aWFsTWF0Y2hlc01pZGRsZXdhcmVQcm9taXNlID0gbWF0Y2hlc01pZGRsZXdhcmUoe1xuICAgICAgICAgICAgICAgICAgICByb3V0ZXI6IHRoaXMsXG4gICAgICAgICAgICAgICAgICAgIGxvY2FsZSxcbiAgICAgICAgICAgICAgICAgICAgYXNQYXRoXG4gICAgICAgICAgICAgICAgfSkudGhlbigobWF0Y2hlcyk9PntcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5fc2hvdWxkUmVzb2x2ZUhyZWYgPSBhczEgIT09IHBhdGhuYW1lMTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jaGFuZ2VTdGF0ZSgncmVwbGFjZVN0YXRlJywgbWF0Y2hlcyA/IGFzUGF0aCA6ICgwLCBfZm9ybWF0VXJsKS5mb3JtYXRXaXRoVmFsaWRhdGlvbih7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRobmFtZTogKDAsIF9hZGRCYXNlUGF0aCkuYWRkQmFzZVBhdGgocGF0aG5hbWUxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXJ5OiBxdWVyeTFcbiAgICAgICAgICAgICAgICAgICAgfSksIGFzUGF0aCwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaGVzO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ3BvcHN0YXRlJywgdGhpcy5vblBvcFN0YXRlKTtcbiAgICAgICAgICAgIC8vI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/lib/router/router.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/add-locale.js": /*!**********************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/add-locale.js ***! \**********************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.addLocale = addLocale;\nvar _addPathPrefix = __webpack_require__(/*! ./add-path-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js\");\nvar _pathHasPrefix = __webpack_require__(/*! ./path-has-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js\");\nfunction addLocale(path, locale, defaultLocale, ignorePrefix) {\n if (locale && locale !== defaultLocale && (ignorePrefix || !(0, _pathHasPrefix).pathHasPrefix(path.toLowerCase(), \"/\".concat(locale.toLowerCase())) && !(0, _pathHasPrefix).pathHasPrefix(path.toLowerCase(), \"/api\"))) {\n return (0, _addPathPrefix).addPathPrefix(path, \"/\".concat(locale));\n }\n return path;\n} //# sourceMappingURL=add-locale.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL2FkZC1sb2NhbGUuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxpQkFBaUIsR0FBR0UsU0FBUyxDQUFDO0FBQzlCLElBQUlDLGNBQWMsR0FBR0MsbUJBQU8sQ0FBQyw4RkFBbUIsQ0FBQztBQUNqRCxJQUFJQyxjQUFjLEdBQUdELG1CQUFPLENBQUMsOEZBQW1CLENBQUM7QUFDakQsU0FBU0YsU0FBUyxDQUFDSSxJQUFJLEVBQUVDLE1BQU0sRUFBRUMsYUFBYSxFQUFFQyxZQUFZLEVB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aCwgbG9jYWxlLCBkZWZhdWx0TG9jYWxlLCBpZ25vcmVQcmVmaXgpIHtcbiAgICBpZiAobG9jYWxlICYmIGxvY2FsZSAhPT0gZGVmYXVsdExvY2FsZSAmJiAoaWdub3JlUHJlZml4IHx8ICEoMCwgX3BhdGhIYXNQcmVmaXgpLnBhdGhIYXNQcmVmaXgocGF0aC50b0xvd2VyQ2FzZSgpLCBgLyR7bG9jYWxlLnRvTG93ZXJDYXNlKCl9YCkgJiYgISgwLCBfcGF0aEhhc1ByZWZpeCkucGF0aEhhc1ByZWZpeChwYXRoLnRvTG93ZXJDYXNlKCksICcvYXBpJykpKSB7XG4gICAgICAgIHJldHVybiAoMCwgX2FkZFBhdGhQcmVmaXgpLmFkZFBhdGhQcmVmaXgocGF0aCwgYC8ke2xvY2FsZX1gKTtcbiAgICB9XG4gICAgcmV0dXJuIHBhdGg7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWFkZC1sb2NhbGUuanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiYWRkTG9jYWxlIiwiX2FkZFBhdGhQcmVmaXgiLCJyZXF1aXJlIiwiX3BhdGhIYXNQcmVmaXgiLCJwYXRoIiwibG9jYWxlIiwiZGVmYXVsdExvY2FsZSIsImlnbm9yZVByZWZpeCIsInBhdGhIYXNQcmVmaXgiLCJ0b0xvd2VyQ2FzZSIsImFkZFBhdGhQcmVmaXgiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/add-locale.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js": /*!***************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js ***! \***************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.addPathPrefix = addPathPrefix;\nvar _parsePath = __webpack_require__(/*! ./parse-path */ \"./node_modules/next/dist/shared/lib/router/utils/parse-path.js\");\nfunction addPathPrefix(path, prefix) {\n if (!path.startsWith(\"/\") || !prefix) {\n return path;\n }\n var ref = (0, _parsePath).parsePath(path), pathname = ref.pathname, query = ref.query, hash = ref.hash;\n return \"\".concat(prefix).concat(pathname).concat(query).concat(hash);\n} //# sourceMappingURL=add-path-prefix.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL2FkZC1wYXRoLXByZWZpeC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELHFCQUFxQixHQUFHRSxhQUFhLENBQUM7QUFDdEMsSUFBSUMsVUFBVSxHQUFHQyxtQkFBTyxDQUFDLG9GQUFjLENBQUM7QUFDeEMsU0FBU0YsYUFBYSxDQUFDRyxJQUFJLEVBQUVDLE1BQU0sRUFBRTtJQUNqQyxJQUFJLENBQUNELElBQUksQ0FBQ0UsVUFBVSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUNELE1BQU0sRUFBRTtRQUNsQyxPQUFPRCxJQUFJLENBQUM7SUFDaEIsQ0FBQztJQUNELElBQXFDLEdBQStCLEdBQS9CLENBQUMsQ0FBQyxFQUFFRixVQUFVLEVBQUVLLFNBQVMsQ0FBQ0gsSUFBSSxDQUFDLEVBQTVESSxRQUFRLEdBQXFCLEdBQStCLENBQTVEQSxRQUFRLEVBQUdDLEtBQUssR0FBYSxHQUErQixDQUFqREEsS0FBSyxFQUFHQyxJQUFJLEdBQU0sR0FBK0IsQ0FBekNBLElBQUk7SUFDL0IsT0FBTyxFQUFDLENBQVdGLE1BQVEsQ0FBakJILE1B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dGFydHNXaXRoIiwicGFyc2VQYXRoIiwicGF0aG5hbWUiLCJxdWVyeSIsImhhc2giXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js": /*!***************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js ***! \***************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.addPathSuffix = addPathSuffix;\nvar _parsePath = __webpack_require__(/*! ./parse-path */ \"./node_modules/next/dist/shared/lib/router/utils/parse-path.js\");\nfunction addPathSuffix(path, suffix) {\n if (!path.startsWith(\"/\") || !suffix) {\n return path;\n }\n var ref = (0, _parsePath).parsePath(path), pathname = ref.pathname, query = ref.query, hash = ref.hash;\n return \"\".concat(pathname).concat(suffix).concat(query).concat(hash);\n} //# sourceMappingURL=add-path-suffix.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL2FkZC1wYXRoLXN1ZmZpeC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELHFCQUFxQixHQUFHRSxhQUFhLENBQUM7QUFDdEMsSUFBSUMsVUFBVSxHQUFHQyxtQkFBTyxDQUFDLG9GQUFjLENBQUM7QUFDeEMsU0FBU0YsYUFBYSxDQUFDRyxJQUFJLEVBQUVDLE1BQU0sRUFBRTtJQUNqQyxJQUFJLENBQUNELElBQUksQ0FBQ0UsVUFBVSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUNELE1BQU0sRUF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IGhhc2ggIH0gPSAoMCwgX3BhcnNlUGF0aCkucGFyc2VQYXRoKHBhdGgpO1xuICAgIHJldHVybiBgJHtwYXRobmFtZX0ke3N1ZmZpeH0ke3F1ZXJ5fSR7aGFzaH1gO1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1hZGQtcGF0aC1zdWZmaXguanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiYWRkUGF0aFN1ZmZpeCIsIl9wYXJzZVBhdGgiLCJyZXF1aXJlIiwicGF0aCIsInN1ZmZpeCIsInN0YXJ0c1dpdGgiLCJwYXJzZVBhdGgiLCJwYXRobmFtZSIsInF1ZXJ5IiwiaGFzaCJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/compare-states.js": /*!**************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/compare-states.js ***! \**************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.compareRouterStates = compareRouterStates;\nfunction compareRouterStates(a, b) {\n var stateKeys = Object.keys(a);\n if (stateKeys.length !== Object.keys(b).length) return false;\n for(var i = stateKeys.length; i--;){\n var key = stateKeys[i];\n if (key === \"query\") {\n var queryKeys = Object.keys(a.query);\n if (queryKeys.length !== Object.keys(b.query).length) {\n return false;\n }\n for(var j = queryKeys.length; j--;){\n var queryKey = queryKeys[j];\n if (!b.query.hasOwnProperty(queryKey) || a.query[queryKey] !== b.query[queryKey]) {\n return false;\n }\n }\n } else if (!b.hasOwnProperty(key) || a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n} //# sourceMappingURL=compare-states.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJ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ZXJTdGF0ZXMiLCJhIiwiYiIsInN0YXRlS2V5cyIsImtleXMiLCJsZW5ndGgiLCJpIiwia2V5IiwicXVlcnlLZXlzIiwicXVlcnkiLCJqIiwicXVlcnlLZXkiLCJoYXNPd25Qcm9wZXJ0eSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/compare-states.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js": /*!*************************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js ***! \*************************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.formatNextPathnameInfo = formatNextPathnameInfo;\nvar _removeTrailingSlash = __webpack_require__(/*! ./remove-trailing-slash */ \"./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js\");\nvar _addPathPrefix = __webpack_require__(/*! ./add-path-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js\");\nvar _addPathSuffix = __webpack_require__(/*! ./add-path-suffix */ \"./node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js\");\nvar _addLocale = __webpack_require__(/*! ./add-locale */ \"./node_modules/next/dist/shared/lib/router/utils/add-locale.js\");\nfunction formatNextPathnameInfo(info) {\n var pathname = (0, _addLocale).addLocale(info.pathname, info.locale, info.buildId ? undefined : info.defaultLocale, info.ignorePrefix);\n if (info.buildId) {\n pathname = (0, _addPathSuffix).addPathSuffix((0, _addPathPrefix).addPathPrefix(pathname, \"/_next/data/\".concat(info.buildId)), info.pathname === \"/\" ? \"index.json\" : \".json\");\n }\n pathname = (0, _addPathPrefix).addPathPrefix(pathname, info.basePath);\n return info.trailingSlash ? !info.buildId && !pathname.endsWith(\"/\") ? (0, _addPathSuffix).addPathSuffix(pathname, \"/\") : pathname : (0, _removeTrailingSlash).removeTrailingSlash(pathname);\n} //# sourceMappingURL=format-next-pathname-info.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n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dTbGFzaChwYXRobmFtZSk7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWZvcm1hdC1uZXh0LXBhdGhuYW1lLWluZm8uanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiZm9ybWF0TmV4dFBhdGhuYW1lSW5mbyIsIl9yZW1vdmVUcmFpbGluZ1NsYXNoIiwicmVxdWlyZSIsIl9hZGRQYXRoUHJlZml4IiwiX2FkZFBhdGhTdWZmaXgiLCJfYWRkTG9jYWxlIiwiaW5mbyIsInBhdGhuYW1lIiwiYWRkTG9jYWxlIiwibG9jYWxlIiwiYnVpbGRJZCIsInVuZGVmaW5lZCIsImRlZmF1bHRMb2NhbGUiLCJpZ25vcmVQcmVmaXgiLCJhZGRQYXRoU3VmZml4IiwiYWRkUGF0aFByZWZpeCIsImJhc2VQYXRoIiwidHJhaWxpbmdTbGFzaCIsImVuZHNXaXRoIiwicmVtb3ZlVHJhaWxpbmdTbGFzaCJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/format-url.js": /*!**********************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/format-url.js ***! \**********************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.formatUrl = formatUrl;\nexports.formatWithValidation = formatWithValidation;\nexports.urlObjectKeys = void 0;\nvar _interop_require_wildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ \"./node_modules/@swc/helpers/lib/_interop_require_wildcard.js\")[\"default\"]);\nvar querystring = _interop_require_wildcard(__webpack_require__(/*! ./querystring */ \"./node_modules/next/dist/shared/lib/router/utils/querystring.js\"));\nvar slashedProtocols = /https?|ftp|gopher|file/;\nfunction formatUrl(urlObj) {\n var auth = urlObj.auth, hostname = urlObj.hostname;\n var protocol = urlObj.protocol || \"\";\n var pathname = urlObj.pathname || \"\";\n var hash = urlObj.hash || \"\";\n var query = urlObj.query || \"\";\n var host = false;\n auth = auth ? encodeURIComponent(auth).replace(/%3A/i, \":\") + \"@\" : \"\";\n if (urlObj.host) {\n host = auth + urlObj.host;\n } else if (hostname) {\n host = auth + (~hostname.indexOf(\":\") ? \"[\".concat(hostname, \"]\") : hostname);\n if (urlObj.port) {\n host += \":\" + urlObj.port;\n }\n }\n if (query && typeof query === \"object\") {\n query = String(querystring.urlQueryToSearchParams(query));\n }\n var search = urlObj.search || query && \"?\".concat(query) || \"\";\n if (protocol && !protocol.endsWith(\":\")) protocol += \":\";\n if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {\n host = \"//\" + (host || \"\");\n if (pathname && pathname[0] !== \"/\") pathname = \"/\" + pathname;\n } else if (!host) {\n host = \"\";\n }\n if (hash && hash[0] !== \"#\") hash = \"#\" + hash;\n if (search && search[0] !== \"?\") search = \"?\" + search;\n pathname = pathname.replace(/[?#]/g, encodeURIComponent);\n search = search.replace(\"#\", \"%23\");\n return \"\".concat(protocol).concat(host).concat(pathname).concat(search).concat(hash);\n}\nvar urlObjectKeys = [\n \"auth\",\n \"hash\",\n \"host\",\n \"hostname\",\n \"href\",\n \"path\",\n \"pathname\",\n \"port\",\n \"protocol\",\n \"query\",\n \"search\",\n \"slashes\", \n];\nexports.urlObjectKeys = urlObjectKeys;\nfunction formatWithValidation(url) {\n if (true) {\n if (url !== null && typeof url === \"object\") {\n Object.keys(url).forEach(function(key) {\n if (urlObjectKeys.indexOf(key) === -1) {\n console.warn(\"Unknown key passed via urlObject into url.format: \".concat(key));\n }\n });\n }\n }\n return formatUrl(url);\n} //# sourceMappingURL=format-url.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVs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xdWVyeXN0cmluZyIsInNsYXNoZWRQcm90b2NvbHMiLCJ1cmxPYmoiLCJhdXRoIiwiaG9zdG5hbWUiLCJwcm90b2NvbCIsInBhdGhuYW1lIiwiaGFzaCIsInF1ZXJ5IiwiaG9zdCIsImVuY29kZVVSSUNvbXBvbmVudCIsInJlcGxhY2UiLCJpbmRleE9mIiwicG9ydCIsIlN0cmluZyIsInVybFF1ZXJ5VG9TZWFyY2hQYXJhbXMiLCJzZWFyY2giLCJlbmRzV2l0aCIsInNsYXNoZXMiLCJ0ZXN0IiwidXJsIiwicHJvY2VzcyIsImtleXMiLCJmb3JFYWNoIiwia2V5IiwiY29uc29sZSIsIndhcm4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/format-url.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js": /*!*************************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js ***! \*************************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = getAssetPathFromRoute;\nfunction getAssetPathFromRoute(route) {\n var ext = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"\";\n var path = route === \"/\" ? \"/index\" : /^\\/index(\\/|$)/.test(route) ? \"/index\".concat(route) : \"\".concat(route);\n return path + ext;\n} //# sourceMappingURL=get-asset-path-from-route.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL2dldC1hc3NldC1wYXRoLWZyb20tcm91dGUuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMs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hdGgtZnJvbS1yb3V0ZS5qcy5tYXAiXSwibmFtZXMiOlsiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJleHBvcnRzIiwidmFsdWUiLCJkZWZhdWx0IiwiZ2V0QXNzZXRQYXRoRnJvbVJvdXRlIiwicm91dGUiLCJleHQiLCJwYXRoIiwidGVzdCJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js": /*!**********************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js ***! \**********************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getNextPathnameInfo = getNextPathnameInfo;\nvar _normalizeLocalePath = __webpack_require__(/*! ../../i18n/normalize-locale-path */ \"./node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js\");\nvar _removePathPrefix = __webpack_require__(/*! ./remove-path-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js\");\nvar _pathHasPrefix = __webpack_require__(/*! ./path-has-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js\");\nfunction getNextPathnameInfo(pathname, options) {\n var _nextConfig;\n var ref = (_nextConfig = options.nextConfig) != null ? _nextConfig : {}, basePath = ref.basePath, i18n = ref.i18n, trailingSlash = ref.trailingSlash;\n var info = {\n pathname: pathname,\n trailingSlash: pathname !== \"/\" ? pathname.endsWith(\"/\") : trailingSlash\n };\n if (basePath && (0, _pathHasPrefix).pathHasPrefix(info.pathname, basePath)) {\n info.pathname = (0, _removePathPrefix).removePathPrefix(info.pathname, basePath);\n info.basePath = basePath;\n }\n if (options.parseData === true && info.pathname.startsWith(\"/_next/data/\") && info.pathname.endsWith(\".json\")) {\n var paths = info.pathname.replace(/^\\/_next\\/data\\//, \"\").replace(/\\.json$/, \"\").split(\"/\");\n var buildId = paths[0];\n info.pathname = paths[1] !== \"index\" ? \"/\".concat(paths.slice(1).join(\"/\")) : \"/\";\n info.buildId = buildId;\n }\n if (i18n) {\n var pathLocale = (0, _normalizeLocalePath).normalizeLocalePath(info.pathname, i18n.locales);\n info.locale = pathLocale == null ? void 0 : pathLocale.detectedLocale;\n info.pathname = (pathLocale == null ? void 0 : pathLocale.pathname) || info.pathname;\n }\n return info;\n} //# sourceMappingURL=get-next-pathname-info.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL2dldC1uZXh0LXBhdGhuYW1lLWluZm8uanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCwyQkFBMkIsR0FBR0UsbUJBQW1CLENBQUM7QUFDbEQsSUFBSUMsb0JBQW9CLEdBQUdDLG1CQUFPLENBQUMsMkdBQWtDLENBQUM7QUFDdEUsSUFBSUMsaUJBQWlCLEdBQUdELG1CQUFPLENBQUMsb0dBQXNCLENBQUM7QUFDdkQsSUFBSUUsY0FBYyxHQUFHRixtQkFBTyxDQUFDLDhGQUFtQixDQUFDO0FBQ2pELFNBQVNGLG1CQUFtQixDQUFDSyxRQUFRLEVBQUVDLE9BQU8sRUFBRTtJQUM1QyxJQUFJQyxXQUFXO0lBQ2YsSUFBNkMsR0FBNkQsR0FBN0QsQ0FBQ0EsV0FBVyxHQUFHRCxPQUFPLENBQUNFLFVBQVUsS0FBSyxJQUFJLEdBQUdELFdBQVcsR0FBRyxFQUFFLEVBQWxHRSxRQUFRLEdBQTZCLEdBQTZELENBQWxHQSxRQUFRLEVBQUdDLElBQUksR0FBc0IsR0FBNkQsQ0FBdkZBL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Ehhc1ByZWZpeCIsInBhdGhuYW1lIiwib3B0aW9ucyIsIl9uZXh0Q29uZmlnIiwibmV4dENvbmZpZyIsImJhc2VQYXRoIiwiaTE4biIsInRyYWlsaW5nU2xhc2giLCJpbmZvIiwiZW5kc1dpdGgiLCJwYXRoSGFzUHJlZml4IiwicmVtb3ZlUGF0aFByZWZpeCIsInBhcnNlRGF0YSIsInN0YXJ0c1dpdGgiLCJwYXRocyIsInJlcGxhY2UiLCJzcGxpdCIsImJ1aWxkSWQiLCJzbGljZSIsImpvaW4iLCJwYXRoTG9jYWxlIiwibm9ybWFsaXplTG9jYWxlUGF0aCIsImxvY2FsZXMiLCJsb2NhbGUiLCJkZXRlY3RlZExvY2FsZSJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/index.js": /*!*****************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/index.js ***! \*****************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"getSortedRoutes\", ({\n enumerable: true,\n get: function get() {\n return _sortedRoutes.getSortedRoutes;\n }\n}));\nObject.defineProperty(exports, \"isDynamicRoute\", ({\n enumerable: true,\n get: function get() {\n return _isDynamic.isDynamicRoute;\n }\n}));\nvar _sortedRoutes = __webpack_require__(/*! ./sorted-routes */ \"./node_modules/next/dist/shared/lib/router/utils/sorted-routes.js\");\nvar _isDynamic = __webpack_require__(/*! ./is-dynamic */ \"./node_modules/next/dist/shared/lib/router/utils/is-dynamic.js\"); //# sourceMappingURL=index.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL2luZ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AgfVxufSk7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJpc0R5bmFtaWNSb3V0ZVwiLCB7XG4gICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICBnZXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gX2lzRHluYW1pYy5pc0R5bmFtaWNSb3V0ZTtcbiAgICB9XG59KTtcbnZhciBfc29ydGVkUm91dGVzID0gcmVxdWlyZShcIi4vc29ydGVkLXJvdXRlc1wiKTtcbnZhciBfaXNEeW5hbWljID0gcmVxdWlyZShcIi4vaXMtZHluYW1pY1wiKTtcblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW5kZXguanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiZW51bWVyYWJsZSIsImdldCIsIl9zb3J0ZWRSb3V0ZXMiLCJnZXRTb3J0ZWRSb3V0ZXMiLCJfaXNEeW5hbWljIiwiaXNEeW5hbWljUm91dGUiLCJyZXF1aXJlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/index.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/is-bot.js": /*!******************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/is-bot.js ***! \******************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.isBot = isBot;\nfunction isBot(userAgent) {\n return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(userAgent);\n} //# sourceMappingURL=is-bot.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n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cmV2aWV3fGZhY2Vib29rZXh0ZXJuYWxoaXR8ZmFjZWJvb2tjYXRhbG9nfFR3aXR0ZXJib3R8YXBwbGVib3R8cmVkZGl0Ym90fFNsYWNrYm90fERpc2NvcmRib3R8V2hhdHNBcHB8U2t5cGVVcmlQcmV2aWV3fGlhX2FyY2hpdmVyL2kudGVzdCh1c2VyQWdlbnQpO1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1pcy1ib3QuanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiaXNCb3QiLCJ1c2VyQWdlbnQiLCJ0ZXN0Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/is-bot.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/is-dynamic.js": /*!**********************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/is-dynamic.js ***! \**********************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.isDynamicRoute = isDynamicRoute;\n// Identify /[param]/ in route string\nvar TEST_ROUTE = /\\/\\[[^/]+?\\](?=\\/|$)/;\nfunction isDynamicRoute(route) {\n return TEST_ROUTE.test(route);\n} //# sourceMappingURL=is-dynamic.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL2lzLWR5bmFtaWMuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxzQkFBc0IsR0FBR0UsY0FBYyxDQUFDO0FBQ3hDLHFDQUFxQztBQUNyQyxJQUFNQyxVQUFVLHlCQUF5QjtBQUN6QyxTQUFTRCxjQUFjLENBQUNFLEtBQUssRUFBRTtJQUMzQixPQUFPRCxVQUFVLENBQUNFLElBQUksQ0FBQ0QsS0FBSyxDQUFDLENBQUM7QUFDbEMsQ0FBQyxDQUVELHNDQUFzQyIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL2lzLWR5bmFtaWMuanM/NDZmOSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbmV4cG9ydHMuaXNEeW5hbWljUm91dGUgPSBpc0R5bmFtaWNSb3V0ZTtcbi8vIElkZW50aWZ5IC9bcGFyYW1dLyBpbiByb3V0ZSBzdHJpbmdcbmNvbnN0IFRFU1RfUk9VVEUgPSAvXFwvXFxbW14vXSs/XFxdKD89XFwvfCQpLztcbmZ1bmN0aW9uIGlzRHluYW1pY1JvdXRlKHJvdXRlKSB7XG4gICAgcmV0dXJuIFRFU1RfUk9VVEUudGVzdChyb3V0ZSk7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlzLWR5bmFtaWMuanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwiaXNEeW5hbWljUm91dGUiLCJURVNUX1JPVVRFIiwicm91dGUiLCJ0ZXN0Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/is-dynamic.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/parse-path.js": /*!**********************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/parse-path.js ***! \**********************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.parsePath = parsePath;\nfunction parsePath(path) {\n var hashIndex = path.indexOf(\"#\");\n var queryIndex = path.indexOf(\"?\");\n var hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : \"\",\n hash: hashIndex > -1 ? path.slice(hashIndex) : \"\"\n };\n }\n return {\n pathname: path,\n query: \"\",\n hash: \"\"\n };\n} //# sourceMappingURL=parse-path.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL3BhcnNlLXBhdGguanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxpQkFBaUIsR0FBR0UsU0FBUyxDQUFDO0FBQzlCLFNBQVNBLFNBQVMsQ0FBQ0MsSUFBSSxFQUFFO0lBQ3JCLElBQU1DLFNBQVMsR0FBR0QsSUFBSSxDQUFDRSxPQUFPLENBQUMsR0FBRyxDQUFDO0lBQ25DLElBQU1DLFVBQVUsR0FBR0gsSUFBSSxDQUFDRSxPQUFPLENBQUMsR0FBRyxDQUFDO0lBQ3BDLElBQU1FLFFBQVEsR0FBR0QsVUFBVSxHQUFHLENBQUMsQ0FBQyxJQUFLRixDQUFBQSxTQUFTLEdBQUcsQ0FBQyxJQUFJRSxVQUFVLEdBQUdGLFNBQVM7SUFDNUUsSUFBSUcsUUFBUSxJQUFJSCxTQUFTLEdBQUcsQ0FBQyxDQUFDLEVBQUU7UUF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F1ZXJ5SW5kZXggPiAtMSAmJiAoaGFzaEluZGV4IDwgMCB8fCBxdWVyeUluZGV4IDwgaGFzaEluZGV4KTtcbiAgICBpZiAoaGFzUXVlcnkgfHwgaGFzaEluZGV4ID4gLTEpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHBhdGhuYW1lOiBwYXRoLnN1YnN0cmluZygwLCBoYXNRdWVyeSA/IHF1ZXJ5SW5kZXggOiBoYXNoSW5kZXgpLFxuICAgICAgICAgICAgcXVlcnk6IGhhc1F1ZXJ5ID8gcGF0aC5zdWJzdHJpbmcocXVlcnlJbmRleCwgaGFzaEluZGV4ID4gLTEgPyBoYXNoSW5kZXggOiB1bmRlZmluZWQpIDogJycsXG4gICAgICAgICAgICBoYXNoOiBoYXNoSW5kZXggPiAtMSA/IHBhdGguc2xpY2UoaGFzaEluZGV4KSA6ICcnXG4gICAgICAgIH07XG4gICAgfVxuICAgIHJldHVybiB7XG4gICAgICAgIHBhdGhuYW1lOiBwYXRoLFxuICAgICAgICBxdWVyeTogJycsXG4gICAgICAgIGhhc2g6ICcnXG4gICAgfTtcbn1cblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9cGFyc2UtcGF0aC5qcy5tYXAiXSwibmFtZXMiOlsiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJleHBvcnRzIiwidmFsdWUiLCJwYXJzZVBhdGgiLCJwYXRoIiwiaGFzaEluZGV4IiwiaW5kZXhPZiIsInF1ZXJ5SW5kZXgiLCJoYXNRdWVyeSIsInBhdGhuYW1lIiwic3Vic3RyaW5nIiwicXVlcnkiLCJ1bmRlZmluZWQiLCJoYXNoIiwic2xpY2UiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/parse-path.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js": /*!******************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js ***! \******************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.parseRelativeUrl = parseRelativeUrl;\nvar _utils = __webpack_require__(/*! ../../utils */ \"./node_modules/next/dist/shared/lib/utils.js\");\nvar _querystring = __webpack_require__(/*! ./querystring */ \"./node_modules/next/dist/shared/lib/router/utils/querystring.js\");\nfunction parseRelativeUrl(url, base) {\n var globalBase = new URL( false ? 0 : (0, _utils).getLocationOrigin());\n var resolvedBase = base ? new URL(base, globalBase) : url.startsWith(\".\") ? new URL( false ? 0 : window.location.href) : globalBase;\n var ref = new URL(url, resolvedBase), pathname = ref.pathname, searchParams = ref.searchParams, search = ref.search, hash = ref.hash, href = ref.href, origin = ref.origin;\n if (origin !== globalBase.origin) {\n throw new Error(\"invariant: invalid relative URL, router received \".concat(url));\n }\n return {\n pathname: pathname,\n query: (0, _querystring).searchParamsToUrlQuery(searchParams),\n search: search,\n hash: hash,\n href: href.slice(globalBase.origin.length)\n };\n} //# sourceMappingURL=parse-relative-url.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL3BhcnNlLXJlbGF0aXZlLXVybC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELHdCQUF3QixHQUFHRSxnQkFBZ0IsQ0FBQztBQUM1QyxJQUFJQyxNQUFNLEdBQUdDLG1CQUFPLENBQUMsaUVBQWEsQ0FBQztBQUNuQyxJQUFJQyxZQUFZLEdBQUdELG1CQUFPLENBQUMsc0ZBQWUsQ0FBQztBQUMzQyxTQUFTRixnQkFBZ0IsQ0FBQ0ksR0FBRyxFQUFFQyxJQUFJLE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FyYW1zVG9VcmxRdWVyeSIsInNsaWNlIiwibGVuZ3RoIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js": /*!***************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js ***! \***************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.pathHasPrefix = pathHasPrefix;\nvar _parsePath = __webpack_require__(/*! ./parse-path */ \"./node_modules/next/dist/shared/lib/router/utils/parse-path.js\");\nfunction pathHasPrefix(path, prefix) {\n if (typeof path !== \"string\") {\n return false;\n }\n var pathname = (0, _parsePath).parsePath(path).pathname;\n return pathname === prefix || pathname.startsWith(prefix + \"/\");\n} //# sourceMappingURL=path-has-prefix.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL3BhdGgtaGFzLXByZWZpeC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELHFCQUFxQixHQUFHRSxhQUFhLENBQUM7QUFDdEMsSUFBSUMsVUFBVSxHQUFHQyxtQkFBTyxDQUFDLG9GQUFjLENBQUM7QUFDeEMsU0FBU0YsYUFBYSxDQUFDRyxJQUFJLEVBQUVDLE1BQU0sRUFBRTtJQUNqQyxJQUFJLE9BQU9ELElBQUksS0FBSyxRQUFRLEVBQUU7UUFDMUIsT0FBTyxLQUFLLENBQUM7SUFDakIsQ0FBQztJQUNELElBQU0sUUFBVSxHQUFNLENBQUMsQ0FBQyxFQUFF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4IiwiX3BhcnNlUGF0aCIsInJlcXVpcmUiLCJwYXRoIiwicHJlZml4IiwicGF0aG5hbWUiLCJwYXJzZVBhdGgiLCJzdGFydHNXaXRoIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/querystring.js": /*!***********************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/querystring.js ***! \***********************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _slicedToArray = (__webpack_require__(/*! @swc/helpers/lib/_sliced_to_array.js */ \"./node_modules/@swc/helpers/lib/_sliced_to_array.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.searchParamsToUrlQuery = searchParamsToUrlQuery;\nexports.urlQueryToSearchParams = urlQueryToSearchParams;\nexports.assign = assign;\nfunction searchParamsToUrlQuery(searchParams) {\n var query = {};\n searchParams.forEach(function(value, key) {\n if (typeof query[key] === \"undefined\") {\n query[key] = value;\n } else if (Array.isArray(query[key])) {\n query[key].push(value);\n } else {\n query[key] = [\n query[key],\n value\n ];\n }\n });\n return query;\n}\nfunction stringifyUrlQueryParam(param) {\n if (typeof param === \"string\" || typeof param === \"number\" && !isNaN(param) || typeof param === \"boolean\") {\n return String(param);\n } else {\n return \"\";\n }\n}\nfunction urlQueryToSearchParams(urlQuery) {\n var result = new URLSearchParams();\n Object.entries(urlQuery).forEach(function(param) {\n var _param = _slicedToArray(param, 2), key = _param[0], value = _param[1];\n if (Array.isArray(value)) {\n value.forEach(function(item) {\n return result.append(key, stringifyUrlQueryParam(item));\n });\n } else {\n result.set(key, stringifyUrlQueryParam(value));\n }\n });\n return result;\n}\nfunction assign(target) {\n for(var _len = arguments.length, searchParamsList = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){\n searchParamsList[_key - 1] = arguments[_key];\n }\n searchParamsList.forEach(function(searchParams) {\n Array.from(searchParams.keys()).forEach(function(key) {\n return target.delete(key);\n });\n searchParams.forEach(function(value, key) {\n return target.append(key, value);\n });\n });\n return target;\n} //# sourceMappingURL=querystring.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL3F1ZXJ5c3RyaW5nLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhOzs7OztBQUNiQSw4Q0FBNkM7SUFDekNHLEtBQUssRUFBRSxJQUFJO0NBQ2QsRUFBQyxDQUFDO0FBQ0hELDhCQUE4QixHQUFHRSxzQkFBc0IsQ0FBQztBQUN4REYsOEJBQThCLEdBQUdHLHNCQUFzQixDQUFDO0FBQ3hESCxjQUFjLEdBQUdJLE1BQU0sQ0FBQztBQUN4QixTQUFTRixzQkFBc0IsQ0FBQ0csWUFBWSxFQUFFO0lBQzFDLElBQU1DLEtBQUssR0FBRyxFQUFFO0lBQ2hCRCxZQUFZLENBQUNFLE9BQU8sQ0FBQyxTQUFDTixLQUFLLEVBQUVPLEdBQUcsRUFBRztRQUMvQixJQUFJLE9BQU9GLEtBQUssQ0FBQ0UsR0FBRyxDQUFDLEtBQUssV0FBVyxFQUFFO1lBQ25DRixLQUFLLENBQUNFLEdBQUcsQ0FBQyxHQUFHUCxLQUFLLENBQUM7UUFDdkIsT0FBTyxJQUFJUSxLQUFLLENBQUNDLE9BQU8sQ0FBQ0osS0FBSyxDQUFDRSxHQUFHLENBQUMsQ0FBQyxFQUFFO1lBQ2xDRixLQUFLLENBQUNFLEdBQUcsQ0FBQyxDQUFDRyxJQUFJLENBQUNWLEtBQUssQ0FBQyxDQUFDO1FBQzNCLE9BQU87WUFDSEssS0FBSyxDQUFDRSxHQUFHLENBQUMsR0FBRztnQkFDVEYsS0F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y5tYXAiXSwibmFtZXMiOlsiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJleHBvcnRzIiwidmFsdWUiLCJzZWFyY2hQYXJhbXNUb1VybFF1ZXJ5IiwidXJsUXVlcnlUb1NlYXJjaFBhcmFtcyIsImFzc2lnbiIsInNlYXJjaFBhcmFtcyIsInF1ZXJ5IiwiZm9yRWFjaCIsImtleSIsIkFycmF5IiwiaXNBcnJheSIsInB1c2giLCJzdHJpbmdpZnlVcmxRdWVyeVBhcmFtIiwicGFyYW0iLCJpc05hTiIsIlN0cmluZyIsInVybFF1ZXJ5IiwicmVzdWx0IiwiVVJMU2VhcmNoUGFyYW1zIiwiZW50cmllcyIsIml0ZW0iLCJhcHBlbmQiLCJzZXQiLCJ0YXJnZXQiLCJzZWFyY2hQYXJhbXNMaXN0IiwiZnJvbSIsImtleXMiLCJkZWxldGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/querystring.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js": /*!******************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js ***! \******************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.removePathPrefix = removePathPrefix;\nvar _pathHasPrefix = __webpack_require__(/*! ./path-has-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js\");\nfunction removePathPrefix(path, prefix) {\n if ((0, _pathHasPrefix).pathHasPrefix(path, prefix)) {\n var withoutPrefix = path.slice(prefix.length);\n return withoutPrefix.startsWith(\"/\") ? withoutPrefix : \"/\".concat(withoutPrefix);\n }\n return path;\n} //# sourceMappingURL=remove-path-prefix.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4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mVmaXg7XG52YXIgX3BhdGhIYXNQcmVmaXggPSByZXF1aXJlKFwiLi9wYXRoLWhhcy1wcmVmaXhcIik7XG5mdW5jdGlvbiByZW1vdmVQYXRoUHJlZml4KHBhdGgsIHByZWZpeCkge1xuICAgIGlmICgoMCwgX3BhdGhIYXNQcmVmaXgpLnBhdGhIYXNQcmVmaXgocGF0aCwgcHJlZml4KSkge1xuICAgICAgICBjb25zdCB3aXRob3V0UHJlZml4ID0gcGF0aC5zbGljZShwcmVmaXgubGVuZ3RoKTtcbiAgICAgICAgcmV0dXJuIHdpdGhvdXRQcmVmaXguc3RhcnRzV2l0aCgnLycpID8gd2l0aG91dFByZWZpeCA6IGAvJHt3aXRob3V0UHJlZml4fWA7XG4gICAgfVxuICAgIHJldHVybiBwYXRoO1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1yZW1vdmUtcGF0aC1wcmVmaXguanMubWFwIl0sIm5hbWVzIjpbIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZXhwb3J0cyIsInZhbHVlIiwicmVtb3ZlUGF0aFByZWZpeCIsIl9wYXRoSGFzUHJlZml4IiwicmVxdWlyZSIsInBhdGgiLCJwcmVmaXgiLCJwYXRoSGFzUHJlZml4Iiwid2l0aG91dFByZWZpeCIsInNsaWNlIiwibGVuZ3RoIiwic3RhcnRzV2l0aCJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js": /*!*********************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js ***! \*********************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.removeTrailingSlash = removeTrailingSlash;\nfunction removeTrailingSlash(route) {\n return route.replace(/\\/$/, \"\") || \"/\";\n} //# sourceMappingURL=remove-trailing-slash.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n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JkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsInJlbW92ZVRyYWlsaW5nU2xhc2giLCJyb3V0ZSIsInJlcGxhY2UiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/route-matcher.js": /*!*************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/route-matcher.js ***! \*************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getRouteMatcher = getRouteMatcher;\nvar _utils = __webpack_require__(/*! ../../utils */ \"./node_modules/next/dist/shared/lib/utils.js\");\nfunction getRouteMatcher(param) {\n var re = param.re, groups = param.groups;\n return function(pathname) {\n var routeMatch = re.exec(pathname);\n if (!routeMatch) {\n return false;\n }\n var decode = function(param) {\n try {\n return decodeURIComponent(param);\n } catch (_) {\n throw new _utils.DecodeError(\"failed to decode param\");\n }\n };\n var params = {};\n Object.keys(groups).forEach(function(slugName) {\n var g = groups[slugName];\n var m = routeMatch[g.pos];\n if (m !== undefined) {\n params[slugName] = ~m.indexOf(\"/\") ? m.split(\"/\").map(function(entry) {\n return decode(entry);\n }) : g.repeat ? [\n decode(m)\n ] : decode(m);\n }\n });\n return params;\n };\n} //# sourceMappingURL=route-matcher.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL3JvdXRlLW1hdGNoZXIuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCx1QkFBdUIsR0FBR0UsZUFBZSxDQUF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jb2RlIiwicGFyYW0iLCJkZWNvZGVVUklDb21wb25lbnQiLCJfIiwiRGVjb2RlRXJyb3IiLCJwYXJhbXMiLCJrZXlzIiwiZm9yRWFjaCIsInNsdWdOYW1lIiwiZyIsIm0iLCJwb3MiLCJ1bmRlZmluZWQiLCJpbmRleE9mIiwic3BsaXQiLCJtYXAiLCJlbnRyeSIsInJlcGVhdCJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/route-matcher.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/route-regex.js": /*!***********************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/route-regex.js ***! \***********************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getRouteRegex = getRouteRegex;\nexports.getNamedRouteRegex = getNamedRouteRegex;\nexports.getNamedMiddlewareRegex = getNamedMiddlewareRegex;\nvar _extends = (__webpack_require__(/*! @swc/helpers/lib/_extends.js */ \"./node_modules/@swc/helpers/lib/_extends.js\")[\"default\"]);\nvar _escapeRegexp = __webpack_require__(/*! ../../escape-regexp */ \"./node_modules/next/dist/shared/lib/escape-regexp.js\");\nvar _removeTrailingSlash = __webpack_require__(/*! ./remove-trailing-slash */ \"./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js\");\n/**\n * Parses a given parameter from a route to a data structure that can be used\n * to generate the parametrized route. Examples:\n * - `[...slug]` -> `{ name: 'slug', repeat: true, optional: true }`\n * - `[foo]` -> `{ name: 'foo', repeat: false, optional: true }`\n * - `bar` -> `{ name: 'bar', repeat: false, optional: false }`\n */ function parseParameter(param) {\n var optional = param.startsWith(\"[\") && param.endsWith(\"]\");\n if (optional) {\n param = param.slice(1, -1);\n }\n var repeat = param.startsWith(\"...\");\n if (repeat) {\n param = param.slice(3);\n }\n return {\n key: param,\n repeat: repeat,\n optional: optional\n };\n}\nfunction getParametrizedRoute(route) {\n var segments = (0, _removeTrailingSlash).removeTrailingSlash(route).slice(1).split(\"/\");\n var groups = {};\n var groupIndex = 1;\n return {\n parameterizedRoute: segments.map(function(segment) {\n if (segment.startsWith(\"[\") && segment.endsWith(\"]\")) {\n var ref = parseParameter(segment.slice(1, -1)), key = ref.key, optional = ref.optional, repeat = ref.repeat;\n groups[key] = {\n pos: groupIndex++,\n repeat: repeat,\n optional: optional\n };\n return repeat ? optional ? \"(?:/(.+?))?\" : \"/(.+?)\" : \"/([^/]+?)\";\n } else {\n return \"/\".concat((0, _escapeRegexp).escapeStringRegexp(segment));\n }\n }).join(\"\"),\n groups: groups\n };\n}\nfunction getRouteRegex(normalizedRoute) {\n var ref = getParametrizedRoute(normalizedRoute), parameterizedRoute = ref.parameterizedRoute, groups = ref.groups;\n return {\n re: new RegExp(\"^\".concat(parameterizedRoute, \"(?:/)?$\")),\n groups: groups\n };\n}\n/**\n * Builds a function to generate a minimal routeKey using only a-z and minimal\n * number of characters.\n */ function buildGetSafeRouteKey() {\n var routeKeyCharCode = 97;\n var routeKeyCharLength = 1;\n return function() {\n var routeKey = \"\";\n for(var i = 0; i < routeKeyCharLength; i++){\n routeKey += String.fromCharCode(routeKeyCharCode);\n routeKeyCharCode++;\n if (routeKeyCharCode > 122) {\n routeKeyCharLength++;\n routeKeyCharCode = 97;\n }\n }\n return routeKey;\n };\n}\nfunction getNamedParametrizedRoute(route) {\n var segments = (0, _removeTrailingSlash).removeTrailingSlash(route).slice(1).split(\"/\");\n var getSafeRouteKey = buildGetSafeRouteKey();\n var routeKeys = {};\n return {\n namedParameterizedRoute: segments.map(function(segment) {\n if (segment.startsWith(\"[\") && segment.endsWith(\"]\")) {\n var ref = parseParameter(segment.slice(1, -1)), key = ref.key, optional = ref.optional, repeat = ref.repeat;\n // replace any non-word characters since they can break\n // the named regex\n var cleanedKey = key.replace(/\\W/g, \"\");\n var invalidKey = false;\n // check if the key is still invalid and fallback to using a known\n // safe key\n if (cleanedKey.length === 0 || cleanedKey.length > 30) {\n invalidKey = true;\n }\n if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {\n invalidKey = true;\n }\n if (invalidKey) {\n cleanedKey = getSafeRouteKey();\n }\n routeKeys[cleanedKey] = key;\n return repeat ? optional ? \"(?:/(?<\".concat(cleanedKey, \">.+?))?\") : \"/(?<\".concat(cleanedKey, \">.+?)\") : \"/(?<\".concat(cleanedKey, \">[^/]+?)\");\n } else {\n return \"/\".concat((0, _escapeRegexp).escapeStringRegexp(segment));\n }\n }).join(\"\"),\n routeKeys: routeKeys\n };\n}\nfunction getNamedRouteRegex(normalizedRoute) {\n var result = getNamedParametrizedRoute(normalizedRoute);\n return _extends({}, getRouteRegex(normalizedRoute), {\n namedRegex: \"^\".concat(result.namedParameterizedRoute, \"(?:/)?$\"),\n routeKeys: result.routeKeys\n });\n}\nfunction getNamedMiddlewareRegex(normalizedRoute, options) {\n var parameterizedRoute = getParametrizedRoute(normalizedRoute).parameterizedRoute;\n var _catchAll = options.catchAll, catchAll = _catchAll === void 0 ? true : _catchAll;\n if (parameterizedRoute === \"/\") {\n var catchAllRegex = catchAll ? \".*\" : \"\";\n return {\n namedRegex: \"^/\".concat(catchAllRegex, \"$\")\n };\n }\n var namedParameterizedRoute = getNamedParametrizedRoute(normalizedRoute).namedParameterizedRoute;\n var catchAllGroupedRegex = catchAll ? \"(?:(/.*)?)\" : \"\";\n return {\n namedRegex: \"^\".concat(namedParameterizedRoute).concat(catchAllGroupedRegex, \"$\")\n };\n} //# sourceMappingURL=route-regex.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL3JvdXRlLXJlZ2V4LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxF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bCAsIHJlcGVhdCAgfSA9IHBhcnNlUGFyYW1ldGVyKHNlZ21lbnQuc2xpY2UoMSwgLTEpKTtcbiAgICAgICAgICAgICAgICAvLyByZXBsYWNlIGFueSBub24td29yZCBjaGFyYWN0ZXJzIHNpbmNlIHRoZXkgY2FuIGJyZWFrXG4gICAgICAgICAgICAgICAgLy8gdGhlIG5hbWVkIHJlZ2V4XG4gICAgICAgICAgICAgICAgbGV0IGNsZWFuZWRLZXkgPSBrZXkucmVwbGFjZSgvXFxXL2csICcnKTtcbiAgICAgICAgICAgICAgICBsZXQgaW52YWxpZEtleSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBrZXkgaXMgc3RpbGwgaW52YWxpZCBhbmQgZmFsbGJhY2sgdG8gdXNpbmcgYSBrbm93blxuICAgICAgICAgICAgICAgIC8vIHNhZmUga2V5XG4gICAgICAgICAgICAgICAgaWYgKGNsZWFuZWRLZXkubGVuZ3RoID09PSAwIHx8IGNsZWFuZWRLZXkubGVuZ3RoID4gMzApIHtcbiAgICAgICAgICAgICAgICAgICAgaW52YWxpZEtleSA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VJbnQoY2xlYW5lZEtleS5zbGljZSgwLCAxKSkpKSB7XG4gICAgICAgICAgICAgICAgICAgIGludmFsaWRLZXkgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaW52YWxpZEtleSkge1xuICAgICAgICAgICAgICAgICAgICBjbGVhbmVkS2V5ID0gZ2V0U2FmZVJvdXRlS2V5KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJvdXRlS2V5c1tjbGVhbmVkS2V5XSA9IGtleTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVwZWF0ID8gb3B0aW9uYWwgPyBgKD86Lyg/PCR7Y2xlYW5lZEtleX0+Lis/KSk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lJlZ0V4cCIsImJ1aWxkR2V0U2FmZVJvdXRlS2V5Iiwicm91dGVLZXlDaGFyQ29kZSIsInJvdXRlS2V5Q2hhckxlbmd0aCIsInJvdXRlS2V5IiwiaSIsIlN0cmluZyIsImZyb21DaGFyQ29kZSIsImdldE5hbWVkUGFyYW1ldHJpemVkUm91dGUiLCJnZXRTYWZlUm91dGVLZXkiLCJyb3V0ZUtleXMiLCJuYW1lZFBhcmFtZXRlcml6ZWRSb3V0ZSIsImNsZWFuZWRLZXkiLCJyZXBsYWNlIiwiaW52YWxpZEtleSIsImxlbmd0aCIsImlzTmFOIiwicGFyc2VJbnQiLCJyZXN1bHQiLCJuYW1lZFJlZ2V4Iiwib3B0aW9ucyIsImNhdGNoQWxsIiwiY2F0Y2hBbGxSZWdleCIsImNhdGNoQWxsR3JvdXBlZFJlZ2V4Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/route-regex.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/router/utils/sorted-routes.js": /*!*************************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/router/utils/sorted-routes.js ***! \*************************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _classCallCheck = (__webpack_require__(/*! @swc/helpers/lib/_class_call_check.js */ \"./node_modules/@swc/helpers/lib/_class_call_check.js\")[\"default\"]);\nvar _createClass = (__webpack_require__(/*! @swc/helpers/lib/_create_class.js */ \"./node_modules/@swc/helpers/lib/_create_class.js\")[\"default\"]);\nvar _toConsumableArray = (__webpack_require__(/*! @swc/helpers/lib/_to_consumable_array.js */ \"./node_modules/@swc/helpers/lib/_to_consumable_array.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getSortedRoutes = getSortedRoutes;\nvar UrlNode = /*#__PURE__*/ function() {\n function UrlNode() {\n _classCallCheck(this, UrlNode);\n this.placeholder = true;\n this.children = new Map();\n this.slugName = null;\n this.restSlugName = null;\n this.optionalRestSlugName = null;\n }\n _createClass(UrlNode, [\n {\n key: \"insert\",\n value: function insert(urlPath) {\n this._insert(urlPath.split(\"/\").filter(Boolean), [], false);\n }\n },\n {\n key: \"smoosh\",\n value: function smoosh() {\n return this._smoosh();\n }\n },\n {\n key: \"_smoosh\",\n value: function _smoosh() {\n var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \"/\";\n var _this = this;\n var childrenPaths = _toConsumableArray(this.children.keys()).sort();\n if (this.slugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[]\"), 1);\n }\n if (this.restSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[...]\"), 1);\n }\n if (this.optionalRestSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[[...]]\"), 1);\n }\n var routes = childrenPaths.map(function(c) {\n return _this.children.get(c)._smoosh(\"\".concat(prefix).concat(c, \"/\"));\n }).reduce(function(prev, curr) {\n return _toConsumableArray(prev).concat(_toConsumableArray(curr));\n }, []);\n if (this.slugName !== null) {\n var _routes;\n (_routes = routes).push.apply(_routes, _toConsumableArray(this.children.get(\"[]\")._smoosh(\"\".concat(prefix, \"[\").concat(this.slugName, \"]/\"))));\n }\n if (!this.placeholder) {\n var r = prefix === \"/\" ? \"/\" : prefix.slice(0, -1);\n if (this.optionalRestSlugName != null) {\n throw new Error('You cannot define a route with the same specificity as a optional catch-all route (\"'.concat(r, '\" and \"').concat(r, \"[[...\").concat(this.optionalRestSlugName, ']]\").'));\n }\n routes.unshift(r);\n }\n if (this.restSlugName !== null) {\n var _routes1;\n (_routes1 = routes).push.apply(_routes1, _toConsumableArray(this.children.get(\"[...]\")._smoosh(\"\".concat(prefix, \"[...\").concat(this.restSlugName, \"]/\"))));\n }\n if (this.optionalRestSlugName !== null) {\n var _routes2;\n (_routes2 = routes).push.apply(_routes2, _toConsumableArray(this.children.get(\"[[...]]\")._smoosh(\"\".concat(prefix, \"[[...\").concat(this.optionalRestSlugName, \"]]/\"))));\n }\n return routes;\n }\n },\n {\n key: \"_insert\",\n value: function _insert(urlPaths, slugNames, isCatchAll) {\n if (urlPaths.length === 0) {\n this.placeholder = false;\n return;\n }\n if (isCatchAll) {\n throw new Error(\"Catch-all must be the last part of the URL.\");\n }\n // The next segment in the urlPaths list\n var nextSegment = urlPaths[0];\n // Check if the segment matches `[something]`\n if (nextSegment.startsWith(\"[\") && nextSegment.endsWith(\"]\")) {\n var handleSlug = function handleSlug(previousSlug, nextSlug) {\n if (previousSlug !== null) {\n // If the specific segment already has a slug but the slug is not `something`\n // This prevents collisions like:\n // pages/[post]/index.js\n // pages/[id]/index.js\n // Because currently multiple dynamic params on the same segment level are not supported\n if (previousSlug !== nextSlug) {\n // TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.\n throw new Error(\"You cannot use different slug names for the same dynamic path ('\".concat(previousSlug, \"' !== '\").concat(nextSlug, \"').\"));\n }\n }\n slugNames.forEach(function(slug) {\n if (slug === nextSlug) {\n throw new Error('You cannot have the same slug name \"'.concat(nextSlug, '\" repeat within a single dynamic path'));\n }\n if (slug.replace(/\\W/g, \"\") === nextSegment.replace(/\\W/g, \"\")) {\n throw new Error('You cannot have the slug names \"'.concat(slug, '\" and \"').concat(nextSlug, '\" differ only by non-word symbols within a single dynamic path'));\n }\n });\n slugNames.push(nextSlug);\n };\n // Strip `[` and `]`, leaving only `something`\n var segmentName = nextSegment.slice(1, -1);\n var isOptional = false;\n if (segmentName.startsWith(\"[\") && segmentName.endsWith(\"]\")) {\n // Strip optional `[` and `]`, leaving only `something`\n segmentName = segmentName.slice(1, -1);\n isOptional = true;\n }\n if (segmentName.startsWith(\"...\")) {\n // Strip `...`, leaving only `something`\n segmentName = segmentName.substring(3);\n isCatchAll = true;\n }\n if (segmentName.startsWith(\"[\") || segmentName.endsWith(\"]\")) {\n throw new Error(\"Segment names may not start or end with extra brackets ('\".concat(segmentName, \"').\"));\n }\n if (segmentName.startsWith(\".\")) {\n throw new Error(\"Segment names may not start with erroneous periods ('\".concat(segmentName, \"').\"));\n }\n if (isCatchAll) {\n if (isOptional) {\n if (this.restSlugName != null) {\n throw new Error('You cannot use both an required and optional catch-all route at the same level (\"[...'.concat(this.restSlugName, ']\" and \"').concat(urlPaths[0], '\" ).'));\n }\n handleSlug(this.optionalRestSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.optionalRestSlugName = segmentName;\n // nextSegment is overwritten to [[...]] so that it can later be sorted specifically\n nextSegment = \"[[...]]\";\n } else {\n if (this.optionalRestSlugName != null) {\n throw new Error('You cannot use both an optional and required catch-all route at the same level (\"[[...'.concat(this.optionalRestSlugName, ']]\" and \"').concat(urlPaths[0], '\").'));\n }\n handleSlug(this.restSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.restSlugName = segmentName;\n // nextSegment is overwritten to [...] so that it can later be sorted specifically\n nextSegment = \"[...]\";\n }\n } else {\n if (isOptional) {\n throw new Error('Optional route parameters are not yet supported (\"'.concat(urlPaths[0], '\").'));\n }\n handleSlug(this.slugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.slugName = segmentName;\n // nextSegment is overwritten to [] so that it can later be sorted specifically\n nextSegment = \"[]\";\n }\n }\n // If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode\n if (!this.children.has(nextSegment)) {\n this.children.set(nextSegment, new UrlNode());\n }\n this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);\n }\n }\n ]);\n return UrlNode;\n}();\nfunction getSortedRoutes(normalizedPages) {\n // First the UrlNode is created, and every UrlNode can have only 1 dynamic segment\n // Eg you can't have pages/[post]/abc.js and pages/[hello]/something-else.js\n // Only 1 dynamic segment per nesting level\n // So in the case that is test/integration/dynamic-routing it'll be this:\n // pages/[post]/comments.js\n // pages/blog/[post]/comment/[id].js\n // Both are fine because `pages/[post]` and `pages/blog` are on the same level\n // So in this case `UrlNode` created here has `this.slugName === 'post'`\n // And since your PR passed through `slugName` as an array basically it'd including it in too many possibilities\n // Instead what has to be passed through is the upwards path's dynamic names\n var root = new UrlNode();\n // Here the `root` gets injected multiple paths, and insert will break them up into sublevels\n normalizedPages.forEach(function(pagePath) {\n return root.insert(pagePath);\n });\n // Smoosh will then sort those sublevels up to the point where you get the correct route definition priority\n return root.smoosh();\n} //# sourceMappingURL=sorted-routes.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL3NvcnRlZC1yb3V0ZXMuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Ozs7Ozs7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCx1QkFBdUIsR0FBR0UsZUFBZSxDQUFDO0FBQzFDLFdBQWEsaUJBNElUO2FBNUlFQyxPQUFPOzhCQUFQQSxPQUFPO1FBcUlMLElBQUksQ0FBQ0MsV0FBVyxHQUFHLElBQUksQ0FBQztRQUN4QixJQUFJLENBQUNDLFFBQVEsR0FBRyxJQUFJQyxHQUFHLEVBQUUsQ0FBQztRQUMxQixJQUFJLENBQUNDLFFBQVEsR0FBRyxJQUFJLENBQUM7UUFDckIsSUFBSSxDQUFDQyxZQUFZLEdBQUcsSUFBSSxDQUFDO1FBQ3pCLElBQUksQ0FBQ0Msb0JBQW9CLEdBQUcsSUFBSSxDQUFDOztpQkF6SW5DTixPQUFPOztZQUNUTyxHQUFNLEVBQU5BLFFBQU07bUJBQU5BLFNBQUFBLE1BQU0sQ0FBQ0MsT0FBTyxFQUFFO2dCQUNaLElBQUksQ0FBQ0MsT0FBTyxDQUFDRCxPQUFPLENBQUNFLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQ0MsTUFBTSxDQUFDQyxPQUFPLENBQUMsRU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W9uIGNhbiBiZSBiYXNlZCBvbiBhYm92ZSBjb21tZW50LlxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBZb3UgY2Fubm90IHVzZSBkaWZmZXJlbnQgc2x1ZyBuYW1lcyBmb3IgdGhlIHNhbWUgZHluYW1pYyBwYXRoICgnJHtwcmV2aW91c1NsdWd9JyAhPT0gJyR7bmV4dFNsdWd9JykuYCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2x1Z05hbWVzLmZvckVhY2goKHNsdWcpPT57XG4gICAgICAgICAgICAgICAgICAgIGlmIChzbHVnID09PSBuZXh0U2x1Zykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBZb3UgY2Fubm90IGhhdmUgdGhlIHNhbWUgc2x1ZyBuYW1lIFwiJHtuZXh0U2x1Z31cIiByZXBlYXQgd2l0aGluIGEgc2luZ2xlIGR5bmFtaWMgcGF0aGApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChzbHVnLnJlcGxhY2UoL1xcVy9nLCAnJykgPT09IG5leHRTZWdtZW50LnJlcGxhY2UoL1xcVy9nLCAnJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgWW91IGNhbm5vdCBoYXZlIHRoZSBzbHVnIG5hbWVzIFwiJHtzbHVnfVwiIGFuZCBcIiR7bmV4dFNsdWd9XCIgZGlmZmVyIG9ubHkgYnkgbm9uLXdvcmQgc3ltYm9scyB3aXRoaW4gYSBzaW5nbGUgZHluYW1pYyBwYXRoYCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBzbHVnTmFtZXMucHVzaChuZXh0U2x1Zyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNDYXRjaE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NPcHRpb25hbCIsInN1YnN0cmluZyIsImhhcyIsInNldCIsIm5vcm1hbGl6ZWRQYWdlcyIsInJvb3QiLCJwYWdlUGF0aCJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/router/utils/sorted-routes.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/runtime-config.js": /*!*************************************************************!*\ !*** ./node_modules/next/dist/shared/lib/runtime-config.js ***! \*************************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.setConfig = setConfig;\nexports[\"default\"] = void 0;\nvar runtimeConfig;\nvar _default = function() {\n return runtimeConfig;\n};\nexports[\"default\"] = _default;\nfunction setConfig(configValue) {\n runtimeConfig = configValue;\n}\nif ((typeof exports.default === \"function\" || typeof exports.default === \"object\" && exports.default !== null) && typeof exports.default.__esModule === \"undefined\") {\n Object.defineProperty(exports.default, \"__esModule\", {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=runtime-config.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvcnVudGltZS1jb25maWcuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0FBQztBQUNIRCxpQkFBaUIsR0FBR0UsU0FBUyxDQUFDO0FBQzlCRixrQkFBZSxHQUFHLEtBQUssQ0FBQyxDQUFDO0FBQ3pCLElBQUlJLGFBQWE7QUFDakIsSUFBSUMsUUFBUSxHQUFHLFdBQUk7SUFDZixPQUFPRCxhQUFhLENBQUM7QUFDekIsQ0FBQztBQUNESixrQkFBZSxHQUFHSyxRQUFRLENBQUM7QUFDM0IsU0FBU0gsU0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Xhwb3J0cy5kZWZhdWx0ID0gX2RlZmF1bHQ7XG5mdW5jdGlvbiBzZXRDb25maWcoY29uZmlnVmFsdWUpIHtcbiAgICBydW50aW1lQ29uZmlnID0gY29uZmlnVmFsdWU7XG59XG5cbmlmICgodHlwZW9mIGV4cG9ydHMuZGVmYXVsdCA9PT0gJ2Z1bmN0aW9uJyB8fCAodHlwZW9mIGV4cG9ydHMuZGVmYXVsdCA9PT0gJ29iamVjdCcgJiYgZXhwb3J0cy5kZWZhdWx0ICE9PSBudWxsKSkgJiYgdHlwZW9mIGV4cG9ydHMuZGVmYXVsdC5fX2VzTW9kdWxlID09PSAndW5kZWZpbmVkJykge1xuICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cy5kZWZhdWx0LCAnX19lc01vZHVsZScsIHsgdmFsdWU6IHRydWUgfSk7XG4gIE9iamVjdC5hc3NpZ24oZXhwb3J0cy5kZWZhdWx0LCBleHBvcnRzKTtcbiAgbW9kdWxlLmV4cG9ydHMgPSBleHBvcnRzLmRlZmF1bHQ7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXJ1bnRpbWUtY29uZmlnLmpzLm1hcCJdLCJuYW1lcyI6WyJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImV4cG9ydHMiLCJ2YWx1ZSIsInNldENvbmZpZyIsImRlZmF1bHQiLCJydW50aW1lQ29uZmlnIiwiX2RlZmF1bHQiLCJjb25maWdWYWx1ZSIsIl9fZXNNb2R1bGUiLCJhc3NpZ24iLCJtb2R1bGUiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/runtime-config.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/side-effect.js": /*!**********************************************************!*\ !*** ./node_modules/next/dist/shared/lib/side-effect.js ***! \**********************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nvar _s = $RefreshSig$();\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = SideEffect;\nvar _interop_require_wildcard = (__webpack_require__(/*! @swc/helpers/lib/_interop_require_wildcard.js */ \"./node_modules/@swc/helpers/lib/_interop_require_wildcard.js\")[\"default\"]);\nvar _react = _interop_require_wildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nfunction SideEffect(props) {\n var emitChange = function emitChange() {\n if (headManager && headManager.mountedInstances) {\n var headElements = _react.Children.toArray(Array.from(headManager.mountedInstances).filter(Boolean));\n headManager.updateHead(reduceComponentsToState(headElements, props));\n }\n };\n _s();\n var headManager = props.headManager, reduceComponentsToState = props.reduceComponentsToState;\n if (isServer) {\n var ref;\n headManager == null ? void 0 : (ref = headManager.mountedInstances) == null ? void 0 : ref.add(props.children);\n emitChange();\n }\n useClientOnlyLayoutEffect(function() {\n var ref1;\n headManager == null ? void 0 : (ref1 = headManager.mountedInstances) == null ? void 0 : ref1.add(props.children);\n return function() {\n var ref;\n headManager == null ? void 0 : (ref = headManager.mountedInstances) == null ? void 0 : ref.delete(props.children);\n };\n });\n // We need to call `updateHead` method whenever the `SideEffect` is trigger in all\n // life-cycles: mount, update, unmount. However, if there are multiple `SideEffect`s\n // being rendered, we only trigger the method from the last one.\n // This is ensured by keeping the last unflushed `updateHead` in the `_pendingUpdate`\n // singleton in the layout effect pass, and actually trigger it in the effect pass.\n useClientOnlyLayoutEffect(function() {\n if (headManager) {\n headManager._pendingUpdate = emitChange;\n }\n return function() {\n if (headManager) {\n headManager._pendingUpdate = emitChange;\n }\n };\n });\n useClientOnlyEffect(function() {\n if (headManager && headManager._pendingUpdate) {\n headManager._pendingUpdate();\n headManager._pendingUpdate = null;\n }\n return function() {\n if (headManager && headManager._pendingUpdate) {\n headManager._pendingUpdate();\n headManager._pendingUpdate = null;\n }\n };\n });\n return null;\n}\n_s(SideEffect, \"gHVkikNHNxjVdD11eJBzaqkCiPY=\", false, function() {\n return [\n useClientOnlyLayoutEffect,\n useClientOnlyLayoutEffect,\n useClientOnlyEffect\n ];\n});\n_c = SideEffect;\nvar isServer = \"object\" === \"undefined\";\nvar useClientOnlyLayoutEffect = isServer ? function() {} : _react.useLayoutEffect;\nvar useClientOnlyEffect = isServer ? function() {} : _react.useEffect; //# sourceMappingURL=side-effect.js.map\nvar _c;\n$RefreshReg$(_c, \"SideEffect\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvc2lkZS1lZmZlY3QuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7O0FBQ2JBLDhDQUE2QztJQUN6Q0csS0FBSyxFQUFFLElBQUk7Q0FDZCxFQUFDLENBQUM7QUFDSEQsa0JBQWUsR0FBR0csVUFBVSxDQUFDO0FBQzdCLElBQUlDLHlCQUF5QixHQUFHQyxxSkFBZ0U7QUFDaEcsSUFBSUMsTUFBTSxHQUFHRix5QkFBeUIsQ0FBQ0MsbUJBQU8sQ0FBQyw0Q0FBTyxDQUFDLENBQUM7QUFDeEQsU0FBU0YsVUFBVSxDQUFDSSxLQUFLLEVBQUU7UUFFZEMsVUFBVSxHQUFuQixTQUFTQSxVQUFVLEdBQUc7UUFDbEIsSUFBSUMsV0FBVyxJQUFJQSxXQUFXLENBQUNDLGdCQUFnQixFQUFFO1lBQzdDLElBQU1DLFlBQVksR0FBR0wsTUFBTSxDQUFDTSxRQUFRLENBQUNDLE9BQU8sQ0FBQ0MsS0FBSyxDQUFDQyxJQUFJLENBQUNOLFdBQVcsQ0FBQ0MsZ0JBQWdCLENBQUMsQ0FBQ00sTUFBTSxDQUFDQyxPQUFPLENBQUMsQ0FBQztZQUN0R1IsV0FBVyxDQUFDUyxVQUFVLENBQUNDLHVCQUF1QixDQUFDUixZQUFZLEVBQUVKLEtBQUssQ0FBQyxDQUFDLENBQUM7UUFDekUsQ0FBQztJQUNMLENBQUM7O0lBTkQsSUFBUUUsV0FBVyxHQUFnQ0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=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/side-effect.js\n")); /***/ }), /***/ "./node_modules/next/dist/shared/lib/utils.js": /*!****************************************************!*\ !*** ./node_modules/next/dist/shared/lib/utils.js ***! \****************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nvar _classCallCheck = (__webpack_require__(/*! @swc/helpers/lib/_class_call_check.js */ \"./node_modules/@swc/helpers/lib/_class_call_check.js\")[\"default\"]);\nvar _inherits = (__webpack_require__(/*! @swc/helpers/lib/_inherits.js */ \"./node_modules/@swc/helpers/lib/_inherits.js\")[\"default\"]);\nvar _toConsumableArray = (__webpack_require__(/*! @swc/helpers/lib/_to_consumable_array.js */ \"./node_modules/@swc/helpers/lib/_to_consumable_array.js\")[\"default\"]);\nvar _wrapNativeSuper = (__webpack_require__(/*! @swc/helpers/lib/_wrap_native_super.js */ \"./node_modules/@swc/helpers/lib/_wrap_native_super.js\")[\"default\"]);\nvar _createSuper = (__webpack_require__(/*! @swc/helpers/lib/_create_super.js */ \"./node_modules/@swc/helpers/lib/_create_super.js\")[\"default\"]);\nvar _tsGenerator = (__webpack_require__(/*! @swc/helpers/lib/_ts_generator.js */ \"./node_modules/@swc/helpers/lib/_ts_generator.js\")[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.execOnce = execOnce;\nexports.getLocationOrigin = getLocationOrigin;\nexports.getURL = getURL;\nexports.getDisplayName = getDisplayName;\nexports.isResSent = isResSent;\nexports.normalizeRepeatedSlashes = normalizeRepeatedSlashes;\nexports.loadGetInitialProps = loadGetInitialProps;\nexports.ST = exports.SP = exports.warnOnce = exports.isAbsoluteUrl = void 0;\nvar _async_to_generator = (__webpack_require__(/*! @swc/helpers/lib/_async_to_generator.js */ \"./node_modules/@swc/helpers/lib/_async_to_generator.js\")[\"default\"]);\nfunction execOnce(fn) {\n var used = false;\n var result;\n return function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n if (!used) {\n used = true;\n result = fn.apply(void 0, _toConsumableArray(args));\n }\n return result;\n };\n}\n// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1\n// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\nvar ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\\d+\\-.]*?:/;\nvar isAbsoluteUrl = function(url) {\n return ABSOLUTE_URL_REGEX.test(url);\n};\nexports.isAbsoluteUrl = isAbsoluteUrl;\nfunction getLocationOrigin() {\n var _location = window.location, protocol = _location.protocol, hostname = _location.hostname, port = _location.port;\n return \"\".concat(protocol, \"//\").concat(hostname).concat(port ? \":\" + port : \"\");\n}\nfunction getURL() {\n var href = window.location.href;\n var origin = getLocationOrigin();\n return href.substring(origin.length);\n}\nfunction getDisplayName(Component) {\n return typeof Component === \"string\" ? Component : Component.displayName || Component.name || \"Unknown\";\n}\nfunction isResSent(res) {\n return res.finished || res.headersSent;\n}\nfunction normalizeRepeatedSlashes(url) {\n var urlParts = url.split(\"?\");\n var urlNoQuery = urlParts[0];\n return urlNoQuery // first we replace any non-encoded backslashes with forward\n // then normalize repeated forward slashes\n .replace(/\\\\/g, \"/\").replace(/\\/\\/+/g, \"/\") + (urlParts[1] ? \"?\".concat(urlParts.slice(1).join(\"?\")) : \"\");\n}\nfunction loadGetInitialProps(App, ctx) {\n return _loadGetInitialProps.apply(this, arguments);\n}\nfunction _loadGetInitialProps() {\n _loadGetInitialProps = _async_to_generator(function(App, ctx) {\n var ref, message, res, _tmp, props, message1;\n return _tsGenerator(this, function(_state) {\n switch(_state.label){\n case 0:\n if (true) {\n ;\n if ((ref = App.prototype) == null ? void 0 : ref.getInitialProps) {\n message = '\"'.concat(getDisplayName(App), '.getInitialProps()\" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.');\n throw new Error(message);\n }\n }\n res = ctx.res || ctx.ctx && ctx.ctx.res;\n if (!!App.getInitialProps) return [\n 3,\n 3\n ];\n if (!(ctx.ctx && ctx.Component)) return [\n 3,\n 2\n ];\n _tmp = {};\n return [\n 4,\n loadGetInitialProps(ctx.Component, ctx.ctx)\n ];\n case 1:\n // @ts-ignore pageProps default\n return [\n 2,\n (_tmp.pageProps = _state.sent(), _tmp)\n ];\n case 2:\n return [\n 2,\n {}\n ];\n case 3:\n return [\n 4,\n App.getInitialProps(ctx)\n ];\n case 4:\n props = _state.sent();\n if (res && isResSent(res)) {\n return [\n 2,\n props\n ];\n }\n if (!props) {\n message1 = '\"'.concat(getDisplayName(App), '.getInitialProps()\" should resolve to an object. But found \"').concat(props, '\" instead.');\n throw new Error(message1);\n }\n if (true) {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(\"\".concat(getDisplayName(App), \" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps\"));\n }\n }\n return [\n 2,\n props\n ];\n }\n });\n });\n return _loadGetInitialProps.apply(this, arguments);\n}\nvar warnOnce = function(_) {};\nif (true) {\n var warnings = new Set();\n exports.warnOnce = warnOnce = function(msg) {\n if (!warnings.has(msg)) {\n console.warn(msg);\n }\n warnings.add(msg);\n };\n}\nvar SP = typeof performance !== \"undefined\";\nexports.SP = SP;\nvar ST = SP && [\n \"mark\",\n \"measure\",\n \"getEntriesByName\"\n].every(function(method) {\n return typeof performance[method] === \"function\";\n});\nexports.ST = ST;\nvar DecodeError = /*#__PURE__*/ function(Error1) {\n _inherits(DecodeError, Error1);\n var _super = _createSuper(DecodeError);\n function DecodeError() {\n _classCallCheck(this, DecodeError);\n return _super.apply(this, arguments);\n }\n return DecodeError;\n}(_wrapNativeSuper(Error));\nexports.DecodeError = DecodeError;\nvar NormalizeError = /*#__PURE__*/ function(Error1) {\n _inherits(NormalizeError, Error1);\n var _super = _createSuper(NormalizeError);\n function NormalizeError() {\n _classCallCheck(this, NormalizeError);\n return _super.apply(this, arguments);\n }\n return NormalizeError;\n}(_wrapNativeSuper(Error));\nexports.NormalizeError = NormalizeError;\nvar PageNotFoundError = /*#__PURE__*/ function(Error1) {\n _inherits(PageNotFoundError, Error1);\n var _super = _createSuper(PageNotFoundError);\n function PageNotFoundError(page) {\n _classCallCheck(this, PageNotFoundError);\n var _this;\n _this = _super.call(this);\n _this.code = \"ENOENT\";\n _this.message = \"Cannot find module for page: \".concat(page);\n return _this;\n }\n return PageNotFoundError;\n}(_wrapNativeSuper(Error));\nexports.PageNotFoundError = PageNotFoundError;\nvar MissingStaticPage = /*#__PURE__*/ function(Error1) {\n _inherits(MissingStaticPage, Error1);\n var _super = _createSuper(MissingStaticPage);\n function MissingStaticPage(page, message) {\n _classCallCheck(this, MissingStaticPage);\n var _this;\n _this = _super.call(this);\n _this.message = \"Failed to load static file for page: \".concat(page, \" \").concat(message);\n return _this;\n }\n return MissingStaticPage;\n}(_wrapNativeSuper(Error));\nexports.MissingStaticPage = MissingStaticPage;\nvar MiddlewareNotFoundError = /*#__PURE__*/ function(Error1) {\n _inherits(MiddlewareNotFoundError, Error1);\n var _super = _createSuper(MiddlewareNotFoundError);\n function MiddlewareNotFoundError() {\n _classCallCheck(this, MiddlewareNotFoundError);\n var _this;\n _this = _super.call(this);\n _this.code = \"ENOENT\";\n _this.message = \"Cannot find the middleware module\";\n return _this;\n }\n return MiddlewareNotFoundError;\n}(_wrapNativeSuper(Error));\nexports.MiddlewareNotFoundError = MiddlewareNotFoundError;\nexports.warnOnce = warnOnce; //# sourceMappingURL=utils.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NoYXJlZC9saWIvdXRpbHMuanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7Ozs7Ozs7Ozs7QUFDYkEsOENBQTZDO0lBQ3pDRyxLQUFLLEVBQUUsSUFBSTtDQUNkLEVBQUMsQ0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3R4YFxuICAgICAgICBjb25zdCByZXMgPSBjdHgucmVzIHx8IGN0eC5jdHggJiYgY3R4LmN0eC5yZXM7XG4gICAgICAgIGlmICghQXBwLmdldEluaXRpYWxQcm9wcykge1xuICAgICAgICAgICAgaWYgKGN0eC5jdHggJiYgY3R4LkNvbXBvbmVudCkge1xuICAgICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmUgcGFnZVByb3BzIGRlZmF1bHRcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICBwYWdlUHJvcHM6IHlpZWxkIGxvYWRHZXRJbml0aWFsUHJvcHMoY3R4LkNvbXBvbmVudCwgY3R4LmN0eClcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHt9O1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IHByb3BzID0geWllbGQgQXBwLmdldEluaXRpYWxQcm9wcyhjdHgpO1xuICAgICAgICBpZiAocmVzICYmIGlzUmVzU2VudChyZXMpKSB7XG4gICAgICAgICAgICByZXR1cm4gcHJvcHM7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFwcm9wcykge1xuICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IGBcIiR7Z2V0RGlzcGxheU5hbWUoQXBwKX0uZ2V0SW5pdGlhbFByb3BzKClcIiBzaG91bGQgcmVzb2x2ZSB0byBhbiBvYmplY3QuIEJ1dCBmb3VuZCBcIiR7cHJvcHN9XCIgaW5zdGVhZC5gO1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMocHJvcHMpLmxlbmd0aCA9PT0gMCAmJiAhY3R4LmN0eCkge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUud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NldCIsIm1zZyIsImhhcyIsImFkZCIsInBlcmZvcm1hbmNlIiwiZXZlcnkiLCJtZXRob2QiLCJEZWNvZGVFcnJvciIsIk5vcm1hbGl6ZUVycm9yIiwiUGFnZU5vdEZvdW5kRXJyb3IiLCJwYWdlIiwiY29kZSIsIk1pc3NpbmdTdGF0aWNQYWdlIiwiTWlkZGxld2FyZU5vdEZvdW5kRXJyb3IiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/shared/lib/utils.js\n")); /***/ }), /***/ "./node_modules/next/dist/compiled/react-is/cjs/react-is.development.js": /*!******************************************************************************!*\ !*** ./node_modules/next/dist/compiled/react-is/cjs/react-is.development.js ***! \******************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("/** @license React v17.0.2\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n'use strict';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nvar REACT_FRAGMENT_TYPE = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SERVER_BLOCK_TYPE = 0xeada;\nvar REACT_FUNDAMENTAL_TYPE = 0xead5;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n var symbolFor = Symbol.for;\n REACT_ELEMENT_TYPE = symbolFor('react.element');\n REACT_PORTAL_TYPE = symbolFor('react.portal');\n REACT_FRAGMENT_TYPE = symbolFor('react.fragment');\n REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n REACT_PROFILER_TYPE = symbolFor('react.profiler');\n REACT_PROVIDER_TYPE = symbolFor('react.provider');\n REACT_CONTEXT_TYPE = symbolFor('react.context');\n REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n REACT_MEMO_TYPE = symbolFor('react.memo');\n REACT_LAZY_TYPE = symbolFor('react.lazy');\n REACT_BLOCK_TYPE = symbolFor('react.block');\n REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n REACT_SCOPE_TYPE = symbolFor('react.scope');\n REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\n\n// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n}\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false;\nvar hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');\n }\n }\n\n return false;\n}\nfunction isConcurrentMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsConcurrentMode) {\n hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');\n }\n }\n\n return false;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NvbXBpbGVkL3JlYWN0LWlzL2Nqcy9yZWFjdC1pcy5kZXZlbG9wbWVudC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVhOztBQUViLElBQUksSUFBcUM7QUFDekM7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtB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leHBvcnRzLmlzU3VzcGVuc2UgPSBpc1N1c3BlbnNlO1xuZXhwb3J0cy5pc1ZhbGlkRWxlbWVudFR5cGUgPSBpc1ZhbGlkRWxlbWVudFR5cGU7XG5leHBvcnRzLnR5cGVPZiA9IHR5cGVPZjtcbiAgfSkoKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/compiled/react-is/cjs/react-is.development.js\n")); /***/ }), /***/ "./node_modules/next/dist/compiled/react-is/index.js": /*!***********************************************************!*\ !*** ./node_modules/next/dist/compiled/react-is/index.js ***! \***********************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ \"./node_modules/next/dist/compiled/react-is/cjs/react-is.development.js\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NvbXBpbGVkL3JlYWN0LWlzL2luZGV4LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhOztBQUViLElBQUksS0FBcUMsRUFBRSxFQUUxQyxDQUFDO0FBQ0YsRUFBRSxtSkFBeUQ7QUFDM0QiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jb21waWxlZC9yZWFjdC1pcy9pbmRleC5qcz80MjNkIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcblxuaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSAncHJvZHVjdGlvbicpIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9yZWFjdC1pcy5wcm9kdWN0aW9uLm1pbi5qcycpO1xufSBlbHNlIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9yZWFjdC1pcy5kZXZlbG9wbWVudC5qcycpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/compiled/react-is/index.js\n")); /***/ }), /***/ "./node_modules/next/dist/compiled/web-vitals/web-vitals.js": /*!******************************************************************!*\ !*** ./node_modules/next/dist/compiled/web-vitals/web-vitals.js ***! \******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { eval(__webpack_require__.ts("var __dirname = \"/\";\n(function(){\"use strict\";var n={};!function(){n.d=function(y,T){for(var C in T){if(n.o(T,C)&&!n.o(y,C)){Object.defineProperty(y,C,{enumerable:true,get:T[C]})}}}}();!function(){n.o=function(n,y){return Object.prototype.hasOwnProperty.call(n,y)}}();!function(){n.r=function(n){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(n,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(n,\"__esModule\",{value:true})}}();if(typeof n!==\"undefined\")n.ab=__dirname+\"/\";var y={};n.r(y);n.d(y,{getCLS:function(){return E},getFCP:function(){return g},getFID:function(){return F},getINP:function(){return O},getLCP:function(){return _},getTTFB:function(){return G},onCLS:function(){return E},onFCP:function(){return g},onFID:function(){return F},onINP:function(){return O},onLCP:function(){return _},onTTFB:function(){return G}});var T,C,w,P,I,k=-1,o=function(n){addEventListener(\"pageshow\",(function(y){y.persisted&&(k=y.timeStamp,n(y))}),!0)},c=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0]},u=function(){var n=c();return n&&n.activationStart||0},f=function(n,y){var T=c(),C=\"navigate\";return k>=0?C=\"back-forward-cache\":T&&(C=document.prerendering||u()>0?\"prerender\":T.type.replace(/_/g,\"-\")),{name:n,value:void 0===y?-1:y,rating:\"good\",delta:0,entries:[],id:\"v3-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:C}},s=function(n,y,T){try{if(PerformanceObserver.supportedEntryTypes.includes(n)){var C=new PerformanceObserver((function(n){y(n.getEntries())}));return C.observe(Object.assign({type:n,buffered:!0},T||{})),C}}catch(n){}},d=function(n,y){var T=function t(T){\"pagehide\"!==T.type&&\"hidden\"!==document.visibilityState||(n(T),y&&(removeEventListener(\"visibilitychange\",t,!0),removeEventListener(\"pagehide\",t,!0)))};addEventListener(\"visibilitychange\",T,!0),addEventListener(\"pagehide\",T,!0)},l=function(n,y,T,C){var w,P;return function(I){y.value>=0&&(I||C)&&((P=y.value-(w||0))||void 0===w)&&(w=y.value,y.delta=P,y.rating=function(n,y){return n>y[1]?\"poor\":n>y[0]?\"needs-improvement\":\"good\"}(y.value,T),n(y))}},N=-1,v=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},m=function(){d((function(n){var y=n.timeStamp;N=y}),!0)},h=function(){return N<0&&(N=v(),m(),o((function(){setTimeout((function(){N=v(),m()}),0)}))),{get firstHiddenTime(){return N}}},g=function(n,y){y=y||{};var T,C=[1800,3e3],w=h(),P=f(\"FCP\"),c=function(n){n.forEach((function(n){\"first-contentful-paint\"===n.name&&(k&&k.disconnect(),n.startTime<w.firstHiddenTime&&(P.value=n.startTime-u(),P.entries.push(n),T(!0)))}))},I=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName(\"first-contentful-paint\")[0],k=I?null:s(\"paint\",c);(I||k)&&(T=l(n,P,C,y.reportAllChanges),I&&c([I]),o((function(w){P=f(\"FCP\"),T=l(n,P,C,y.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){P.value=performance.now()-w.timeStamp,T(!0)}))}))})))},j=!1,q=-1,E=function(n,y){y=y||{};var T=[.1,.25];j||(g((function(n){q=n.value})),j=!0);var C,i=function(y){q>-1&&n(y)},w=f(\"CLS\",0),P=0,I=[],p=function(n){n.forEach((function(n){if(!n.hadRecentInput){var y=I[0],T=I[I.length-1];P&&n.startTime-T.startTime<1e3&&n.startTime-y.startTime<5e3?(P+=n.value,I.push(n)):(P=n.value,I=[n]),P>w.value&&(w.value=P,w.entries=I,C())}}))},k=s(\"layout-shift\",p);k&&(C=l(i,w,T,y.reportAllChanges),d((function(){p(k.takeRecords()),C(!0)})),o((function(){P=0,q=-1,w=f(\"CLS\",0),C=l(i,w,T,y.reportAllChanges)})))},x={passive:!0,capture:!0},z=new Date,L=function(n,y){T||(T=y,C=n,w=new Date,A(removeEventListener),S())},S=function(){if(C>=0&&C<w-z){var n={entryType:\"first-input\",name:T.type,target:T.target,cancelable:T.cancelable,startTime:T.timeStamp,processingStart:T.timeStamp+C};P.forEach((function(y){y(n)})),P=[]}},b=function(n){if(n.cancelable){var y=(n.timeStamp>1e12?new Date:performance.now())-n.timeStamp;\"pointerdown\"==n.type?function(n,y){var t=function(){L(n,y),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",t,x),removeEventListener(\"pointercancel\",r,x)};addEventListener(\"pointerup\",t,x),addEventListener(\"pointercancel\",r,x)}(y,n):L(y,n)}},A=function(n){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(y){return n(y,b,x)}))},F=function(n,y){y=y||{};var w,I=[100,300],k=h(),N=f(\"FID\"),v=function(n){n.startTime<k.firstHiddenTime&&(N.value=n.processingStart-n.startTime,N.entries.push(n),w(!0))},m=function(n){n.forEach(v)},j=s(\"first-input\",m);w=l(n,N,I,y.reportAllChanges),j&&d((function(){m(j.takeRecords()),j.disconnect()}),!0),j&&o((function(){var k;N=f(\"FID\"),w=l(n,N,I,y.reportAllChanges),P=[],C=-1,T=null,A(addEventListener),k=v,P.push(k),S()}))},J=0,K=1/0,Q=0,M=function(n){n.forEach((function(n){n.interactionId&&(K=Math.min(K,n.interactionId),Q=Math.max(Q,n.interactionId),J=Q?(Q-K)/7+1:0)}))},B=function(){return I?J:performance.interactionCount||0},D=function(){\"interactionCount\"in performance||I||(I=s(\"event\",M,{type:\"event\",buffered:!0,durationThreshold:0}))},U=0,R=function(){return B()-U},V=[],W={},H=function(n){var y=V[V.length-1],T=W[n.interactionId];if(T||V.length<10||n.duration>y.latency){if(T)T.entries.push(n),T.latency=Math.max(T.latency,n.duration);else{var C={id:n.interactionId,latency:n.duration,entries:[n]};W[C.id]=C,V.push(C)}V.sort((function(n,y){return y.latency-n.latency})),V.splice(10).forEach((function(n){delete W[n.id]}))}},O=function(n,y){y=y||{};var T=[200,500];D();var C,w=f(\"INP\"),a=function(n){n.forEach((function(n){(n.interactionId&&H(n),\"first-input\"===n.entryType)&&(!V.some((function(y){return y.entries.some((function(y){return n.duration===y.duration&&n.startTime===y.startTime}))}))&&H(n))}));var y,T=(y=Math.min(V.length-1,Math.floor(R()/50)),V[y]);T&&T.latency!==w.value&&(w.value=T.latency,w.entries=T.entries,C())},P=s(\"event\",a,{durationThreshold:y.durationThreshold||40});C=l(n,w,T,y.reportAllChanges),P&&(P.observe({type:\"first-input\",buffered:!0}),d((function(){a(P.takeRecords()),w.value<0&&R()>0&&(w.value=0,w.entries=[]),C(!0)})),o((function(){V=[],U=B(),w=f(\"INP\"),C=l(n,w,T,y.reportAllChanges)})))},X={},_=function(n,y){y=y||{};var T,C=[2500,4e3],w=h(),P=f(\"LCP\"),c=function(n){var y=n[n.length-1];if(y){var C=y.startTime-u();C<w.firstHiddenTime&&(P.value=C,P.entries=[y],T())}},I=s(\"largest-contentful-paint\",c);if(I){T=l(n,P,C,y.reportAllChanges);var v=function(){X[P.id]||(c(I.takeRecords()),I.disconnect(),X[P.id]=!0,T(!0))};[\"keydown\",\"click\"].forEach((function(n){addEventListener(n,v,{once:!0,capture:!0})})),d(v,!0),o((function(w){P=f(\"LCP\"),T=l(n,P,C,y.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){P.value=performance.now()-w.timeStamp,X[P.id]=!0,T(!0)}))}))}))}},Y=function e(n){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e(n)}),!0):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return e(n)}),!0):setTimeout(n,0)},G=function(n,y){y=y||{};var T=[800,1800],C=f(\"TTFB\"),w=l(n,C,T,y.reportAllChanges);Y((function(){var P=c();if(P){if(C.value=Math.max(P.responseStart-u(),0),C.value<0||C.value>performance.now())return;C.entries=[P],w(!0),o((function(){C=f(\"TTFB\",0),(w=l(n,C,T,y.reportAllChanges))(!0)}))}}))};module.exports=y})();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NvbXBpbGVkL3dlYi12aXRhbHMvd2ViLXZpdGFscy5qcy5qcyIsIm1hcHBpbmdzIjoiO0FBQUEsWUFBWSxhQUFhLFNBQVMsWUFBWSxrQkFBa0IsZ0JBQWdCLHdCQUF3QiwyQkFBMkIseUJBQXlCLEtBQUssR0FBRyxZQUFZLGtCQUFrQixrREFBa0QsR0FBRyxZQUFZLGdCQUFnQixvREFBb0QsNENBQTRDLGVBQWUsRUFBRSxzQ0FBc0MsV0FBVyxHQUFHLEdBQUcsK0JBQStCLFNBQVMsS0FBSyxTQUFTLE9BQU8sT0FBTyxrQkFBa0IsU0FBUyxtQkFBbUIsU0FBUyxtQkFBbUIsU0FBUyxtQkFBbUIsU0FBUyxtQkFBbUIsU0FBUyxvQkFBb0IsU0FBUyxrQkFBa0IsU0FBUyxrQkFBa0IsU0FBUyxrQkFBa0IsU0FBUyxrQkFBa0IsU0FBUyxrQkFBa0IsU0FBUyxtQkFBbUIsVUFBVSxFQUFFLGlDQUFpQyx5Q0FBeUMsa0NBQWtDLE1BQU0sY0FBYyx1R0FBdUcsY0FBYyxVQUFVLCtCQUErQixpQkFBaUIsdUJBQXVCLDZHQUE2RyxxS0FBcUssbUJBQW1CLElBQUksd0RBQXdELDJDQUEyQyxrQkFBa0IsR0FBRyxnQ0FBZ0MsbUJBQW1CLE1BQU0sTUFBTSxXQUFXLGlCQUFpQixvQkFBb0Ise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pb24odyl7UD1mKFwiTENQXCIpLFQ9bChuLFAsQyx5LnJlcG9ydEFsbENoYW5nZXMpLHJlcXVlc3RBbmltYXRpb25GcmFtZSgoZnVuY3Rpb24oKXtyZXF1ZXN0QW5pbWF0aW9uRnJhbWUoKGZ1bmN0aW9uKCl7UC52YWx1ZT1wZXJmb3JtYW5jZS5ub3coKS13LnRpbWVTdGFtcCxYW1AuaWRdPSEwLFQoITApfSkpfSkpfSkpfX0sWT1mdW5jdGlvbiBlKG4pe2RvY3VtZW50LnByZXJlbmRlcmluZz9hZGRFdmVudExpc3RlbmVyKFwicHJlcmVuZGVyaW5nY2hhbmdlXCIsKGZ1bmN0aW9uKCl7cmV0dXJuIGUobil9KSwhMCk6XCJjb21wbGV0ZVwiIT09ZG9jdW1lbnQucmVhZHlTdGF0ZT9hZGRFdmVudExpc3RlbmVyKFwibG9hZFwiLChmdW5jdGlvbigpe3JldHVybiBlKG4pfSksITApOnNldFRpbWVvdXQobiwwKX0sRz1mdW5jdGlvbihuLHkpe3k9eXx8e307dmFyIFQ9WzgwMCwxODAwXSxDPWYoXCJUVEZCXCIpLHc9bChuLEMsVCx5LnJlcG9ydEFsbENoYW5nZXMpO1koKGZ1bmN0aW9uKCl7dmFyIFA9YygpO2lmKFApe2lmKEMudmFsdWU9TWF0aC5tYXgoUC5yZXNwb25zZVN0YXJ0LXUoKSwwKSxDLnZhbHVlPDB8fEMudmFsdWU+cGVyZm9ybWFuY2Uubm93KCkpcmV0dXJuO0MuZW50cmllcz1bUF0sdyghMCksbygoZnVuY3Rpb24oKXtDPWYoXCJUVEZCXCIsMCksKHc9bChuLEMsVCx5LnJlcG9ydEFsbENoYW5nZXMpKSghMCl9KSl9fSkpfTttb2R1bGUuZXhwb3J0cz15fSkoKTsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/compiled/web-vitals/web-vitals.js\n")); /***/ }), /***/ "./node_modules/next/dist/lib/is-error.js": /*!************************************************!*\ !*** ./node_modules/next/dist/lib/is-error.js ***! \************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = isError;\nexports.getProperError = getProperError;\nvar _isPlainObject = __webpack_require__(/*! ../shared/lib/is-plain-object */ \"./node_modules/next/dist/shared/lib/is-plain-object.js\");\nfunction isError(err) {\n return typeof err === \"object\" && err !== null && \"name\" in err && \"message\" in err;\n}\nfunction getProperError(err) {\n if (isError(err)) {\n return err;\n }\n if (true) {\n // provide better error for case where `throw undefined`\n // is called in development\n if (typeof err === \"undefined\") {\n return new Error(\"An undefined error was thrown, \" + \"see here for more info: https://nextjs.org/docs/messages/threw-undefined\");\n }\n if (err === null) {\n return new Error(\"A null error was thrown, \" + \"see here for more info: https://nextjs.org/docs/messages/threw-undefined\");\n }\n }\n return new Error((0, _isPlainObject).isPlainObject(err) ? JSON.stringify(err) : err + \"\");\n}\n\n//# sourceMappingURL=is-error.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2xpYi9pcy1lcnJvci5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLGtCQUFlO0FBQ2Ysc0JBQXNCO0FBQ3RCLHFCQUFxQixtQkFBTyxDQUFDLDZGQUErQjtBQUM1RDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFFBQVEsSUFBc0M7QUFDOUM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvbmV4dC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5kZWZpbmVkXCIpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChlcnIgPT09IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgRXJyb3IoXCJBIG51bGwgZXJyb3Igd2FzIHRocm93biwgXCIgKyBcInNlZSBoZXJlIGZvciBtb3JlIGluZm86IGh0dHBzOi8vbmV4dGpzLm9yZy9kb2NzL21lc3NhZ2VzL3RocmV3LXVuZGVmaW5lZFwiKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gbmV3IEVycm9yKCgwLCBfaXNQbGFpbk9iamVjdCkuaXNQbGFpbk9iamVjdChlcnIpID8gSlNPTi5zdHJpbmdpZnkoZXJyKSA6IGVyciArIFwiXCIpO1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1pcy1lcnJvci5qcy5tYXAiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/lib/is-error.js\n")); /***/ }), /***/ "./node_modules/next/router.js": /*!*************************************!*\ !*** ./node_modules/next/router.js ***! \*************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { eval(__webpack_require__.ts("module.exports = __webpack_require__(/*! ./dist/client/router */ \"./node_modules/next/dist/client/router.js\")\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9yb3V0ZXIuanMuanMiLCJtYXBwaW5ncyI6IkFBQUEsNkdBQWdEIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL25vZGVfbW9kdWxlcy9uZXh0L3JvdXRlci5qcz8xYmI2Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9kaXN0L2NsaWVudC9yb3V0ZXInKVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/router.js\n")); /***/ }), /***/ "./node_modules/react-dom/cjs/react-dom.development.js": /*!*************************************************************!*\ !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar Scheduler = __webpack_require__(/*! scheduler */ \"./node_modules/scheduler/index.js\");\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nvar suppressWarning = false;\nfunction setSuppressWarning(newSuppressWarning) {\n {\n suppressWarning = newSuppressWarning;\n }\n} // In DEV, calls to console.warn and console.error get replaced\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n if (!suppressWarning) {\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 printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n if (!suppressWarning) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\n\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar ScopeComponent = 21;\nvar OffscreenComponent = 22;\nvar LegacyHiddenComponent = 23;\nvar CacheComponent = 24;\nvar TracingMarkerComponent = 25;\n\n// -----------------------------------------------------------------------------\n\nvar enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing\n// the react-reconciler package.\n\nvar enableNewReconciler = false; // Support legacy Primer support on internal FB www\n\nvar enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics.\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n\nvar enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz\n// React DOM Chopping Block\n//\n// Similar to main Chopping Block but only flags related to React DOM. These are\n// grouped because we will likely batch all of them into a single major release.\n// -----------------------------------------------------------------------------\n// Disable support for comment nodes as React DOM containers. Already disabled\n// in open source, but www codebase still relies on it. Need to remove.\n\nvar disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection.\n// and client rendering, mostly to allow JSX attributes to apply to the custom\n// element's object properties instead of only HTML attributes.\n// https://github.com/facebook/react/issues/11347\n\nvar enableCustomElementPropertySupport = false; // Disables children for <textarea> elements\nvar warnAboutStringRefs = false; // -----------------------------------------------------------------------------\n// Debugging and DevTools\n// -----------------------------------------------------------------------------\n// Adds user timing marks for e.g. state updates, suspense, and work loop stuff,\n// for an experimental timeline tool.\n\nvar enableSchedulingProfiler = true; // Helps identify side effects in render-phase lifecycle hooks and setState\n\nvar enableProfilerTimer = true; // Record durations for commit and passive effects phases.\n\nvar enableProfilerCommitHooks = true; // Phase param passed to onRender callback differentiates between an \"update\" and a \"cascading-update\".\n\nvar allNativeEvents = new Set();\n/**\n * Mapping from registration name to event name\n */\n\n\nvar registrationNameDependencies = {};\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\n\nvar possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true\n\nfunction registerTwoPhaseEvent(registrationName, dependencies) {\n registerDirectEvent(registrationName, dependencies);\n registerDirectEvent(registrationName + 'Capture', dependencies);\n}\nfunction registerDirectEvent(registrationName, dependencies) {\n {\n if (registrationNameDependencies[registrationName]) {\n error('EventRegistry: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName);\n }\n }\n\n registrationNameDependencies[registrationName] = dependencies;\n\n {\n var lowerCasedName = registrationName.toLowerCase();\n possibleRegistrationNames[lowerCasedName] = registrationName;\n\n if (registrationName === 'onDoubleClick') {\n possibleRegistrationNames.ondblclick = registrationName;\n }\n }\n\n for (var i = 0; i < dependencies.length; i++) {\n allNativeEvents.add(dependencies[i]);\n }\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\n\nfunction checkAttributeStringCoercion(value, attributeName) {\n {\n if (willCoercionThrow(value)) {\n error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\nfunction checkPropStringCoercion(value, propName) {\n {\n if (willCoercionThrow(value)) {\n error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\nfunction checkCSSPropertyStringCoercion(value, propName) {\n {\n if (willCoercionThrow(value)) {\n error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\nfunction checkHtmlStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\nfunction checkFormFieldValueStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\n// A reserved attribute.\n// It is handled by React separately and shouldn't be written to the DOM.\nvar RESERVED = 0; // A simple string attribute.\n// Attributes that aren't in the filter are presumed to have this type.\n\nvar STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called\n// \"enumerated\" attributes with \"true\" and \"false\" as possible values.\n// When true, it should be set to a \"true\" string.\n// When false, it should be set to a \"false\" string.\n\nvar BOOLEANISH_STRING = 2; // A real boolean attribute.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\n\nvar BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\n// For any other value, should be present with that value.\n\nvar OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n// When falsy, it should be removed.\n\nvar NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n// When falsy, it should be removed.\n\nvar POSITIVE_NUMERIC = 6;\n\n/* eslint-disable max-len */\nvar ATTRIBUTE_NAME_START_CHAR = \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n/* eslint-enable max-len */\n\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n\n illegalAttributeNameCache[attributeName] = true;\n\n {\n error('Invalid attribute name: `%s`', attributeName);\n }\n\n return false;\n}\nfunction shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null) {\n return propertyInfo.type === RESERVED;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return true;\n }\n\n return false;\n}\nfunction shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n return false;\n }\n\n switch (typeof value) {\n case 'function': // $FlowIssue symbol is perfectly valid here\n\n case 'symbol':\n // eslint-disable-line\n return true;\n\n case 'boolean':\n {\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n return !propertyInfo.acceptsBooleans;\n } else {\n var prefix = name.toLowerCase().slice(0, 5);\n return prefix !== 'data-' && prefix !== 'aria-';\n }\n }\n\n default:\n return false;\n }\n}\nfunction shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n if (value === null || typeof value === 'undefined') {\n return true;\n }\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n return true;\n }\n\n if (isCustomComponentTag) {\n\n return false;\n }\n\n if (propertyInfo !== null) {\n\n switch (propertyInfo.type) {\n case BOOLEAN:\n return !value;\n\n case OVERLOADED_BOOLEAN:\n return value === false;\n\n case NUMERIC:\n return isNaN(value);\n\n case POSITIVE_NUMERIC:\n return isNaN(value) || value < 1;\n }\n }\n\n return false;\n}\nfunction getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nfunction PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {\n this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n this.attributeName = attributeName;\n this.attributeNamespace = attributeNamespace;\n this.mustUseProperty = mustUseProperty;\n this.propertyName = name;\n this.type = type;\n this.sanitizeURL = sanitizeURL;\n this.removeEmptyString = removeEmptyString;\n} // When adding attributes to this list, be sure to also add them to\n// the `possibleStandardNames` module to ensure casing and incorrect\n// name warnings.\n\n\nvar properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\n\nvar reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular\n// elements (not just inputs). Now that ReactDOMInput assigns to the\n// defaultValue property -- do we need this?\n'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];\n\nreservedProps.forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // A few React string attributes have a different name.\n// This is a mapping from React prop names to the attribute names.\n\n[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n var name = _ref[0],\n attributeName = _ref[1];\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // These are \"enumerated\" HTML attributes that accept \"true\" and \"false\".\n// In React, we let users pass `true` and `false` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n\n['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // These are \"enumerated\" SVG attributes that accept \"true\" and \"false\".\n// In React, we let users pass `true` and `false` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n// Since these are SVG attributes, their attribute names are case-sensitive.\n\n['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // These are HTML boolean attributes.\n\n['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM\n// on the client side because the browsers are inconsistent. Instead we call focus().\n'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata\n'itemScope'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // These are the few React props that we set as DOM properties\n// rather than attributes. These are all booleans.\n\n['checked', // Note: `option.selected` is not updated if `select.multiple` is\n// disabled with `removeAttribute`. We have special logic for handling this.\n'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // These are HTML attributes that are \"overloaded booleans\": they behave like\n// booleans, but can also accept a string value.\n\n['capture', 'download' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // These are HTML attributes that must be positive numbers.\n\n['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // These are HTML attributes that must be numbers.\n\n['rowSpan', 'start'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n});\nvar CAMELIZE = /[\\-\\:]([a-z])/g;\n\nvar capitalize = function (token) {\n return token[1].toUpperCase();\n}; // This is a list of all SVG attributes that need special casing, namespacing,\n// or boolean value assignment. Regular attributes that just accept strings\n// and have the same names are omitted, just like in the HTML attribute filter.\n// Some of these attributes can be hard to find. This list was created by\n// scraping the MDN documentation.\n\n\n['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // String SVG attributes with the xlink namespace.\n\n['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL\n false);\n}); // String SVG attributes with the xml namespace.\n\n['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL\n false);\n}); // These attribute exists both in HTML and SVG.\n// The attribute name is case-sensitive in SVG so we can't just use\n// the React name like we do for attributes that exist only in HTML.\n\n['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n}); // These attributes accept URLs. These must not allow javascript: URLS.\n// These will also need to accept Trusted Types object in the future.\n\nvar xlinkHref = 'xlinkHref';\nproperties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL\nfalse);\n['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n true, // sanitizeURL\n true);\n});\n\n// and any newline or tab are filtered out as if they're not part of the URL.\n// https://url.spec.whatwg.org/#url-parsing\n// Tab or newline are defined as \\r\\n\\t:\n// https://infra.spec.whatwg.org/#ascii-tab-or-newline\n// A C0 control is a code point in the range \\u0000 NULL to \\u001F\n// INFORMATION SEPARATOR ONE, inclusive:\n// https://infra.spec.whatwg.org/#c0-control-or-space\n\n/* eslint-disable max-len */\n\nvar isJavaScriptProtocol = /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i;\nvar didWarn = false;\n\nfunction sanitizeURL(url) {\n {\n if (!didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n\n error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n }\n }\n}\n\n/**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \"expected\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n */\nfunction getValueForProperty(node, name, expected, propertyInfo) {\n {\n if (propertyInfo.mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n return node[propertyName];\n } else {\n // This check protects multiple uses of `expected`, which is why the\n // react-internal/safe-string-coercion rule is disabled in several spots\n // below.\n {\n checkAttributeStringCoercion(expected, name);\n }\n\n if ( propertyInfo.sanitizeURL) {\n // If we haven't fully disabled javascript: URLs, and if\n // the hydration is successful of a javascript: URL, we\n // still want to warn on the client.\n // eslint-disable-next-line react-internal/safe-string-coercion\n sanitizeURL('' + expected);\n }\n\n var attributeName = propertyInfo.attributeName;\n var stringValue = null;\n\n if (propertyInfo.type === OVERLOADED_BOOLEAN) {\n if (node.hasAttribute(attributeName)) {\n var value = node.getAttribute(attributeName);\n\n if (value === '') {\n return true;\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return value;\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n } else if (node.hasAttribute(attributeName)) {\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n // We had an attribute but shouldn't have had one, so read it\n // for the error message.\n return node.getAttribute(attributeName);\n }\n\n if (propertyInfo.type === BOOLEAN) {\n // If this was a boolean, it doesn't matter what the value is\n // the fact that we have it is the same as the expected.\n return expected;\n } // Even if this property uses a namespace we use getAttribute\n // because we assume its namespaced name is the same as our config.\n // To use getAttributeNS we need the local name which we don't have\n // in our config atm.\n\n\n stringValue = node.getAttribute(attributeName);\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return stringValue === null ? expected : stringValue; // eslint-disable-next-line react-internal/safe-string-coercion\n } else if (stringValue === '' + expected) {\n return expected;\n } else {\n return stringValue;\n }\n }\n }\n}\n/**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n */\n\nfunction getValueForAttribute(node, name, expected, isCustomComponentTag) {\n {\n if (!isAttributeNameSafe(name)) {\n return;\n }\n\n if (!node.hasAttribute(name)) {\n return expected === undefined ? undefined : null;\n }\n\n var value = node.getAttribute(name);\n\n {\n checkAttributeStringCoercion(expected, name);\n }\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n}\n/**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\n\nfunction setValueForProperty(node, name, value, isCustomComponentTag) {\n var propertyInfo = getPropertyInfo(name);\n\n if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {\n return;\n }\n\n if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {\n value = null;\n }\n\n\n if (isCustomComponentTag || propertyInfo === null) {\n if (isAttributeNameSafe(name)) {\n var _attributeName = name;\n\n if (value === null) {\n node.removeAttribute(_attributeName);\n } else {\n {\n checkAttributeStringCoercion(value, name);\n }\n\n node.setAttribute(_attributeName, '' + value);\n }\n }\n\n return;\n }\n\n var mustUseProperty = propertyInfo.mustUseProperty;\n\n if (mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n\n if (value === null) {\n var type = propertyInfo.type;\n node[propertyName] = type === BOOLEAN ? false : '';\n } else {\n // Contrary to `setAttribute`, object properties are properly\n // `toString`ed by IE8/9.\n node[propertyName] = value;\n }\n\n return;\n } // The rest are treated as attributes with special cases.\n\n\n var attributeName = propertyInfo.attributeName,\n attributeNamespace = propertyInfo.attributeNamespace;\n\n if (value === null) {\n node.removeAttribute(attributeName);\n } else {\n var _type = propertyInfo.type;\n var attributeValue;\n\n if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {\n // If attribute type is boolean, we know for sure it won't be an execution sink\n // and we won't require Trusted Type here.\n attributeValue = '';\n } else {\n // `setAttribute` with objects becomes only `[object]` in IE8/9,\n // ('' + value) makes it output the correct toString()-value.\n {\n {\n checkAttributeStringCoercion(value, attributeName);\n }\n\n attributeValue = '' + value;\n }\n\n if (propertyInfo.sanitizeURL) {\n sanitizeURL(attributeValue.toString());\n }\n }\n\n if (attributeNamespace) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n } else {\n node.setAttribute(attributeName, attributeValue);\n }\n }\n}\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_SCOPE_TYPE = Symbol.for('react.scope');\nvar REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');\nvar REACT_CACHE_TYPE = Symbol.for('react.cache');\nvar REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\n\nfunction describeClassComponentFrame(ctor, source, ownerFn) {\n {\n return describeNativeComponentFrame(ctor, true);\n }\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nfunction describeFiber(fiber) {\n var owner = fiber._debugOwner ? fiber._debugOwner.type : null ;\n var source = fiber._debugSource ;\n\n switch (fiber.tag) {\n case HostComponent:\n return describeBuiltInComponentFrame(fiber.type);\n\n case LazyComponent:\n return describeBuiltInComponentFrame('Lazy');\n\n case SuspenseComponent:\n return describeBuiltInComponentFrame('Suspense');\n\n case SuspenseListComponent:\n return describeBuiltInComponentFrame('SuspenseList');\n\n case FunctionComponent:\n case IndeterminateComponent:\n case SimpleMemoComponent:\n return describeFunctionComponentFrame(fiber.type);\n\n case ForwardRef:\n return describeFunctionComponentFrame(fiber.type.render);\n\n case ClassComponent:\n return describeClassComponentFrame(fiber.type);\n\n default:\n return '';\n }\n}\n\nfunction getStackByFiberInDevAndProd(workInProgress) {\n try {\n var info = '';\n var node = workInProgress;\n\n do {\n info += describeFiber(node);\n node = node.return;\n } while (node);\n\n return info;\n } catch (x) {\n return '\\nError generating stack: ' + x.message + '\\n' + x.stack;\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nfunction getWrappedName$1(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n} // Keep in sync with shared/getComponentNameFromType\n\n\nfunction getContextName$1(type) {\n return type.displayName || 'Context';\n}\n\nfunction getComponentNameFromFiber(fiber) {\n var tag = fiber.tag,\n type = fiber.type;\n\n switch (tag) {\n case CacheComponent:\n return 'Cache';\n\n case ContextConsumer:\n var context = type;\n return getContextName$1(context) + '.Consumer';\n\n case ContextProvider:\n var provider = type;\n return getContextName$1(provider._context) + '.Provider';\n\n case DehydratedFragment:\n return 'DehydratedFragment';\n\n case ForwardRef:\n return getWrappedName$1(type, type.render, 'ForwardRef');\n\n case Fragment:\n return 'Fragment';\n\n case HostComponent:\n // Host component type is the display name (e.g. \"div\", \"View\")\n return type;\n\n case HostPortal:\n return 'Portal';\n\n case HostRoot:\n return 'Root';\n\n case HostText:\n return 'Text';\n\n case LazyComponent:\n // Name comes from the type in this case; we don't have a tag.\n return getComponentNameFromType(type);\n\n case Mode:\n if (type === REACT_STRICT_MODE_TYPE) {\n // Don't be less specific than shared/getComponentNameFromType\n return 'StrictMode';\n }\n\n return 'Mode';\n\n case OffscreenComponent:\n return 'Offscreen';\n\n case Profiler:\n return 'Profiler';\n\n case ScopeComponent:\n return 'Scope';\n\n case SuspenseComponent:\n return 'Suspense';\n\n case SuspenseListComponent:\n return 'SuspenseList';\n\n case TracingMarkerComponent:\n return 'TracingMarker';\n // The display name for this tags come from the user-provided type:\n\n case ClassComponent:\n case FunctionComponent:\n case IncompleteClassComponent:\n case IndeterminateComponent:\n case MemoComponent:\n case SimpleMemoComponent:\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n break;\n\n }\n\n return null;\n}\n\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\nvar current = null;\nvar isRendering = false;\nfunction getCurrentFiberOwnerNameInDevOrNull() {\n {\n if (current === null) {\n return null;\n }\n\n var owner = current._debugOwner;\n\n if (owner !== null && typeof owner !== 'undefined') {\n return getComponentNameFromFiber(owner);\n }\n }\n\n return null;\n}\n\nfunction getCurrentFiberStackInDev() {\n {\n if (current === null) {\n return '';\n } // Safe because if current fiber exists, we are reconciling,\n // and it is guaranteed to be the work-in-progress version.\n\n\n return getStackByFiberInDevAndProd(current);\n }\n}\n\nfunction resetCurrentFiber() {\n {\n ReactDebugCurrentFrame.getCurrentStack = null;\n current = null;\n isRendering = false;\n }\n}\nfunction setCurrentFiber(fiber) {\n {\n ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev;\n current = fiber;\n isRendering = false;\n }\n}\nfunction getCurrentFiber() {\n {\n return current;\n }\n}\nfunction setIsRendering(rendering) {\n {\n isRendering = rendering;\n }\n}\n\n// Flow does not allow string concatenation of most non-string types. To work\n// around this limitation, we use an opaque type that can only be obtained by\n// passing the value through getToStringValue first.\nfunction toString(value) {\n // The coercion safety check is performed in getToStringValue().\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction getToStringValue(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'string':\n case 'undefined':\n return value;\n\n case 'object':\n {\n checkFormFieldValueStringCoercion(value);\n }\n\n return value;\n\n default:\n // function, symbol are assigned as empty strings\n return '';\n }\n}\n\nvar hasReadOnlyValue = {\n button: true,\n checkbox: true,\n image: true,\n hidden: true,\n radio: true,\n reset: true,\n submit: true\n};\nfunction checkControlledValueProps(tagName, props) {\n {\n if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {\n error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n\n if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {\n error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n }\n}\n\nfunction isCheckable(elem) {\n var type = elem.type;\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\n\nfunction getTracker(node) {\n return node._valueTracker;\n}\n\nfunction detachTracker(node) {\n node._valueTracker = null;\n}\n\nfunction getValueFromNode(node) {\n var value = '';\n\n if (!node) {\n return value;\n }\n\n if (isCheckable(node)) {\n value = node.checked ? 'true' : 'false';\n } else {\n value = node.value;\n }\n\n return value;\n}\n\nfunction trackValueOnNode(node) {\n var valueField = isCheckable(node) ? 'checked' : 'value';\n var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n\n {\n checkFormFieldValueStringCoercion(node[valueField]);\n }\n\n var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail\n // and don't track value will cause over reporting of changes,\n // but it's better then a hard failure\n // (needed for certain tests that spyOn input values and Safari)\n\n if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n return;\n }\n\n var get = descriptor.get,\n set = descriptor.set;\n Object.defineProperty(node, valueField, {\n configurable: true,\n get: function () {\n return get.call(this);\n },\n set: function (value) {\n {\n checkFormFieldValueStringCoercion(value);\n }\n\n currentValue = '' + value;\n set.call(this, value);\n }\n }); // We could've passed this the first time\n // but it triggers a bug in IE11 and Edge 14/15.\n // Calling defineProperty() again should be equivalent.\n // https://github.com/facebook/react/issues/11768\n\n Object.defineProperty(node, valueField, {\n enumerable: descriptor.enumerable\n });\n var tracker = {\n getValue: function () {\n return currentValue;\n },\n setValue: function (value) {\n {\n checkFormFieldValueStringCoercion(value);\n }\n\n currentValue = '' + value;\n },\n stopTracking: function () {\n detachTracker(node);\n delete node[valueField];\n }\n };\n return tracker;\n}\n\nfunction track(node) {\n if (getTracker(node)) {\n return;\n } // TODO: Once it's just Fiber we can move this to node._wrapperState\n\n\n node._valueTracker = trackValueOnNode(node);\n}\nfunction updateValueIfChanged(node) {\n if (!node) {\n return false;\n }\n\n var tracker = getTracker(node); // if there is no tracker at this point it's unlikely\n // that trying again will succeed\n\n if (!tracker) {\n return true;\n }\n\n var lastValue = tracker.getValue();\n var nextValue = getValueFromNode(node);\n\n if (nextValue !== lastValue) {\n tracker.setValue(nextValue);\n return true;\n }\n\n return false;\n}\n\nfunction getActiveElement(doc) {\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n\n if (typeof doc === 'undefined') {\n return null;\n }\n\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\n\nfunction isControlled(props) {\n var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n return usesChecked ? props.checked != null : props.value != null;\n}\n/**\n * Implements an <input> host component that allows setting these optional\n * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.\n *\n * If `checked` or `value` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or `defaultChecked`)\n * with an empty value (or `defaultValue`).\n *\n * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\n\n\nfunction getHostProps(element, props) {\n var node = element;\n var checked = props.checked;\n var hostProps = assign({}, props, {\n defaultChecked: undefined,\n defaultValue: undefined,\n value: undefined,\n checked: checked != null ? checked : node._wrapperState.initialChecked\n });\n return hostProps;\n}\nfunction initWrapperState(element, props) {\n {\n checkControlledValueProps('input', props);\n\n if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n\n didWarnCheckedDefaultChecked = true;\n }\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n\n didWarnValueDefaultValue = true;\n }\n }\n\n var node = element;\n var defaultValue = props.defaultValue == null ? '' : props.defaultValue;\n node._wrapperState = {\n initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n initialValue: getToStringValue(props.value != null ? props.value : defaultValue),\n controlled: isControlled(props)\n };\n}\nfunction updateChecked(element, props) {\n var node = element;\n var checked = props.checked;\n\n if (checked != null) {\n setValueForProperty(node, 'checked', checked, false);\n }\n}\nfunction updateWrapper(element, props) {\n var node = element;\n\n {\n var controlled = isControlled(props);\n\n if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');\n\n didWarnUncontrolledToControlled = true;\n }\n\n if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');\n\n didWarnControlledToUncontrolled = true;\n }\n }\n\n updateChecked(element, props);\n var value = getToStringValue(props.value);\n var type = props.type;\n\n if (value != null) {\n if (type === 'number') {\n if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.\n // eslint-disable-next-line\n node.value != value) {\n node.value = toString(value);\n }\n } else if (node.value !== toString(value)) {\n node.value = toString(value);\n }\n } else if (type === 'submit' || type === 'reset') {\n // Submit/reset inputs need the attribute removed completely to avoid\n // blank-text buttons.\n node.removeAttribute('value');\n return;\n }\n\n {\n // When syncing the value attribute, the value comes from a cascade of\n // properties:\n // 1. The value React property\n // 2. The defaultValue React property\n // 3. Otherwise there should be no change\n if (props.hasOwnProperty('value')) {\n setDefaultValue(node, props.type, value);\n } else if (props.hasOwnProperty('defaultValue')) {\n setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n }\n }\n\n {\n // When syncing the checked attribute, it only changes when it needs\n // to be removed, such as transitioning from a checkbox into a text input\n if (props.checked == null && props.defaultChecked != null) {\n node.defaultChecked = !!props.defaultChecked;\n }\n }\n}\nfunction postMountWrapper(element, props, isHydrating) {\n var node = element; // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {\n var type = props.type;\n var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the\n // default value provided by the browser. See: #12872\n\n if (isButton && (props.value === undefined || props.value === null)) {\n return;\n }\n\n var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (!isHydrating) {\n {\n // When syncing the value attribute, the value property should use\n // the wrapperState._initialValue property. This uses:\n //\n // 1. The value React property when present\n // 2. The defaultValue React property when present\n // 3. An empty string\n if (initialValue !== node.value) {\n node.value = initialValue;\n }\n }\n }\n\n {\n // Otherwise, the value attribute is synchronized to the property,\n // so we assign defaultValue to the same thing as the value property\n // assignment step above.\n node.defaultValue = initialValue;\n }\n } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug\n // this is needed to work around a chrome bug where setting defaultChecked\n // will sometimes influence the value of checked (even after detachment).\n // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416\n // We need to temporarily unset name to avoid disrupting radio button groups.\n\n\n var name = node.name;\n\n if (name !== '') {\n node.name = '';\n }\n\n {\n // When syncing the checked attribute, both the checked property and\n // attribute are assigned at the same time using defaultChecked. This uses:\n //\n // 1. The checked React property when present\n // 2. The defaultChecked React property when present\n // 3. Otherwise, false\n node.defaultChecked = !node.defaultChecked;\n node.defaultChecked = !!node._wrapperState.initialChecked;\n }\n\n if (name !== '') {\n node.name = name;\n }\n}\nfunction restoreControlledState(element, props) {\n var node = element;\n updateWrapper(node, props);\n updateNamedCousins(node, props);\n}\n\nfunction updateNamedCousins(rootNode, props) {\n var name = props.name;\n\n if (props.type === 'radio' && name != null) {\n var queryRoot = rootNode;\n\n while (queryRoot.parentNode) {\n queryRoot = queryRoot.parentNode;\n } // If `rootNode.form` was non-null, then we could try `form.elements`,\n // but that sometimes behaves strangely in IE8. We could also try using\n // `form.getElementsByName`, but that will only return direct children\n // and won't include inputs that use the HTML5 `form=` attribute. Since\n // the input might not even be in a form. It might not even be in the\n // document. Let's just use the local `querySelectorAll` to ensure we don't\n // miss anything.\n\n\n {\n checkAttributeStringCoercion(name, 'name');\n }\n\n var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\"radio\"]');\n\n for (var i = 0; i < group.length; i++) {\n var otherNode = group[i];\n\n if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n continue;\n } // This will throw if radio buttons rendered by different copies of React\n // and the same name are rendered into the same form (same as #1939).\n // That's probably okay; we don't support it just as we don't support\n // mixing React radio buttons with non-React ones.\n\n\n var otherProps = getFiberCurrentPropsFromNode(otherNode);\n\n if (!otherProps) {\n throw new Error('ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.');\n } // We need update the tracked value on the named cousin since the value\n // was changed but the input saw no event or value set\n\n\n updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that\n // was previously checked to update will cause it to be come re-checked\n // as appropriate.\n\n updateWrapper(otherNode, otherProps);\n }\n }\n} // In Chrome, assigning defaultValue to certain input types triggers input validation.\n// For number inputs, the display value loses trailing decimal points. For email inputs,\n// Chrome raises \"The specified value <x> is not a valid email address\".\n//\n// Here we check to see if the defaultValue has actually changed, avoiding these problems\n// when the user is inputting text\n//\n// https://github.com/facebook/react/issues/7253\n\n\nfunction setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}\n\nvar didWarnSelectedSetOnOption = false;\nvar didWarnInvalidChild = false;\nvar didWarnInvalidInnerHTML = false;\n/**\n * Implements an <option> host component that warns when `selected` is set.\n */\n\nfunction validateProps(element, props) {\n {\n // If a value is not provided, then the children must be simple.\n if (props.value == null) {\n if (typeof props.children === 'object' && props.children !== null) {\n React.Children.forEach(props.children, function (child) {\n if (child == null) {\n return;\n }\n\n if (typeof child === 'string' || typeof child === 'number') {\n return;\n }\n\n if (!didWarnInvalidChild) {\n didWarnInvalidChild = true;\n\n error('Cannot infer the option value of complex children. ' + 'Pass a `value` prop or use a plain string as children to <option>.');\n }\n });\n } else if (props.dangerouslySetInnerHTML != null) {\n if (!didWarnInvalidInnerHTML) {\n didWarnInvalidInnerHTML = true;\n\n error('Pass a `value` prop if you set dangerouslyInnerHTML so React knows ' + 'which value should be selected.');\n }\n }\n } // TODO: Remove support for `selected` in <option>.\n\n\n if (props.selected != null && !didWarnSelectedSetOnOption) {\n error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');\n\n didWarnSelectedSetOnOption = true;\n }\n }\n}\nfunction postMountWrapper$1(element, props) {\n // value=\"\" should make a value attribute (#6219)\n if (props.value != null) {\n element.setAttribute('value', toString(getToStringValue(props.value)));\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\nvar didWarnValueDefaultValue$1;\n\n{\n didWarnValueDefaultValue$1 = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n return '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n return '';\n}\n\nvar valuePropNames = ['value', 'defaultValue'];\n/**\n * Validation function for `value` and `defaultValue`.\n */\n\nfunction checkSelectPropTypes(props) {\n {\n checkControlledValueProps('select', props);\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n\n if (props[propName] == null) {\n continue;\n }\n\n var propNameIsArray = isArray(props[propName]);\n\n if (props.multiple && !propNameIsArray) {\n error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());\n } else if (!props.multiple && propNameIsArray) {\n error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());\n }\n }\n }\n}\n\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n var options = node.options;\n\n if (multiple) {\n var selectedValues = propValue;\n var selectedValue = {};\n\n for (var i = 0; i < selectedValues.length; i++) {\n // Prefix to avoid chaos with special keys.\n selectedValue['$' + selectedValues[i]] = true;\n }\n\n for (var _i = 0; _i < options.length; _i++) {\n var selected = selectedValue.hasOwnProperty('$' + options[_i].value);\n\n if (options[_i].selected !== selected) {\n options[_i].selected = selected;\n }\n\n if (selected && setDefaultSelected) {\n options[_i].defaultSelected = true;\n }\n }\n } else {\n // Do not set `select.value` as exact behavior isn't consistent across all\n // browsers for all cases.\n var _selectedValue = toString(getToStringValue(propValue));\n\n var defaultSelected = null;\n\n for (var _i2 = 0; _i2 < options.length; _i2++) {\n if (options[_i2].value === _selectedValue) {\n options[_i2].selected = true;\n\n if (setDefaultSelected) {\n options[_i2].defaultSelected = true;\n }\n\n return;\n }\n\n if (defaultSelected === null && !options[_i2].disabled) {\n defaultSelected = options[_i2];\n }\n }\n\n if (defaultSelected !== null) {\n defaultSelected.selected = true;\n }\n }\n}\n/**\n * Implements a <select> host component that allows optionally setting the\n * props `value` and `defaultValue`. If `multiple` is false, the prop must be a\n * stringable. If `multiple` is true, the prop must be an array of stringables.\n *\n * If `value` is not supplied (or null/undefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null/undefined), the rendered options will not\n * update in response to user actions. Instead, the `value` prop must change in\n * order for the rendered options to update.\n *\n * If `defaultValue` is provided, any options with the supplied values will be\n * selected.\n */\n\n\nfunction getHostProps$1(element, props) {\n return assign({}, props, {\n value: undefined\n });\n}\nfunction initWrapperState$1(element, props) {\n var node = element;\n\n {\n checkSelectPropTypes(props);\n }\n\n node._wrapperState = {\n wasMultiple: !!props.multiple\n };\n\n {\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {\n error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components');\n\n didWarnValueDefaultValue$1 = true;\n }\n }\n}\nfunction postMountWrapper$2(element, props) {\n var node = element;\n node.multiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n }\n}\nfunction postUpdateWrapper(element, props) {\n var node = element;\n var wasMultiple = node._wrapperState.wasMultiple;\n node._wrapperState.wasMultiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (wasMultiple !== !!props.multiple) {\n // For simplicity, reapply `defaultValue` if `multiple` is toggled.\n if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n } else {\n // Revert the select back to its default unselected state.\n updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);\n }\n }\n}\nfunction restoreControlledState$1(element, props) {\n var node = element;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n }\n}\n\nvar didWarnValDefaultVal = false;\n\n/**\n * Implements a <textarea> host component that allows setting `value`, and\n * `defaultValue`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If `value` is not supplied (or null/undefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If `value` is supplied (and not null/undefined), the rendered element will\n * not trigger updates to the element. Instead, the `value` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * `defaultValue` if specified, or the children content (deprecated).\n */\nfunction getHostProps$2(element, props) {\n var node = element;\n\n if (props.dangerouslySetInnerHTML != null) {\n throw new Error('`dangerouslySetInnerHTML` does not make sense on <textarea>.');\n } // Always set children to the same thing. In IE9, the selection range will\n // get reset if `textContent` is mutated. We could add a check in setTextContent\n // to only set the value if/when the value differs from the node value (which would\n // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this\n // solution. The value can be a boolean or object so that's why it's forced\n // to be a string.\n\n\n var hostProps = assign({}, props, {\n value: undefined,\n defaultValue: undefined,\n children: toString(node._wrapperState.initialValue)\n });\n\n return hostProps;\n}\nfunction initWrapperState$2(element, props) {\n var node = element;\n\n {\n checkControlledValueProps('textarea', props);\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');\n\n didWarnValDefaultVal = true;\n }\n }\n\n var initialValue = props.value; // Only bother fetching default value if we're going to use it\n\n if (initialValue == null) {\n var children = props.children,\n defaultValue = props.defaultValue;\n\n if (children != null) {\n {\n error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');\n }\n\n {\n if (defaultValue != null) {\n throw new Error('If you supply `defaultValue` on a <textarea>, do not pass children.');\n }\n\n if (isArray(children)) {\n if (children.length > 1) {\n throw new Error('<textarea> can only have at most one child.');\n }\n\n children = children[0];\n }\n\n defaultValue = children;\n }\n }\n\n if (defaultValue == null) {\n defaultValue = '';\n }\n\n initialValue = defaultValue;\n }\n\n node._wrapperState = {\n initialValue: getToStringValue(initialValue)\n };\n}\nfunction updateWrapper$1(element, props) {\n var node = element;\n var value = getToStringValue(props.value);\n var defaultValue = getToStringValue(props.defaultValue);\n\n if (value != null) {\n // Cast `value` to a string to ensure the value is set correctly. While\n // browsers typically do this as necessary, jsdom doesn't.\n var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed\n\n if (newValue !== node.value) {\n node.value = newValue;\n }\n\n if (props.defaultValue == null && node.defaultValue !== newValue) {\n node.defaultValue = newValue;\n }\n }\n\n if (defaultValue != null) {\n node.defaultValue = toString(defaultValue);\n }\n}\nfunction postMountWrapper$3(element, props) {\n var node = element; // This is in postMount because we need access to the DOM node, which is not\n // available until after the component has mounted.\n\n var textContent = node.textContent; // Only set node.value if textContent is equal to the expected\n // initial value. In IE10/IE11 there is a bug where the placeholder attribute\n // will populate textContent as well.\n // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/\n\n if (textContent === node._wrapperState.initialValue) {\n if (textContent !== '' && textContent !== null) {\n node.value = textContent;\n }\n }\n}\nfunction restoreControlledState$2(element, props) {\n // DOM component is still mounted; update\n updateWrapper$1(element, props);\n}\n\nvar HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nvar MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\nvar SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; // Assumes there is no parent namespace.\n\nfunction getIntrinsicNamespace(type) {\n switch (type) {\n case 'svg':\n return SVG_NAMESPACE;\n\n case 'math':\n return MATH_NAMESPACE;\n\n default:\n return HTML_NAMESPACE;\n }\n}\nfunction getChildNamespace(parentNamespace, type) {\n if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {\n // No (or default) parent namespace: potential entry point.\n return getIntrinsicNamespace(type);\n }\n\n if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n // We're leaving SVG.\n return HTML_NAMESPACE;\n } // By default, pass namespace below.\n\n\n return parentNamespace;\n}\n\n/* globals MSApp */\n\n/**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n */\nvar createMicrosoftUnsafeLocalFunction = function (func) {\n if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {\n return function (arg0, arg1, arg2, arg3) {\n MSApp.execUnsafeLocalFunction(function () {\n return func(arg0, arg1, arg2, arg3);\n });\n };\n } else {\n return func;\n }\n};\n\nvar reusableSVGContainer;\n/**\n * Set the innerHTML property of a node\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\n\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n if (node.namespaceURI === SVG_NAMESPACE) {\n\n if (!('innerHTML' in node)) {\n // IE does not have innerHTML for SVG nodes, so instead we inject the\n // new markup in a temp node and then move the child nodes across into\n // the target node\n reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';\n var svgNode = reusableSVGContainer.firstChild;\n\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n\n while (svgNode.firstChild) {\n node.appendChild(svgNode.firstChild);\n }\n\n return;\n }\n }\n\n node.innerHTML = html;\n});\n\n/**\n * HTML nodeType values that represent the type of the node\n */\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n\n/**\n * Set the textContent property of a node. For text updates, it's faster\n * to set the `nodeValue` of the Text node directly instead of using\n * `.textContent` which will remove the existing node and create a new one.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n */\n\nvar setTextContent = function (node, text) {\n if (text) {\n var firstChild = node.firstChild;\n\n if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {\n firstChild.nodeValue = text;\n return;\n }\n }\n\n node.textContent = text;\n};\n\n// List derived from Gecko source code:\n// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js\nvar shorthandToLonghand = {\n animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],\n background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],\n borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],\n borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],\n borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],\n borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],\n borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],\n borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],\n borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],\n borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],\n borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],\n borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],\n borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],\n columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],\n columns: ['columnCount', 'columnWidth'],\n flex: ['flexBasis', 'flexGrow', 'flexShrink'],\n flexFlow: ['flexDirection', 'flexWrap'],\n font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],\n fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],\n gap: ['columnGap', 'rowGap'],\n grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],\n gridColumn: ['gridColumnEnd', 'gridColumnStart'],\n gridColumnGap: ['columnGap'],\n gridGap: ['columnGap', 'rowGap'],\n gridRow: ['gridRowEnd', 'gridRowStart'],\n gridRowGap: ['rowGap'],\n gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],\n margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],\n marker: ['markerEnd', 'markerMid', 'markerStart'],\n mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],\n maskPosition: ['maskPositionX', 'maskPositionY'],\n outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],\n overflow: ['overflowX', 'overflowY'],\n padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],\n placeContent: ['alignContent', 'justifyContent'],\n placeItems: ['alignItems', 'justifyItems'],\n placeSelf: ['alignSelf', 'justifySelf'],\n textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],\n textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],\n transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],\n wordWrap: ['overflowWrap']\n};\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\nvar isUnitlessNumber = {\n animationIterationCount: true,\n aspectRatio: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n columns: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridArea: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowSpan: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnSpan: true,\n gridColumnStart: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n};\n/**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\n\nfunction prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\n\n\nvar prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n// infinite loop, because it iterates over the newly added props too.\n\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n});\n\n/**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\n\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n // Note that we've removed escapeTextForBrowser() calls here since the\n // whole string will be escaped when the attribute is injected into\n // the markup. If you provide unsafe user data here they can inject\n // arbitrary CSS which may be problematic (I couldn't repro this):\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n // This is not an XSS hole but instead a potential CSS injection issue\n // which has lead to a greater discussion about how we're going to\n // trust URLs moving forward. See #2115901\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n\n if (isEmpty) {\n return '';\n }\n\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n\n {\n checkCSSPropertyStringCoercion(value, name);\n }\n\n return ('' + value).trim();\n}\n\nvar uppercasePattern = /([A-Z])/g;\nvar msPattern = /^ms-/;\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n */\n\nfunction hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}\n\nvar warnValidStyle = function () {};\n\n{\n // 'msTransform' is correct, but the other prefixes should be capitalized\n var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n var msPattern$1 = /^-ms-/;\n var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon\n\n var badStyleValueWithSemicolonPattern = /;\\s*$/;\n var warnedStyleNames = {};\n var warnedStyleValues = {};\n var warnedForNaNValue = false;\n var warnedForInfinityValue = false;\n\n var camelize = function (string) {\n return string.replace(hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n };\n\n var warnHyphenatedStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n\n error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests\n // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix\n // is converted to lowercase `ms`.\n camelize(name.replace(msPattern$1, 'ms-')));\n };\n\n var warnBadVendoredStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n\n error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));\n };\n\n var warnStyleValueWithSemicolon = function (name, value) {\n if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n return;\n }\n\n warnedStyleValues[value] = true;\n\n error(\"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n };\n\n var warnStyleValueIsNaN = function (name, value) {\n if (warnedForNaNValue) {\n return;\n }\n\n warnedForNaNValue = true;\n\n error('`NaN` is an invalid value for the `%s` css style property.', name);\n };\n\n var warnStyleValueIsInfinity = function (name, value) {\n if (warnedForInfinityValue) {\n return;\n }\n\n warnedForInfinityValue = true;\n\n error('`Infinity` is an invalid value for the `%s` css style property.', name);\n };\n\n warnValidStyle = function (name, value) {\n if (name.indexOf('-') > -1) {\n warnHyphenatedStyleName(name);\n } else if (badVendoredStyleNamePattern.test(name)) {\n warnBadVendoredStyleName(name);\n } else if (badStyleValueWithSemicolonPattern.test(value)) {\n warnStyleValueWithSemicolon(name, value);\n }\n\n if (typeof value === 'number') {\n if (isNaN(value)) {\n warnStyleValueIsNaN(name, value);\n } else if (!isFinite(value)) {\n warnStyleValueIsInfinity(name, value);\n }\n }\n };\n}\n\nvar warnValidStyle$1 = warnValidStyle;\n\n/**\n * Operations for dealing with CSS properties.\n */\n\n/**\n * This creates a string that is expected to be equivalent to the style\n * attribute generated by server-side rendering. It by-passes warnings and\n * security checks so it's not safe to use this value for anything other than\n * comparison. It is only used in DEV for SSR validation.\n */\n\nfunction createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n}\n/**\n * Sets the value for multiple styles on a node. If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\n\nfunction setValueForStyles(node, styles) {\n var style = node.style;\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var isCustomProperty = styleName.indexOf('--') === 0;\n\n {\n if (!isCustomProperty) {\n warnValidStyle$1(styleName, styles[styleName]);\n }\n }\n\n var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n\n if (styleName === 'float') {\n styleName = 'cssFloat';\n }\n\n if (isCustomProperty) {\n style.setProperty(styleName, styleValue);\n } else {\n style[styleName] = styleValue;\n }\n }\n}\n\nfunction isValueEmpty(value) {\n return value == null || typeof value === 'boolean' || value === '';\n}\n/**\n * Given {color: 'red', overflow: 'hidden'} returns {\n * color: 'color',\n * overflowX: 'overflow',\n * overflowY: 'overflow',\n * }. This can be read as \"the overflowY property was set by the overflow\n * shorthand\". That is, the values are the property that each was derived from.\n */\n\n\nfunction expandShorthandMap(styles) {\n var expanded = {};\n\n for (var key in styles) {\n var longhands = shorthandToLonghand[key] || [key];\n\n for (var i = 0; i < longhands.length; i++) {\n expanded[longhands[i]] = key;\n }\n }\n\n return expanded;\n}\n/**\n * When mixing shorthand and longhand property names, we warn during updates if\n * we expect an incorrect result to occur. In particular, we warn for:\n *\n * Updating a shorthand property (longhand gets overwritten):\n * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}\n * becomes .style.font = 'baz'\n * Removing a shorthand property (longhand gets lost too):\n * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}\n * becomes .style.font = ''\n * Removing a longhand property (should revert to shorthand; doesn't):\n * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}\n * becomes .style.fontVariant = ''\n */\n\n\nfunction validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {\n {\n if (!nextStyles) {\n return;\n }\n\n var expandedUpdates = expandShorthandMap(styleUpdates);\n var expandedStyles = expandShorthandMap(nextStyles);\n var warnedAbout = {};\n\n for (var key in expandedUpdates) {\n var originalKey = expandedUpdates[key];\n var correctOriginalKey = expandedStyles[key];\n\n if (correctOriginalKey && originalKey !== correctOriginalKey) {\n var warningKey = originalKey + ',' + correctOriginalKey;\n\n if (warnedAbout[warningKey]) {\n continue;\n }\n\n warnedAbout[warningKey] = true;\n\n error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + \"avoid this, don't mix shorthand and non-shorthand properties \" + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);\n }\n }\n }\n}\n\n// For HTML, certain tags should omit their close tag. We keep a list for\n// those special-case tags.\nvar omittedCloseTags = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.\n\n};\n\n// `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\nvar voidElementTags = assign({\n menuitem: true\n}, omittedCloseTags);\n\nvar HTML = '__html';\n\nfunction assertValidProps(tag, props) {\n if (!props) {\n return;\n } // Note the use of `==` which checks for null or undefined.\n\n\n if (voidElementTags[tag]) {\n if (props.children != null || props.dangerouslySetInnerHTML != null) {\n throw new Error(tag + \" is a void element tag and must neither have `children` nor \" + 'use `dangerouslySetInnerHTML`.');\n }\n }\n\n if (props.dangerouslySetInnerHTML != null) {\n if (props.children != null) {\n throw new Error('Can only set one of `children` or `props.dangerouslySetInnerHTML`.');\n }\n\n if (typeof props.dangerouslySetInnerHTML !== 'object' || !(HTML in props.dangerouslySetInnerHTML)) {\n throw new Error('`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://reactjs.org/link/dangerously-set-inner-html ' + 'for more information.');\n }\n }\n\n {\n if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {\n error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');\n }\n }\n\n if (props.style != null && typeof props.style !== 'object') {\n throw new Error('The `style` prop expects a mapping from style properties to values, ' + \"not a string. For example, style={{marginRight: spacing + 'em'}} when \" + 'using JSX.');\n }\n}\n\nfunction isCustomComponent(tagName, props) {\n if (tagName.indexOf('-') === -1) {\n return typeof props.is === 'string';\n }\n\n switch (tagName) {\n // These are reserved SVG and MathML elements.\n // We don't mind this list too much because we expect it to never grow.\n // The alternative is to track the namespace in a few places which is convoluted.\n // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n case 'annotation-xml':\n case 'color-profile':\n case 'font-face':\n case 'font-face-src':\n case 'font-face-uri':\n case 'font-face-format':\n case 'font-face-name':\n case 'missing-glyph':\n return false;\n\n default:\n return true;\n }\n}\n\n// When adding attributes to the HTML or SVG allowed attribute list, be sure to\n// also add them to this module to ensure casing and incorrect name\n// warnings.\nvar possibleStandardNames = {\n // HTML\n accept: 'accept',\n acceptcharset: 'acceptCharset',\n 'accept-charset': 'acceptCharset',\n accesskey: 'accessKey',\n action: 'action',\n allowfullscreen: 'allowFullScreen',\n alt: 'alt',\n as: 'as',\n async: 'async',\n autocapitalize: 'autoCapitalize',\n autocomplete: 'autoComplete',\n autocorrect: 'autoCorrect',\n autofocus: 'autoFocus',\n autoplay: 'autoPlay',\n autosave: 'autoSave',\n capture: 'capture',\n cellpadding: 'cellPadding',\n cellspacing: 'cellSpacing',\n challenge: 'challenge',\n charset: 'charSet',\n checked: 'checked',\n children: 'children',\n cite: 'cite',\n class: 'className',\n classid: 'classID',\n classname: 'className',\n cols: 'cols',\n colspan: 'colSpan',\n content: 'content',\n contenteditable: 'contentEditable',\n contextmenu: 'contextMenu',\n controls: 'controls',\n controlslist: 'controlsList',\n coords: 'coords',\n crossorigin: 'crossOrigin',\n dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n data: 'data',\n datetime: 'dateTime',\n default: 'default',\n defaultchecked: 'defaultChecked',\n defaultvalue: 'defaultValue',\n defer: 'defer',\n dir: 'dir',\n disabled: 'disabled',\n disablepictureinpicture: 'disablePictureInPicture',\n disableremoteplayback: 'disableRemotePlayback',\n download: 'download',\n draggable: 'draggable',\n enctype: 'encType',\n enterkeyhint: 'enterKeyHint',\n for: 'htmlFor',\n form: 'form',\n formmethod: 'formMethod',\n formaction: 'formAction',\n formenctype: 'formEncType',\n formnovalidate: 'formNoValidate',\n formtarget: 'formTarget',\n frameborder: 'frameBorder',\n headers: 'headers',\n height: 'height',\n hidden: 'hidden',\n high: 'high',\n href: 'href',\n hreflang: 'hrefLang',\n htmlfor: 'htmlFor',\n httpequiv: 'httpEquiv',\n 'http-equiv': 'httpEquiv',\n icon: 'icon',\n id: 'id',\n imagesizes: 'imageSizes',\n imagesrcset: 'imageSrcSet',\n innerhtml: 'innerHTML',\n inputmode: 'inputMode',\n integrity: 'integrity',\n is: 'is',\n itemid: 'itemID',\n itemprop: 'itemProp',\n itemref: 'itemRef',\n itemscope: 'itemScope',\n itemtype: 'itemType',\n keyparams: 'keyParams',\n keytype: 'keyType',\n kind: 'kind',\n label: 'label',\n lang: 'lang',\n list: 'list',\n loop: 'loop',\n low: 'low',\n manifest: 'manifest',\n marginwidth: 'marginWidth',\n marginheight: 'marginHeight',\n max: 'max',\n maxlength: 'maxLength',\n media: 'media',\n mediagroup: 'mediaGroup',\n method: 'method',\n min: 'min',\n minlength: 'minLength',\n multiple: 'multiple',\n muted: 'muted',\n name: 'name',\n nomodule: 'noModule',\n nonce: 'nonce',\n novalidate: 'noValidate',\n open: 'open',\n optimum: 'optimum',\n pattern: 'pattern',\n placeholder: 'placeholder',\n playsinline: 'playsInline',\n poster: 'poster',\n preload: 'preload',\n profile: 'profile',\n radiogroup: 'radioGroup',\n readonly: 'readOnly',\n referrerpolicy: 'referrerPolicy',\n rel: 'rel',\n required: 'required',\n reversed: 'reversed',\n role: 'role',\n rows: 'rows',\n rowspan: 'rowSpan',\n sandbox: 'sandbox',\n scope: 'scope',\n scoped: 'scoped',\n scrolling: 'scrolling',\n seamless: 'seamless',\n selected: 'selected',\n shape: 'shape',\n size: 'size',\n sizes: 'sizes',\n span: 'span',\n spellcheck: 'spellCheck',\n src: 'src',\n srcdoc: 'srcDoc',\n srclang: 'srcLang',\n srcset: 'srcSet',\n start: 'start',\n step: 'step',\n style: 'style',\n summary: 'summary',\n tabindex: 'tabIndex',\n target: 'target',\n title: 'title',\n type: 'type',\n usemap: 'useMap',\n value: 'value',\n width: 'width',\n wmode: 'wmode',\n wrap: 'wrap',\n // SVG\n about: 'about',\n accentheight: 'accentHeight',\n 'accent-height': 'accentHeight',\n accumulate: 'accumulate',\n additive: 'additive',\n alignmentbaseline: 'alignmentBaseline',\n 'alignment-baseline': 'alignmentBaseline',\n allowreorder: 'allowReorder',\n alphabetic: 'alphabetic',\n amplitude: 'amplitude',\n arabicform: 'arabicForm',\n 'arabic-form': 'arabicForm',\n ascent: 'ascent',\n attributename: 'attributeName',\n attributetype: 'attributeType',\n autoreverse: 'autoReverse',\n azimuth: 'azimuth',\n basefrequency: 'baseFrequency',\n baselineshift: 'baselineShift',\n 'baseline-shift': 'baselineShift',\n baseprofile: 'baseProfile',\n bbox: 'bbox',\n begin: 'begin',\n bias: 'bias',\n by: 'by',\n calcmode: 'calcMode',\n capheight: 'capHeight',\n 'cap-height': 'capHeight',\n clip: 'clip',\n clippath: 'clipPath',\n 'clip-path': 'clipPath',\n clippathunits: 'clipPathUnits',\n cliprule: 'clipRule',\n 'clip-rule': 'clipRule',\n color: 'color',\n colorinterpolation: 'colorInterpolation',\n 'color-interpolation': 'colorInterpolation',\n colorinterpolationfilters: 'colorInterpolationFilters',\n 'color-interpolation-filters': 'colorInterpolationFilters',\n colorprofile: 'colorProfile',\n 'color-profile': 'colorProfile',\n colorrendering: 'colorRendering',\n 'color-rendering': 'colorRendering',\n contentscripttype: 'contentScriptType',\n contentstyletype: 'contentStyleType',\n cursor: 'cursor',\n cx: 'cx',\n cy: 'cy',\n d: 'd',\n datatype: 'datatype',\n decelerate: 'decelerate',\n descent: 'descent',\n diffuseconstant: 'diffuseConstant',\n direction: 'direction',\n display: 'display',\n divisor: 'divisor',\n dominantbaseline: 'dominantBaseline',\n 'dominant-baseline': 'dominantBaseline',\n dur: 'dur',\n dx: 'dx',\n dy: 'dy',\n edgemode: 'edgeMode',\n elevation: 'elevation',\n enablebackground: 'enableBackground',\n 'enable-background': 'enableBackground',\n end: 'end',\n exponent: 'exponent',\n externalresourcesrequired: 'externalResourcesRequired',\n fill: 'fill',\n fillopacity: 'fillOpacity',\n 'fill-opacity': 'fillOpacity',\n fillrule: 'fillRule',\n 'fill-rule': 'fillRule',\n filter: 'filter',\n filterres: 'filterRes',\n filterunits: 'filterUnits',\n floodopacity: 'floodOpacity',\n 'flood-opacity': 'floodOpacity',\n floodcolor: 'floodColor',\n 'flood-color': 'floodColor',\n focusable: 'focusable',\n fontfamily: 'fontFamily',\n 'font-family': 'fontFamily',\n fontsize: 'fontSize',\n 'font-size': 'fontSize',\n fontsizeadjust: 'fontSizeAdjust',\n 'font-size-adjust': 'fontSizeAdjust',\n fontstretch: 'fontStretch',\n 'font-stretch': 'fontStretch',\n fontstyle: 'fontStyle',\n 'font-style': 'fontStyle',\n fontvariant: 'fontVariant',\n 'font-variant': 'fontVariant',\n fontweight: 'fontWeight',\n 'font-weight': 'fontWeight',\n format: 'format',\n from: 'from',\n fx: 'fx',\n fy: 'fy',\n g1: 'g1',\n g2: 'g2',\n glyphname: 'glyphName',\n 'glyph-name': 'glyphName',\n glyphorientationhorizontal: 'glyphOrientationHorizontal',\n 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n glyphorientationvertical: 'glyphOrientationVertical',\n 'glyph-orientation-vertical': 'glyphOrientationVertical',\n glyphref: 'glyphRef',\n gradienttransform: 'gradientTransform',\n gradientunits: 'gradientUnits',\n hanging: 'hanging',\n horizadvx: 'horizAdvX',\n 'horiz-adv-x': 'horizAdvX',\n horizoriginx: 'horizOriginX',\n 'horiz-origin-x': 'horizOriginX',\n ideographic: 'ideographic',\n imagerendering: 'imageRendering',\n 'image-rendering': 'imageRendering',\n in2: 'in2',\n in: 'in',\n inlist: 'inlist',\n intercept: 'intercept',\n k1: 'k1',\n k2: 'k2',\n k3: 'k3',\n k4: 'k4',\n k: 'k',\n kernelmatrix: 'kernelMatrix',\n kernelunitlength: 'kernelUnitLength',\n kerning: 'kerning',\n keypoints: 'keyPoints',\n keysplines: 'keySplines',\n keytimes: 'keyTimes',\n lengthadjust: 'lengthAdjust',\n letterspacing: 'letterSpacing',\n 'letter-spacing': 'letterSpacing',\n lightingcolor: 'lightingColor',\n 'lighting-color': 'lightingColor',\n limitingconeangle: 'limitingConeAngle',\n local: 'local',\n markerend: 'markerEnd',\n 'marker-end': 'markerEnd',\n markerheight: 'markerHeight',\n markermid: 'markerMid',\n 'marker-mid': 'markerMid',\n markerstart: 'markerStart',\n 'marker-start': 'markerStart',\n markerunits: 'markerUnits',\n markerwidth: 'markerWidth',\n mask: 'mask',\n maskcontentunits: 'maskContentUnits',\n maskunits: 'maskUnits',\n mathematical: 'mathematical',\n mode: 'mode',\n numoctaves: 'numOctaves',\n offset: 'offset',\n opacity: 'opacity',\n operator: 'operator',\n order: 'order',\n orient: 'orient',\n orientation: 'orientation',\n origin: 'origin',\n overflow: 'overflow',\n overlineposition: 'overlinePosition',\n 'overline-position': 'overlinePosition',\n overlinethickness: 'overlineThickness',\n 'overline-thickness': 'overlineThickness',\n paintorder: 'paintOrder',\n 'paint-order': 'paintOrder',\n panose1: 'panose1',\n 'panose-1': 'panose1',\n pathlength: 'pathLength',\n patterncontentunits: 'patternContentUnits',\n patterntransform: 'patternTransform',\n patternunits: 'patternUnits',\n pointerevents: 'pointerEvents',\n 'pointer-events': 'pointerEvents',\n points: 'points',\n pointsatx: 'pointsAtX',\n pointsaty: 'pointsAtY',\n pointsatz: 'pointsAtZ',\n prefix: 'prefix',\n preservealpha: 'preserveAlpha',\n preserveaspectratio: 'preserveAspectRatio',\n primitiveunits: 'primitiveUnits',\n property: 'property',\n r: 'r',\n radius: 'radius',\n refx: 'refX',\n refy: 'refY',\n renderingintent: 'renderingIntent',\n 'rendering-intent': 'renderingIntent',\n repeatcount: 'repeatCount',\n repeatdur: 'repeatDur',\n requiredextensions: 'requiredExtensions',\n requiredfeatures: 'requiredFeatures',\n resource: 'resource',\n restart: 'restart',\n result: 'result',\n results: 'results',\n rotate: 'rotate',\n rx: 'rx',\n ry: 'ry',\n scale: 'scale',\n security: 'security',\n seed: 'seed',\n shaperendering: 'shapeRendering',\n 'shape-rendering': 'shapeRendering',\n slope: 'slope',\n spacing: 'spacing',\n specularconstant: 'specularConstant',\n specularexponent: 'specularExponent',\n speed: 'speed',\n spreadmethod: 'spreadMethod',\n startoffset: 'startOffset',\n stddeviation: 'stdDeviation',\n stemh: 'stemh',\n stemv: 'stemv',\n stitchtiles: 'stitchTiles',\n stopcolor: 'stopColor',\n 'stop-color': 'stopColor',\n stopopacity: 'stopOpacity',\n 'stop-opacity': 'stopOpacity',\n strikethroughposition: 'strikethroughPosition',\n 'strikethrough-position': 'strikethroughPosition',\n strikethroughthickness: 'strikethroughThickness',\n 'strikethrough-thickness': 'strikethroughThickness',\n string: 'string',\n stroke: 'stroke',\n strokedasharray: 'strokeDasharray',\n 'stroke-dasharray': 'strokeDasharray',\n strokedashoffset: 'strokeDashoffset',\n 'stroke-dashoffset': 'strokeDashoffset',\n strokelinecap: 'strokeLinecap',\n 'stroke-linecap': 'strokeLinecap',\n strokelinejoin: 'strokeLinejoin',\n 'stroke-linejoin': 'strokeLinejoin',\n strokemiterlimit: 'strokeMiterlimit',\n 'stroke-miterlimit': 'strokeMiterlimit',\n strokewidth: 'strokeWidth',\n 'stroke-width': 'strokeWidth',\n strokeopacity: 'strokeOpacity',\n 'stroke-opacity': 'strokeOpacity',\n suppresscontenteditablewarning: 'suppressContentEditableWarning',\n suppresshydrationwarning: 'suppressHydrationWarning',\n surfacescale: 'surfaceScale',\n systemlanguage: 'systemLanguage',\n tablevalues: 'tableValues',\n targetx: 'targetX',\n targety: 'targetY',\n textanchor: 'textAnchor',\n 'text-anchor': 'textAnchor',\n textdecoration: 'textDecoration',\n 'text-decoration': 'textDecoration',\n textlength: 'textLength',\n textrendering: 'textRendering',\n 'text-rendering': 'textRendering',\n to: 'to',\n transform: 'transform',\n typeof: 'typeof',\n u1: 'u1',\n u2: 'u2',\n underlineposition: 'underlinePosition',\n 'underline-position': 'underlinePosition',\n underlinethickness: 'underlineThickness',\n 'underline-thickness': 'underlineThickness',\n unicode: 'unicode',\n unicodebidi: 'unicodeBidi',\n 'unicode-bidi': 'unicodeBidi',\n unicoderange: 'unicodeRange',\n 'unicode-range': 'unicodeRange',\n unitsperem: 'unitsPerEm',\n 'units-per-em': 'unitsPerEm',\n unselectable: 'unselectable',\n valphabetic: 'vAlphabetic',\n 'v-alphabetic': 'vAlphabetic',\n values: 'values',\n vectoreffect: 'vectorEffect',\n 'vector-effect': 'vectorEffect',\n version: 'version',\n vertadvy: 'vertAdvY',\n 'vert-adv-y': 'vertAdvY',\n vertoriginx: 'vertOriginX',\n 'vert-origin-x': 'vertOriginX',\n vertoriginy: 'vertOriginY',\n 'vert-origin-y': 'vertOriginY',\n vhanging: 'vHanging',\n 'v-hanging': 'vHanging',\n videographic: 'vIdeographic',\n 'v-ideographic': 'vIdeographic',\n viewbox: 'viewBox',\n viewtarget: 'viewTarget',\n visibility: 'visibility',\n vmathematical: 'vMathematical',\n 'v-mathematical': 'vMathematical',\n vocab: 'vocab',\n widths: 'widths',\n wordspacing: 'wordSpacing',\n 'word-spacing': 'wordSpacing',\n writingmode: 'writingMode',\n 'writing-mode': 'writingMode',\n x1: 'x1',\n x2: 'x2',\n x: 'x',\n xchannelselector: 'xChannelSelector',\n xheight: 'xHeight',\n 'x-height': 'xHeight',\n xlinkactuate: 'xlinkActuate',\n 'xlink:actuate': 'xlinkActuate',\n xlinkarcrole: 'xlinkArcrole',\n 'xlink:arcrole': 'xlinkArcrole',\n xlinkhref: 'xlinkHref',\n 'xlink:href': 'xlinkHref',\n xlinkrole: 'xlinkRole',\n 'xlink:role': 'xlinkRole',\n xlinkshow: 'xlinkShow',\n 'xlink:show': 'xlinkShow',\n xlinktitle: 'xlinkTitle',\n 'xlink:title': 'xlinkTitle',\n xlinktype: 'xlinkType',\n 'xlink:type': 'xlinkType',\n xmlbase: 'xmlBase',\n 'xml:base': 'xmlBase',\n xmllang: 'xmlLang',\n 'xml:lang': 'xmlLang',\n xmlns: 'xmlns',\n 'xml:space': 'xmlSpace',\n xmlnsxlink: 'xmlnsXlink',\n 'xmlns:xlink': 'xmlnsXlink',\n xmlspace: 'xmlSpace',\n y1: 'y1',\n y2: 'y2',\n y: 'y',\n ychannelselector: 'yChannelSelector',\n z: 'z',\n zoomandpan: 'zoomAndPan'\n};\n\nvar ariaProperties = {\n 'aria-current': 0,\n // state\n 'aria-description': 0,\n 'aria-details': 0,\n 'aria-disabled': 0,\n // state\n 'aria-hidden': 0,\n // state\n 'aria-invalid': 0,\n // state\n 'aria-keyshortcuts': 0,\n 'aria-label': 0,\n 'aria-roledescription': 0,\n // Widget Attributes\n 'aria-autocomplete': 0,\n 'aria-checked': 0,\n 'aria-expanded': 0,\n 'aria-haspopup': 0,\n 'aria-level': 0,\n 'aria-modal': 0,\n 'aria-multiline': 0,\n 'aria-multiselectable': 0,\n 'aria-orientation': 0,\n 'aria-placeholder': 0,\n 'aria-pressed': 0,\n 'aria-readonly': 0,\n 'aria-required': 0,\n 'aria-selected': 0,\n 'aria-sort': 0,\n 'aria-valuemax': 0,\n 'aria-valuemin': 0,\n 'aria-valuenow': 0,\n 'aria-valuetext': 0,\n // Live Region Attributes\n 'aria-atomic': 0,\n 'aria-busy': 0,\n 'aria-live': 0,\n 'aria-relevant': 0,\n // Drag-and-Drop Attributes\n 'aria-dropeffect': 0,\n 'aria-grabbed': 0,\n // Relationship Attributes\n 'aria-activedescendant': 0,\n 'aria-colcount': 0,\n 'aria-colindex': 0,\n 'aria-colspan': 0,\n 'aria-controls': 0,\n 'aria-describedby': 0,\n 'aria-errormessage': 0,\n 'aria-flowto': 0,\n 'aria-labelledby': 0,\n 'aria-owns': 0,\n 'aria-posinset': 0,\n 'aria-rowcount': 0,\n 'aria-rowindex': 0,\n 'aria-rowspan': 0,\n 'aria-setsize': 0\n};\n\nvar warnedProperties = {};\nvar rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\nfunction validateProperty(tagName, name) {\n {\n if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {\n return true;\n }\n\n if (rARIACamel.test(name)) {\n var ariaName = 'aria-' + name.slice(4).toLowerCase();\n var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (correctName == null) {\n error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);\n\n warnedProperties[name] = true;\n return true;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== correctName) {\n error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);\n\n warnedProperties[name] = true;\n return true;\n }\n }\n\n if (rARIA.test(name)) {\n var lowerCasedName = name.toLowerCase();\n var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (standardName == null) {\n warnedProperties[name] = true;\n return false;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== standardName) {\n error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);\n\n warnedProperties[name] = true;\n return true;\n }\n }\n }\n\n return true;\n}\n\nfunction warnInvalidARIAProps(type, props) {\n {\n var invalidProps = [];\n\n for (var key in props) {\n var isValid = validateProperty(type, key);\n\n if (!isValid) {\n invalidProps.push(key);\n }\n }\n\n var unknownPropString = invalidProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (invalidProps.length === 1) {\n error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n } else if (invalidProps.length > 1) {\n error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n }\n }\n}\n\nfunction validateProperties(type, props) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnInvalidARIAProps(type, props);\n}\n\nvar didWarnValueNull = false;\nfunction validateProperties$1(type, props) {\n {\n if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n return;\n }\n\n if (props != null && props.value === null && !didWarnValueNull) {\n didWarnValueNull = true;\n\n if (type === 'select' && props.multiple) {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);\n } else {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);\n }\n }\n }\n}\n\nvar validateProperty$1 = function () {};\n\n{\n var warnedProperties$1 = {};\n var EVENT_NAME_REGEX = /^on./;\n var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;\n var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\n validateProperty$1 = function (tagName, name, value, eventRegistry) {\n if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n return true;\n }\n\n var lowerCasedName = name.toLowerCase();\n\n if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');\n\n warnedProperties$1[name] = true;\n return true;\n } // We can't rely on the event system being injected on the server.\n\n\n if (eventRegistry != null) {\n var registrationNameDependencies = eventRegistry.registrationNameDependencies,\n possibleRegistrationNames = eventRegistry.possibleRegistrationNames;\n\n if (registrationNameDependencies.hasOwnProperty(name)) {\n return true;\n }\n\n var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n\n if (registrationName != null) {\n error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (EVENT_NAME_REGEX.test(name)) {\n error('Unknown event handler property `%s`. It will be ignored.', name);\n\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (EVENT_NAME_REGEX.test(name)) {\n // If no event plugins have been injected, we are in a server environment.\n // So we can't tell if the event name is correct for sure, but we can filter\n // out known bad ones like `onclick`. We can't suggest a specific replacement though.\n if (INVALID_EVENT_NAME_REGEX.test(name)) {\n error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } // Let the ARIA attribute hook validate ARIA attributes\n\n\n if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n return true;\n }\n\n if (lowerCasedName === 'innerhtml') {\n error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'aria') {\n error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'number' && isNaN(value)) {\n error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n var propertyInfo = getPropertyInfo(name);\n var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.\n\n if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n var standardName = possibleStandardNames[lowerCasedName];\n\n if (standardName !== name) {\n error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);\n\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (!isReserved && name !== lowerCasedName) {\n // Unknown attributes should have lowercase casing since that's how they\n // will be cased anyway with server rendering.\n error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n if (value) {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.', value, name, name, value, name);\n } else {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } // Now that we've validated casing, do not validate\n // data types for reserved props\n\n\n if (isReserved) {\n return true;\n } // Warn when a known attribute is a bad type\n\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n warnedProperties$1[name] = true;\n return false;\n } // Warn when passing the strings 'false' or 'true' into a boolean prop\n\n\n if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {\n error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string \"false\".', name, value);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n return true;\n };\n}\n\nvar warnUnknownProperties = function (type, props, eventRegistry) {\n {\n var unknownProps = [];\n\n for (var key in props) {\n var isValid = validateProperty$1(type, key, props[key], eventRegistry);\n\n if (!isValid) {\n unknownProps.push(key);\n }\n }\n\n var unknownPropString = unknownProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (unknownProps.length === 1) {\n error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n } else if (unknownProps.length > 1) {\n error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n }\n }\n};\n\nfunction validateProperties$2(type, props, eventRegistry) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnUnknownProperties(type, props, eventRegistry);\n}\n\nvar IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;\nvar IS_NON_DELEGATED = 1 << 1;\nvar IS_CAPTURE_PHASE = 1 << 2;\n// set to LEGACY_FB_SUPPORT. LEGACY_FB_SUPPORT only gets set when\n// we call willDeferLaterForLegacyFBSupport, thus not bailing out\n// will result in endless cycles like an infinite loop.\n// We also don't want to defer during event replaying.\n\nvar SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;\n\n// This exists to avoid circular dependency between ReactDOMEventReplaying\n// and DOMPluginEventSystem.\nvar currentReplayingEvent = null;\nfunction setReplayingEvent(event) {\n {\n if (currentReplayingEvent !== null) {\n error('Expected currently replaying event to be null. This error ' + 'is likely caused by a bug in React. Please file an issue.');\n }\n }\n\n currentReplayingEvent = event;\n}\nfunction resetReplayingEvent() {\n {\n if (currentReplayingEvent === null) {\n error('Expected currently replaying event to not be null. This error ' + 'is likely caused by a bug in React. Please file an issue.');\n }\n }\n\n currentReplayingEvent = null;\n}\nfunction isReplayingEvent(event) {\n return event === currentReplayingEvent;\n}\n\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\n\nfunction getEventTarget(nativeEvent) {\n // Fallback to nativeEvent.srcElement for IE9\n // https://github.com/facebook/react/issues/12506\n var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963\n\n if (target.correspondingUseElement) {\n target = target.correspondingUseElement;\n } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n // @see http://www.quirksmode.org/js/events_properties.html\n\n\n return target.nodeType === TEXT_NODE ? target.parentNode : target;\n}\n\nvar restoreImpl = null;\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n // We perform this translation at the end of the event loop so that we\n // always receive the correct fiber here\n var internalInstance = getInstanceFromNode(target);\n\n if (!internalInstance) {\n // Unmounted\n return;\n }\n\n if (typeof restoreImpl !== 'function') {\n throw new Error('setRestoreImplementation() needs to be called to handle a target for controlled ' + 'events. This error is likely caused by a bug in React. Please file an issue.');\n }\n\n var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.\n\n if (stateNode) {\n var _props = getFiberCurrentPropsFromNode(stateNode);\n\n restoreImpl(internalInstance.stateNode, internalInstance.type, _props);\n }\n}\n\nfunction setRestoreImplementation(impl) {\n restoreImpl = impl;\n}\nfunction enqueueStateRestore(target) {\n if (restoreTarget) {\n if (restoreQueue) {\n restoreQueue.push(target);\n } else {\n restoreQueue = [target];\n }\n } else {\n restoreTarget = target;\n }\n}\nfunction needsStateRestore() {\n return restoreTarget !== null || restoreQueue !== null;\n}\nfunction restoreStateIfNeeded() {\n if (!restoreTarget) {\n return;\n }\n\n var target = restoreTarget;\n var queuedTargets = restoreQueue;\n restoreTarget = null;\n restoreQueue = null;\n restoreStateOfTarget(target);\n\n if (queuedTargets) {\n for (var i = 0; i < queuedTargets.length; i++) {\n restoreStateOfTarget(queuedTargets[i]);\n }\n }\n}\n\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n// Defaults\n\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\n return fn(bookkeeping);\n};\n\nvar flushSyncImpl = function () {};\n\nvar isInsideEventHandler = false;\n\nfunction finishEventHandler() {\n // Here we wait until all updates have propagated, which is important\n // when using controlled components within layers:\n // https://github.com/facebook/react/issues/1698\n // Then we restore state of any controlled component.\n var controlledComponentsHavePendingUpdates = needsStateRestore();\n\n if (controlledComponentsHavePendingUpdates) {\n // If a controlled event was fired, we may need to restore the state of\n // the DOM node back to the controlled value. This is necessary when React\n // bails out of the update without touching the DOM.\n // TODO: Restore state in the microtask, after the discrete updates flush,\n // instead of early flushing them here.\n flushSyncImpl();\n restoreStateIfNeeded();\n }\n}\n\nfunction batchedUpdates(fn, a, b) {\n if (isInsideEventHandler) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(a, b);\n }\n\n isInsideEventHandler = true;\n\n try {\n return batchedUpdatesImpl(fn, a, b);\n } finally {\n isInsideEventHandler = false;\n finishEventHandler();\n }\n} // TODO: Replace with flushSync\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) {\n batchedUpdatesImpl = _batchedUpdatesImpl;\n flushSyncImpl = _flushSyncImpl;\n}\n\nfunction isInteractive(tag) {\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n switch (name) {\n case 'onClick':\n case 'onClickCapture':\n case 'onDoubleClick':\n case 'onDoubleClickCapture':\n case 'onMouseDown':\n case 'onMouseDownCapture':\n case 'onMouseMove':\n case 'onMouseMoveCapture':\n case 'onMouseUp':\n case 'onMouseUpCapture':\n case 'onMouseEnter':\n return !!(props.disabled && isInteractive(type));\n\n default:\n return false;\n }\n}\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\n\n\nfunction getListener(inst, registrationName) {\n var stateNode = inst.stateNode;\n\n if (stateNode === null) {\n // Work in progress (ex: onload events in incremental mode).\n return null;\n }\n\n var props = getFiberCurrentPropsFromNode(stateNode);\n\n if (props === null) {\n // Work in progress.\n return null;\n }\n\n var listener = props[registrationName];\n\n if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n return null;\n }\n\n if (listener && typeof listener !== 'function') {\n throw new Error(\"Expected `\" + registrationName + \"` listener to be a function, instead got a value of `\" + typeof listener + \"` type.\");\n }\n\n return listener;\n}\n\nvar passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners\n// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n\nif (canUseDOM) {\n try {\n var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value\n\n Object.defineProperty(options, 'passive', {\n get: function () {\n passiveBrowserEventsSupported = true;\n }\n });\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n } catch (e) {\n passiveBrowserEventsSupported = false;\n }\n}\n\nfunction invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n try {\n func.apply(context, funcArgs);\n } catch (error) {\n this.onError(error);\n }\n}\n\nvar invokeGuardedCallbackImpl = invokeGuardedCallbackProd;\n\n{\n // In DEV mode, we swap out invokeGuardedCallback for a special version\n // that plays more nicely with the browser's DevTools. The idea is to preserve\n // \"Pause on exceptions\" behavior. Because React wraps all user-provided\n // functions in invokeGuardedCallback, and the production version of\n // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n // like caught exceptions, and the DevTools won't pause unless the developer\n // takes the extra step of enabling pause on caught exceptions. This is\n // unintuitive, though, because even though React has caught the error, from\n // the developer's perspective, the error is uncaught.\n //\n // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n // DOM node, and call the user-provided callback from inside an event handler\n // for that fake event. If the callback throws, the error is \"captured\" using\n // a global event handler. But because the error happens in a different\n // event loop context, it does not interrupt the normal program flow.\n // Effectively, this gives us try-catch behavior without actually using\n // try-catch. Neat!\n // Check that the browser supports the APIs we need to implement our special\n // DEV version of invokeGuardedCallback\n if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n var fakeNode = document.createElement('react');\n\n invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {\n // If document doesn't exist we know for sure we will crash in this method\n // when we call document.createEvent(). However this can cause confusing\n // errors: https://github.com/facebook/create-react-app/issues/3482\n // So we preemptively throw with a better message instead.\n if (typeof document === 'undefined' || document === null) {\n throw new Error('The `document` global was defined when React was initialized, but is not ' + 'defined anymore. This can happen in a test environment if a component ' + 'schedules an update from an asynchronous callback, but the test has already ' + 'finished running. To solve this, you can either unmount the component at ' + 'the end of your test (and ensure that any asynchronous operations get ' + 'canceled in `componentWillUnmount`), or you can change the test itself ' + 'to be asynchronous.');\n }\n\n var evt = document.createEvent('Event');\n var didCall = false; // Keeps track of whether the user-provided callback threw an error. We\n // set this to true at the beginning, then set it to false right after\n // calling the function. If the function errors, `didError` will never be\n // set to false. This strategy works even if the browser is flaky and\n // fails to call our global error handler, because it doesn't rely on\n // the error event at all.\n\n var didError = true; // Keeps track of the value of window.event so that we can reset it\n // during the callback to let user code access window.event in the\n // browsers that support it.\n\n var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event\n // dispatching: https://github.com/facebook/react/issues/13688\n\n var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');\n\n function restoreAfterDispatch() {\n // We immediately remove the callback from event listeners so that\n // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n // nested call would trigger the fake event handlers of any call higher\n // in the stack.\n fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the\n // window.event assignment in both IE <= 10 as they throw an error\n // \"Member not found\" in strict mode, and in Firefox which does not\n // support window.event.\n\n if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\n window.event = windowEvent;\n }\n } // Create an event handler for our fake event. We will synchronously\n // dispatch our fake event using `dispatchEvent`. Inside the handler, we\n // call the user-provided callback.\n\n\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n function callCallback() {\n didCall = true;\n restoreAfterDispatch();\n func.apply(context, funcArgs);\n didError = false;\n } // Create a global error event handler. We use this to capture the value\n // that was thrown. It's possible that this error handler will fire more\n // than once; for example, if non-React code also calls `dispatchEvent`\n // and a handler for that event throws. We should be resilient to most of\n // those cases. Even if our error event handler fires more than once, the\n // last error event is always used. If the callback actually does error,\n // we know that the last error event is the correct one, because it's not\n // possible for anything else to have happened in between our callback\n // erroring and the code that follows the `dispatchEvent` call below. If\n // the callback doesn't error, but the error event was fired, we know to\n // ignore it because `didError` will be false, as described above.\n\n\n var error; // Use this to track whether the error event is ever called.\n\n var didSetError = false;\n var isCrossOriginError = false;\n\n function handleWindowError(event) {\n error = event.error;\n didSetError = true;\n\n if (error === null && event.colno === 0 && event.lineno === 0) {\n isCrossOriginError = true;\n }\n\n if (event.defaultPrevented) {\n // Some other error handler has prevented default.\n // Browsers silence the error report if this happens.\n // We'll remember this to later decide whether to log it or not.\n if (error != null && typeof error === 'object') {\n try {\n error._suppressLogging = true;\n } catch (inner) {// Ignore.\n }\n }\n }\n } // Create a fake event type.\n\n\n var evtType = \"react-\" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers\n\n window.addEventListener('error', handleWindowError);\n fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function\n // errors, it will trigger our global error handler.\n\n evt.initEvent(evtType, false, false);\n fakeNode.dispatchEvent(evt);\n\n if (windowEventDescriptor) {\n Object.defineProperty(window, 'event', windowEventDescriptor);\n }\n\n if (didCall && didError) {\n if (!didSetError) {\n // The callback errored, but the error event never fired.\n // eslint-disable-next-line react-internal/prod-error-codes\n error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n } else if (isCrossOriginError) {\n // eslint-disable-next-line react-internal/prod-error-codes\n error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https://reactjs.org/link/crossorigin-error for more information.');\n }\n\n this.onError(error);\n } // Remove our event listeners\n\n\n window.removeEventListener('error', handleWindowError);\n\n if (!didCall) {\n // Something went really wrong, and our event was not dispatched.\n // https://github.com/facebook/react/issues/16734\n // https://github.com/facebook/react/issues/16585\n // Fall back to the production implementation.\n restoreAfterDispatch();\n return invokeGuardedCallbackProd.apply(this, arguments);\n }\n };\n }\n}\n\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\n\nvar hasError = false;\nvar caughtError = null; // Used by event system to capture/rethrow the first error.\n\nvar hasRethrowError = false;\nvar rethrowError = null;\nvar reporter = {\n onError: function (error) {\n hasError = true;\n caughtError = error;\n }\n};\n/**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n hasError = false;\n caughtError = null;\n invokeGuardedCallbackImpl$1.apply(reporter, arguments);\n}\n/**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by `rethrowCaughtError` later.\n * TODO: See if caughtError and rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\n invokeGuardedCallback.apply(this, arguments);\n\n if (hasError) {\n var error = clearCaughtError();\n\n if (!hasRethrowError) {\n hasRethrowError = true;\n rethrowError = error;\n }\n }\n}\n/**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n */\n\nfunction rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n}\nfunction hasCaughtError() {\n return hasError;\n}\nfunction clearCaughtError() {\n if (hasError) {\n var error = caughtError;\n hasError = false;\n caughtError = null;\n return error;\n } else {\n throw new Error('clearCaughtError was called but no error was captured. This error ' + 'is likely caused by a bug in React. Please file an issue.');\n }\n}\n\n/**\n * `ReactInstanceMap` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n */\nfunction get(key) {\n return key._reactInternals;\n}\nfunction has(key) {\n return key._reactInternals !== undefined;\n}\nfunction set(key, value) {\n key._reactInternals = value;\n}\n\n// Don't change these two values. They're used by React Dev Tools.\nvar NoFlags =\n/* */\n0;\nvar PerformedWork =\n/* */\n1; // You can change the rest (and add more).\n\nvar Placement =\n/* */\n2;\nvar Update =\n/* */\n4;\nvar ChildDeletion =\n/* */\n16;\nvar ContentReset =\n/* */\n32;\nvar Callback =\n/* */\n64;\nvar DidCapture =\n/* */\n128;\nvar ForceClientRender =\n/* */\n256;\nvar Ref =\n/* */\n512;\nvar Snapshot =\n/* */\n1024;\nvar Passive =\n/* */\n2048;\nvar Hydrating =\n/* */\n4096;\nvar Visibility =\n/* */\n8192;\nvar StoreConsistency =\n/* */\n16384;\nvar LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency; // Union of all commit flags (flags with the lifetime of a particular commit)\n\nvar HostEffectMask =\n/* */\n32767; // These are not really side effects, but we still reuse this field.\n\nvar Incomplete =\n/* */\n32768;\nvar ShouldCapture =\n/* */\n65536;\nvar ForceUpdateForLegacySuspense =\n/* */\n131072;\nvar Forked =\n/* */\n1048576; // Static tags describe aspects of a fiber that are not specific to a render,\n// e.g. a fiber uses a passive effect (even if there are no updates on this particular render).\n// This enables us to defer more work in the unmount case,\n// since we can defer traversing the tree during layout to look for Passive effects,\n// and instead rely on the static flag as a signal that there may be cleanup work.\n\nvar RefStatic =\n/* */\n2097152;\nvar LayoutStatic =\n/* */\n4194304;\nvar PassiveStatic =\n/* */\n8388608; // These flags allow us to traverse to fibers that have effects on mount\n// without traversing the entire tree after every commit for\n// double invoking\n\nvar MountLayoutDev =\n/* */\n16777216;\nvar MountPassiveDev =\n/* */\n33554432; // Groups of flags that are used in the commit phase to skip over trees that\n// don't contain effects, by checking subtreeFlags.\n\nvar BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visibility\n// flag logic (see #20043)\nUpdate | Snapshot | ( 0);\nvar MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility;\nvar LayoutMask = Update | Callback | Ref | Visibility; // TODO: Split into PassiveMountMask and PassiveUnmountMask\n\nvar PassiveMask = Passive | ChildDeletion; // Union of tags that don't get reset on clones.\n// This allows certain concepts to persist without recalculating them,\n// e.g. whether a subtree contains passive effects or portals.\n\nvar StaticMask = LayoutStatic | PassiveStatic | RefStatic;\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nfunction getNearestMountedFiber(fiber) {\n var node = fiber;\n var nearestMounted = fiber;\n\n if (!fiber.alternate) {\n // If there is no alternate, this might be a new tree that isn't inserted\n // yet. If it is, then it will have a pending insertion effect on it.\n var nextNode = node;\n\n do {\n node = nextNode;\n\n if ((node.flags & (Placement | Hydrating)) !== NoFlags) {\n // This is an insertion or in-progress hydration. The nearest possible\n // mounted fiber is the parent but we need to continue to figure out\n // if that one is still mounted.\n nearestMounted = node.return;\n }\n\n nextNode = node.return;\n } while (nextNode);\n } else {\n while (node.return) {\n node = node.return;\n }\n }\n\n if (node.tag === HostRoot) {\n // TODO: Check if this was a nested HostRoot when used with\n // renderContainerIntoSubtree.\n return nearestMounted;\n } // If we didn't hit the root, that means that we're in an disconnected tree\n // that has been unmounted.\n\n\n return null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n if (fiber.tag === SuspenseComponent) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState === null) {\n var current = fiber.alternate;\n\n if (current !== null) {\n suspenseState = current.memoizedState;\n }\n }\n\n if (suspenseState !== null) {\n return suspenseState.dehydrated;\n }\n }\n\n return null;\n}\nfunction getContainerFromFiber(fiber) {\n return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;\n}\nfunction isFiberMounted(fiber) {\n return getNearestMountedFiber(fiber) === fiber;\n}\nfunction isMounted(component) {\n {\n var owner = ReactCurrentOwner.current;\n\n if (owner !== null && owner.tag === ClassComponent) {\n var ownerFiber = owner;\n var instance = ownerFiber.stateNode;\n\n if (!instance._warnedAboutRefsInRender) {\n error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentNameFromFiber(ownerFiber) || 'A component');\n }\n\n instance._warnedAboutRefsInRender = true;\n }\n }\n\n var fiber = get(component);\n\n if (!fiber) {\n return false;\n }\n\n return getNearestMountedFiber(fiber) === fiber;\n}\n\nfunction assertIsMounted(fiber) {\n if (getNearestMountedFiber(fiber) !== fiber) {\n throw new Error('Unable to find node on an unmounted component.');\n }\n}\n\nfunction findCurrentFiberUsingSlowPath(fiber) {\n var alternate = fiber.alternate;\n\n if (!alternate) {\n // If there is no alternate, then we only need to check if it is mounted.\n var nearestMounted = getNearestMountedFiber(fiber);\n\n if (nearestMounted === null) {\n throw new Error('Unable to find node on an unmounted component.');\n }\n\n if (nearestMounted !== fiber) {\n return null;\n }\n\n return fiber;\n } // If we have two possible branches, we'll walk backwards up to the root\n // to see what path the root points to. On the way we may hit one of the\n // special cases and we'll deal with them.\n\n\n var a = fiber;\n var b = alternate;\n\n while (true) {\n var parentA = a.return;\n\n if (parentA === null) {\n // We're at the root.\n break;\n }\n\n var parentB = parentA.alternate;\n\n if (parentB === null) {\n // There is no alternate. This is an unusual case. Currently, it only\n // happens when a Suspense component is hidden. An extra fragment fiber\n // is inserted in between the Suspense fiber and its children. Skip\n // over this extra fragment fiber and proceed to the next parent.\n var nextParent = parentA.return;\n\n if (nextParent !== null) {\n a = b = nextParent;\n continue;\n } // If there's no parent, we're at the root.\n\n\n break;\n } // If both copies of the parent fiber point to the same child, we can\n // assume that the child is current. This happens when we bailout on low\n // priority: the bailed out fiber's child reuses the current child.\n\n\n if (parentA.child === parentB.child) {\n var child = parentA.child;\n\n while (child) {\n if (child === a) {\n // We've determined that A is the current branch.\n assertIsMounted(parentA);\n return fiber;\n }\n\n if (child === b) {\n // We've determined that B is the current branch.\n assertIsMounted(parentA);\n return alternate;\n }\n\n child = child.sibling;\n } // We should never have an alternate for any mounting node. So the only\n // way this could possibly happen is if this was unmounted, if at all.\n\n\n throw new Error('Unable to find node on an unmounted component.');\n }\n\n if (a.return !== b.return) {\n // The return pointer of A and the return pointer of B point to different\n // fibers. We assume that return pointers never criss-cross, so A must\n // belong to the child set of A.return, and B must belong to the child\n // set of B.return.\n a = parentA;\n b = parentB;\n } else {\n // The return pointers point to the same fiber. We'll have to use the\n // default, slow path: scan the child sets of each parent alternate to see\n // which child belongs to which set.\n //\n // Search parent A's child set\n var didFindChild = false;\n var _child = parentA.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentA;\n b = parentB;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentA;\n a = parentB;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n // Search parent B's child set\n _child = parentB.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentB;\n b = parentA;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentB;\n a = parentA;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n throw new Error('Child was not found in either parent set. This indicates a bug ' + 'in React related to the return pointer. Please file an issue.');\n }\n }\n }\n\n if (a.alternate !== b) {\n throw new Error(\"Return fibers should always be each others' alternates. \" + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n } // If the root is not a host container, we're in a disconnected tree. I.e.\n // unmounted.\n\n\n if (a.tag !== HostRoot) {\n throw new Error('Unable to find node on an unmounted component.');\n }\n\n if (a.stateNode.current === a) {\n // We've determined that A is the current branch.\n return fiber;\n } // Otherwise B has to be current branch.\n\n\n return alternate;\n}\nfunction findCurrentHostFiber(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null;\n}\n\nfunction findCurrentHostFiberImpl(node) {\n // Next we'll drill down this component to find the first HostComponent/Text.\n if (node.tag === HostComponent || node.tag === HostText) {\n return node;\n }\n\n var child = node.child;\n\n while (child !== null) {\n var match = findCurrentHostFiberImpl(child);\n\n if (match !== null) {\n return match;\n }\n\n child = child.sibling;\n }\n\n return null;\n}\n\nfunction findCurrentHostFiberWithNoPortals(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null;\n}\n\nfunction findCurrentHostFiberWithNoPortalsImpl(node) {\n // Next we'll drill down this component to find the first HostComponent/Text.\n if (node.tag === HostComponent || node.tag === HostText) {\n return node;\n }\n\n var child = node.child;\n\n while (child !== null) {\n if (child.tag !== HostPortal) {\n var match = findCurrentHostFiberWithNoPortalsImpl(child);\n\n if (match !== null) {\n return match;\n }\n }\n\n child = child.sibling;\n }\n\n return null;\n}\n\n// This module only exists as an ESM wrapper around the external CommonJS\nvar scheduleCallback = Scheduler.unstable_scheduleCallback;\nvar cancelCallback = Scheduler.unstable_cancelCallback;\nvar shouldYield = Scheduler.unstable_shouldYield;\nvar requestPaint = Scheduler.unstable_requestPaint;\nvar now = Scheduler.unstable_now;\nvar getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;\nvar ImmediatePriority = Scheduler.unstable_ImmediatePriority;\nvar UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;\nvar NormalPriority = Scheduler.unstable_NormalPriority;\nvar LowPriority = Scheduler.unstable_LowPriority;\nvar IdlePriority = Scheduler.unstable_IdlePriority;\n// this doesn't actually exist on the scheduler, but it *does*\n// on scheduler/unstable_mock, which we'll need for internal testing\nvar unstable_yieldValue = Scheduler.unstable_yieldValue;\nvar unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue;\n\nvar rendererID = null;\nvar injectedHook = null;\nvar injectedProfilingHooks = null;\nvar hasLoggedError = false;\nvar isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';\nfunction injectInternals(internals) {\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\n // No DevTools\n return false;\n }\n\n var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // https://github.com/facebook/react/issues/3877\n return true;\n }\n\n if (!hook.supportsFiber) {\n {\n error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://reactjs.org/link/react-devtools');\n } // DevTools exists, even though it doesn't support Fiber.\n\n\n return true;\n }\n\n try {\n if (enableSchedulingProfiler) {\n // Conditionally inject these hooks only if Timeline profiler is supported by this build.\n // This gives DevTools a way to feature detect that isn't tied to version number\n // (since profiling and timeline are controlled by different feature flags).\n internals = assign({}, internals, {\n getLaneLabelMap: getLaneLabelMap,\n injectProfilingHooks: injectProfilingHooks\n });\n }\n\n rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.\n\n injectedHook = hook;\n } catch (err) {\n // Catch all errors because it is unsafe to throw during initialization.\n {\n error('React instrumentation encountered an error: %s.', err);\n }\n }\n\n if (hook.checkDCE) {\n // This is the real DevTools.\n return true;\n } else {\n // This is likely a hook installed by Fast Refresh runtime.\n return false;\n }\n}\nfunction onScheduleRoot(root, children) {\n {\n if (injectedHook && typeof injectedHook.onScheduleFiberRoot === 'function') {\n try {\n injectedHook.onScheduleFiberRoot(rendererID, root, children);\n } catch (err) {\n if ( !hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n }\n}\nfunction onCommitRoot(root, eventPriority) {\n if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') {\n try {\n var didError = (root.current.flags & DidCapture) === DidCapture;\n\n if (enableProfilerTimer) {\n var schedulerPriority;\n\n switch (eventPriority) {\n case DiscreteEventPriority:\n schedulerPriority = ImmediatePriority;\n break;\n\n case ContinuousEventPriority:\n schedulerPriority = UserBlockingPriority;\n break;\n\n case DefaultEventPriority:\n schedulerPriority = NormalPriority;\n break;\n\n case IdleEventPriority:\n schedulerPriority = IdlePriority;\n break;\n\n default:\n schedulerPriority = NormalPriority;\n break;\n }\n\n injectedHook.onCommitFiberRoot(rendererID, root, schedulerPriority, didError);\n } else {\n injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError);\n }\n } catch (err) {\n {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n }\n}\nfunction onPostCommitRoot(root) {\n if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === 'function') {\n try {\n injectedHook.onPostCommitFiberRoot(rendererID, root);\n } catch (err) {\n {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n }\n}\nfunction onCommitUnmount(fiber) {\n if (injectedHook && typeof injectedHook.onCommitFiberUnmount === 'function') {\n try {\n injectedHook.onCommitFiberUnmount(rendererID, fiber);\n } catch (err) {\n {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n }\n}\nfunction setIsStrictModeForDevtools(newIsStrictMode) {\n {\n if (typeof unstable_yieldValue === 'function') {\n // We're in a test because Scheduler.unstable_yieldValue only exists\n // in SchedulerMock. To reduce the noise in strict mode tests,\n // suppress warnings and disable scheduler yielding during the double render\n unstable_setDisableYieldValue(newIsStrictMode);\n setSuppressWarning(newIsStrictMode);\n }\n\n if (injectedHook && typeof injectedHook.setStrictMode === 'function') {\n try {\n injectedHook.setStrictMode(rendererID, newIsStrictMode);\n } catch (err) {\n {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n }\n }\n} // Profiler API hooks\n\nfunction injectProfilingHooks(profilingHooks) {\n injectedProfilingHooks = profilingHooks;\n}\n\nfunction getLaneLabelMap() {\n {\n var map = new Map();\n var lane = 1;\n\n for (var index = 0; index < TotalLanes; index++) {\n var label = getLabelForLane(lane);\n map.set(lane, label);\n lane *= 2;\n }\n\n return map;\n }\n}\n\nfunction markCommitStarted(lanes) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === 'function') {\n injectedProfilingHooks.markCommitStarted(lanes);\n }\n }\n}\nfunction markCommitStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === 'function') {\n injectedProfilingHooks.markCommitStopped();\n }\n }\n}\nfunction markComponentRenderStarted(fiber) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === 'function') {\n injectedProfilingHooks.markComponentRenderStarted(fiber);\n }\n }\n}\nfunction markComponentRenderStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === 'function') {\n injectedProfilingHooks.markComponentRenderStopped();\n }\n }\n}\nfunction markComponentPassiveEffectMountStarted(fiber) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === 'function') {\n injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);\n }\n }\n}\nfunction markComponentPassiveEffectMountStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === 'function') {\n injectedProfilingHooks.markComponentPassiveEffectMountStopped();\n }\n }\n}\nfunction markComponentPassiveEffectUnmountStarted(fiber) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === 'function') {\n injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);\n }\n }\n}\nfunction markComponentPassiveEffectUnmountStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === 'function') {\n injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();\n }\n }\n}\nfunction markComponentLayoutEffectMountStarted(fiber) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === 'function') {\n injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);\n }\n }\n}\nfunction markComponentLayoutEffectMountStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === 'function') {\n injectedProfilingHooks.markComponentLayoutEffectMountStopped();\n }\n }\n}\nfunction markComponentLayoutEffectUnmountStarted(fiber) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === 'function') {\n injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);\n }\n }\n}\nfunction markComponentLayoutEffectUnmountStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === 'function') {\n injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();\n }\n }\n}\nfunction markComponentErrored(fiber, thrownValue, lanes) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === 'function') {\n injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);\n }\n }\n}\nfunction markComponentSuspended(fiber, wakeable, lanes) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === 'function') {\n injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);\n }\n }\n}\nfunction markLayoutEffectsStarted(lanes) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === 'function') {\n injectedProfilingHooks.markLayoutEffectsStarted(lanes);\n }\n }\n}\nfunction markLayoutEffectsStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === 'function') {\n injectedProfilingHooks.markLayoutEffectsStopped();\n }\n }\n}\nfunction markPassiveEffectsStarted(lanes) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === 'function') {\n injectedProfilingHooks.markPassiveEffectsStarted(lanes);\n }\n }\n}\nfunction markPassiveEffectsStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === 'function') {\n injectedProfilingHooks.markPassiveEffectsStopped();\n }\n }\n}\nfunction markRenderStarted(lanes) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === 'function') {\n injectedProfilingHooks.markRenderStarted(lanes);\n }\n }\n}\nfunction markRenderYielded() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === 'function') {\n injectedProfilingHooks.markRenderYielded();\n }\n }\n}\nfunction markRenderStopped() {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === 'function') {\n injectedProfilingHooks.markRenderStopped();\n }\n }\n}\nfunction markRenderScheduled(lane) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === 'function') {\n injectedProfilingHooks.markRenderScheduled(lane);\n }\n }\n}\nfunction markForceUpdateScheduled(fiber, lane) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === 'function') {\n injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);\n }\n }\n}\nfunction markStateUpdateScheduled(fiber, lane) {\n {\n if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === 'function') {\n injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);\n }\n }\n}\n\nvar NoMode =\n/* */\n0; // TODO: Remove ConcurrentMode by reading from the root tag instead\n\nvar ConcurrentMode =\n/* */\n1;\nvar ProfileMode =\n/* */\n2;\nvar StrictLegacyMode =\n/* */\n8;\nvar StrictEffectsMode =\n/* */\n16;\n\n// TODO: This is pretty well supported by browsers. Maybe we can drop it.\nvar clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros.\n// Based on:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32\n\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\nfunction clz32Fallback(x) {\n var asUint = x >>> 0;\n\n if (asUint === 0) {\n return 32;\n }\n\n return 31 - (log(asUint) / LN2 | 0) | 0;\n}\n\n// If those values are changed that package should be rebuilt and redeployed.\n\nvar TotalLanes = 31;\nvar NoLanes =\n/* */\n0;\nvar NoLane =\n/* */\n0;\nvar SyncLane =\n/* */\n1;\nvar InputContinuousHydrationLane =\n/* */\n2;\nvar InputContinuousLane =\n/* */\n4;\nvar DefaultHydrationLane =\n/* */\n8;\nvar DefaultLane =\n/* */\n16;\nvar TransitionHydrationLane =\n/* */\n32;\nvar TransitionLanes =\n/* */\n4194240;\nvar TransitionLane1 =\n/* */\n64;\nvar TransitionLane2 =\n/* */\n128;\nvar TransitionLane3 =\n/* */\n256;\nvar TransitionLane4 =\n/* */\n512;\nvar TransitionLane5 =\n/* */\n1024;\nvar TransitionLane6 =\n/* */\n2048;\nvar TransitionLane7 =\n/* */\n4096;\nvar TransitionLane8 =\n/* */\n8192;\nvar TransitionLane9 =\n/* */\n16384;\nvar TransitionLane10 =\n/* */\n32768;\nvar TransitionLane11 =\n/* */\n65536;\nvar TransitionLane12 =\n/* */\n131072;\nvar TransitionLane13 =\n/* */\n262144;\nvar TransitionLane14 =\n/* */\n524288;\nvar TransitionLane15 =\n/* */\n1048576;\nvar TransitionLane16 =\n/* */\n2097152;\nvar RetryLanes =\n/* */\n130023424;\nvar RetryLane1 =\n/* */\n4194304;\nvar RetryLane2 =\n/* */\n8388608;\nvar RetryLane3 =\n/* */\n16777216;\nvar RetryLane4 =\n/* */\n33554432;\nvar RetryLane5 =\n/* */\n67108864;\nvar SomeRetryLane = RetryLane1;\nvar SelectiveHydrationLane =\n/* */\n134217728;\nvar NonIdleLanes =\n/* */\n268435455;\nvar IdleHydrationLane =\n/* */\n268435456;\nvar IdleLane =\n/* */\n536870912;\nvar OffscreenLane =\n/* */\n1073741824; // This function is used for the experimental timeline (react-devtools-timeline)\n// It should be kept in sync with the Lanes values above.\n\nfunction getLabelForLane(lane) {\n {\n if (lane & SyncLane) {\n return 'Sync';\n }\n\n if (lane & InputContinuousHydrationLane) {\n return 'InputContinuousHydration';\n }\n\n if (lane & InputContinuousLane) {\n return 'InputContinuous';\n }\n\n if (lane & DefaultHydrationLane) {\n return 'DefaultHydration';\n }\n\n if (lane & DefaultLane) {\n return 'Default';\n }\n\n if (lane & TransitionHydrationLane) {\n return 'TransitionHydration';\n }\n\n if (lane & TransitionLanes) {\n return 'Transition';\n }\n\n if (lane & RetryLanes) {\n return 'Retry';\n }\n\n if (lane & SelectiveHydrationLane) {\n return 'SelectiveHydration';\n }\n\n if (lane & IdleHydrationLane) {\n return 'IdleHydration';\n }\n\n if (lane & IdleLane) {\n return 'Idle';\n }\n\n if (lane & OffscreenLane) {\n return 'Offscreen';\n }\n }\n}\nvar NoTimestamp = -1;\nvar nextTransitionLane = TransitionLane1;\nvar nextRetryLane = RetryLane1;\n\nfunction getHighestPriorityLanes(lanes) {\n switch (getHighestPriorityLane(lanes)) {\n case SyncLane:\n return SyncLane;\n\n case InputContinuousHydrationLane:\n return InputContinuousHydrationLane;\n\n case InputContinuousLane:\n return InputContinuousLane;\n\n case DefaultHydrationLane:\n return DefaultHydrationLane;\n\n case DefaultLane:\n return DefaultLane;\n\n case TransitionHydrationLane:\n return TransitionHydrationLane;\n\n case TransitionLane1:\n case TransitionLane2:\n case TransitionLane3:\n case TransitionLane4:\n case TransitionLane5:\n case TransitionLane6:\n case TransitionLane7:\n case TransitionLane8:\n case TransitionLane9:\n case TransitionLane10:\n case TransitionLane11:\n case TransitionLane12:\n case TransitionLane13:\n case TransitionLane14:\n case TransitionLane15:\n case TransitionLane16:\n return lanes & TransitionLanes;\n\n case RetryLane1:\n case RetryLane2:\n case RetryLane3:\n case RetryLane4:\n case RetryLane5:\n return lanes & RetryLanes;\n\n case SelectiveHydrationLane:\n return SelectiveHydrationLane;\n\n case IdleHydrationLane:\n return IdleHydrationLane;\n\n case IdleLane:\n return IdleLane;\n\n case OffscreenLane:\n return OffscreenLane;\n\n default:\n {\n error('Should have found matching lanes. This is a bug in React.');\n } // This shouldn't be reachable, but as a fallback, return the entire bitmask.\n\n\n return lanes;\n }\n}\n\nfunction getNextLanes(root, wipLanes) {\n // Early bailout if there's no pending work left.\n var pendingLanes = root.pendingLanes;\n\n if (pendingLanes === NoLanes) {\n return NoLanes;\n }\n\n var nextLanes = NoLanes;\n var suspendedLanes = root.suspendedLanes;\n var pingedLanes = root.pingedLanes; // Do not work on any idle work until all the non-idle work has finished,\n // even if the work is suspended.\n\n var nonIdlePendingLanes = pendingLanes & NonIdleLanes;\n\n if (nonIdlePendingLanes !== NoLanes) {\n var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;\n\n if (nonIdleUnblockedLanes !== NoLanes) {\n nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);\n } else {\n var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;\n\n if (nonIdlePingedLanes !== NoLanes) {\n nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);\n }\n }\n } else {\n // The only remaining work is Idle.\n var unblockedLanes = pendingLanes & ~suspendedLanes;\n\n if (unblockedLanes !== NoLanes) {\n nextLanes = getHighestPriorityLanes(unblockedLanes);\n } else {\n if (pingedLanes !== NoLanes) {\n nextLanes = getHighestPriorityLanes(pingedLanes);\n }\n }\n }\n\n if (nextLanes === NoLanes) {\n // This should only be reachable if we're suspended\n // TODO: Consider warning in this path if a fallback timer is not scheduled.\n return NoLanes;\n } // If we're already in the middle of a render, switching lanes will interrupt\n // it and we'll lose our progress. We should only do this if the new lanes are\n // higher priority.\n\n\n if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't\n // bother waiting until the root is complete.\n (wipLanes & suspendedLanes) === NoLanes) {\n var nextLane = getHighestPriorityLane(nextLanes);\n var wipLane = getHighestPriorityLane(wipLanes);\n\n if ( // Tests whether the next lane is equal or lower priority than the wip\n // one. This works because the bits decrease in priority as you go left.\n nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The\n // only difference between default updates and transition updates is that\n // default updates do not support refresh transitions.\n nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) {\n // Keep working on the existing in-progress tree. Do not interrupt.\n return wipLanes;\n }\n }\n\n if ((nextLanes & InputContinuousLane) !== NoLanes) {\n // When updates are sync by default, we entangle continuous priority updates\n // and default updates, so they render in the same batch. The only reason\n // they use separate lanes is because continuous updates should interrupt\n // transitions, but default updates should not.\n nextLanes |= pendingLanes & DefaultLane;\n } // Check for entangled lanes and add them to the batch.\n //\n // A lane is said to be entangled with another when it's not allowed to render\n // in a batch that does not also include the other lane. Typically we do this\n // when multiple updates have the same source, and we only want to respond to\n // the most recent event from that source.\n //\n // Note that we apply entanglements *after* checking for partial work above.\n // This means that if a lane is entangled during an interleaved event while\n // it's already rendering, we won't interrupt it. This is intentional, since\n // entanglement is usually \"best effort\": we'll try our best to render the\n // lanes in the same batch, but it's not worth throwing out partially\n // completed work in order to do it.\n // TODO: Reconsider this. The counter-argument is that the partial work\n // represents an intermediate state, which we don't want to show to the user.\n // And by spending extra time finishing it, we're increasing the amount of\n // time it takes to show the final state, which is what they are actually\n // waiting for.\n //\n // For those exceptions where entanglement is semantically important, like\n // useMutableSource, we should ensure that there is no partial work at the\n // time we apply the entanglement.\n\n\n var entangledLanes = root.entangledLanes;\n\n if (entangledLanes !== NoLanes) {\n var entanglements = root.entanglements;\n var lanes = nextLanes & entangledLanes;\n\n while (lanes > 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 << index;\n nextLanes |= entanglements[index];\n lanes &= ~lane;\n }\n }\n\n return nextLanes;\n}\nfunction getMostRecentEventTime(root, lanes) {\n var eventTimes = root.eventTimes;\n var mostRecentEventTime = NoTimestamp;\n\n while (lanes > 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 << index;\n var eventTime = eventTimes[index];\n\n if (eventTime > mostRecentEventTime) {\n mostRecentEventTime = eventTime;\n }\n\n lanes &= ~lane;\n }\n\n return mostRecentEventTime;\n}\n\nfunction computeExpirationTime(lane, currentTime) {\n switch (lane) {\n case SyncLane:\n case InputContinuousHydrationLane:\n case InputContinuousLane:\n // User interactions should expire slightly more quickly.\n //\n // NOTE: This is set to the corresponding constant as in Scheduler.js.\n // When we made it larger, a product metric in www regressed, suggesting\n // there's a user interaction that's being starved by a series of\n // synchronous updates. If that theory is correct, the proper solution is\n // to fix the starvation. However, this scenario supports the idea that\n // expiration times are an important safeguard when starvation\n // does happen.\n return currentTime + 250;\n\n case DefaultHydrationLane:\n case DefaultLane:\n case TransitionHydrationLane:\n case TransitionLane1:\n case TransitionLane2:\n case TransitionLane3:\n case TransitionLane4:\n case TransitionLane5:\n case TransitionLane6:\n case TransitionLane7:\n case TransitionLane8:\n case TransitionLane9:\n case TransitionLane10:\n case TransitionLane11:\n case TransitionLane12:\n case TransitionLane13:\n case TransitionLane14:\n case TransitionLane15:\n case TransitionLane16:\n return currentTime + 5000;\n\n case RetryLane1:\n case RetryLane2:\n case RetryLane3:\n case RetryLane4:\n case RetryLane5:\n // TODO: Retries should be allowed to expire if they are CPU bound for\n // too long, but when I made this change it caused a spike in browser\n // crashes. There must be some other underlying bug; not super urgent but\n // ideally should figure out why and fix it. Unfortunately we don't have\n // a repro for the crashes, only detected via production metrics.\n return NoTimestamp;\n\n case SelectiveHydrationLane:\n case IdleHydrationLane:\n case IdleLane:\n case OffscreenLane:\n // Anything idle priority or lower should never expire.\n return NoTimestamp;\n\n default:\n {\n error('Should have found matching lanes. This is a bug in React.');\n }\n\n return NoTimestamp;\n }\n}\n\nfunction markStarvedLanesAsExpired(root, currentTime) {\n // TODO: This gets called every time we yield. We can optimize by storing\n // the earliest expiration time on the root. Then use that to quickly bail out\n // of this function.\n var pendingLanes = root.pendingLanes;\n var suspendedLanes = root.suspendedLanes;\n var pingedLanes = root.pingedLanes;\n var expirationTimes = root.expirationTimes; // Iterate through the pending lanes and check if we've reached their\n // expiration time. If so, we'll assume the update is being starved and mark\n // it as expired to force it to finish.\n\n var lanes = pendingLanes;\n\n while (lanes > 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 << index;\n var expirationTime = expirationTimes[index];\n\n if (expirationTime === NoTimestamp) {\n // Found a pending lane with no expiration time. If it's not suspended, or\n // if it's pinged, assume it's CPU-bound. Compute a new expiration time\n // using the current time.\n if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {\n // Assumes timestamps are monotonically increasing.\n expirationTimes[index] = computeExpirationTime(lane, currentTime);\n }\n } else if (expirationTime <= currentTime) {\n // This lane expired\n root.expiredLanes |= lane;\n }\n\n lanes &= ~lane;\n }\n} // This returns the highest priority pending lanes regardless of whether they\n// are suspended.\n\nfunction getHighestPriorityPendingLanes(root) {\n return getHighestPriorityLanes(root.pendingLanes);\n}\nfunction getLanesToRetrySynchronouslyOnError(root) {\n var everythingButOffscreen = root.pendingLanes & ~OffscreenLane;\n\n if (everythingButOffscreen !== NoLanes) {\n return everythingButOffscreen;\n }\n\n if (everythingButOffscreen & OffscreenLane) {\n return OffscreenLane;\n }\n\n return NoLanes;\n}\nfunction includesSyncLane(lanes) {\n return (lanes & SyncLane) !== NoLanes;\n}\nfunction includesNonIdleWork(lanes) {\n return (lanes & NonIdleLanes) !== NoLanes;\n}\nfunction includesOnlyRetries(lanes) {\n return (lanes & RetryLanes) === lanes;\n}\nfunction includesOnlyNonUrgentLanes(lanes) {\n var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane;\n return (lanes & UrgentLanes) === NoLanes;\n}\nfunction includesOnlyTransitions(lanes) {\n return (lanes & TransitionLanes) === lanes;\n}\nfunction includesBlockingLane(root, lanes) {\n\n var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane;\n return (lanes & SyncDefaultLanes) !== NoLanes;\n}\nfunction includesExpiredLane(root, lanes) {\n // This is a separate check from includesBlockingLane because a lane can\n // expire after a render has already started.\n return (lanes & root.expiredLanes) !== NoLanes;\n}\nfunction isTransitionLane(lane) {\n return (lane & TransitionLanes) !== NoLanes;\n}\nfunction claimNextTransitionLane() {\n // Cycle through the lanes, assigning each new transition to the next lane.\n // In most cases, this means every transition gets its own lane, until we\n // run out of lanes and cycle back to the beginning.\n var lane = nextTransitionLane;\n nextTransitionLane <<= 1;\n\n if ((nextTransitionLane & TransitionLanes) === NoLanes) {\n nextTransitionLane = TransitionLane1;\n }\n\n return lane;\n}\nfunction claimNextRetryLane() {\n var lane = nextRetryLane;\n nextRetryLane <<= 1;\n\n if ((nextRetryLane & RetryLanes) === NoLanes) {\n nextRetryLane = RetryLane1;\n }\n\n return lane;\n}\nfunction getHighestPriorityLane(lanes) {\n return lanes & -lanes;\n}\nfunction pickArbitraryLane(lanes) {\n // This wrapper function gets inlined. Only exists so to communicate that it\n // doesn't matter which bit is selected; you can pick any bit without\n // affecting the algorithms where its used. Here I'm using\n // getHighestPriorityLane because it requires the fewest operations.\n return getHighestPriorityLane(lanes);\n}\n\nfunction pickArbitraryLaneIndex(lanes) {\n return 31 - clz32(lanes);\n}\n\nfunction laneToIndex(lane) {\n return pickArbitraryLaneIndex(lane);\n}\n\nfunction includesSomeLane(a, b) {\n return (a & b) !== NoLanes;\n}\nfunction isSubsetOfLanes(set, subset) {\n return (set & subset) === subset;\n}\nfunction mergeLanes(a, b) {\n return a | b;\n}\nfunction removeLanes(set, subset) {\n return set & ~subset;\n}\nfunction intersectLanes(a, b) {\n return a & b;\n} // Seems redundant, but it changes the type from a single lane (used for\n// updates) to a group of lanes (used for flushing work).\n\nfunction laneToLanes(lane) {\n return lane;\n}\nfunction higherPriorityLane(a, b) {\n // This works because the bit ranges decrease in priority as you go left.\n return a !== NoLane && a < b ? a : b;\n}\nfunction createLaneMap(initial) {\n // Intentionally pushing one by one.\n // https://v8.dev/blog/elements-kinds#avoid-creating-holes\n var laneMap = [];\n\n for (var i = 0; i < TotalLanes; i++) {\n laneMap.push(initial);\n }\n\n return laneMap;\n}\nfunction markRootUpdated(root, updateLane, eventTime) {\n root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update\n // could unblock them. Clear the suspended lanes so that we can try rendering\n // them again.\n //\n // TODO: We really only need to unsuspend only lanes that are in the\n // `subtreeLanes` of the updated fiber, or the update lanes of the return\n // path. This would exclude suspended updates in an unrelated sibling tree,\n // since there's no way for this update to unblock it.\n //\n // We don't do this if the incoming update is idle, because we never process\n // idle updates until after all the regular updates have finished; there's no\n // way it could unblock a transition.\n\n if (updateLane !== IdleLane) {\n root.suspendedLanes = NoLanes;\n root.pingedLanes = NoLanes;\n }\n\n var eventTimes = root.eventTimes;\n var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most\n // recent event, and we assume time is monotonically increasing.\n\n eventTimes[index] = eventTime;\n}\nfunction markRootSuspended(root, suspendedLanes) {\n root.suspendedLanes |= suspendedLanes;\n root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times.\n\n var expirationTimes = root.expirationTimes;\n var lanes = suspendedLanes;\n\n while (lanes > 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 << index;\n expirationTimes[index] = NoTimestamp;\n lanes &= ~lane;\n }\n}\nfunction markRootPinged(root, pingedLanes, eventTime) {\n root.pingedLanes |= root.suspendedLanes & pingedLanes;\n}\nfunction markRootFinished(root, remainingLanes) {\n var noLongerPendingLanes = root.pendingLanes & ~remainingLanes;\n root.pendingLanes = remainingLanes; // Let's try everything again\n\n root.suspendedLanes = NoLanes;\n root.pingedLanes = NoLanes;\n root.expiredLanes &= remainingLanes;\n root.mutableReadLanes &= remainingLanes;\n root.entangledLanes &= remainingLanes;\n var entanglements = root.entanglements;\n var eventTimes = root.eventTimes;\n var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work\n\n var lanes = noLongerPendingLanes;\n\n while (lanes > 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 << index;\n entanglements[index] = NoLanes;\n eventTimes[index] = NoTimestamp;\n expirationTimes[index] = NoTimestamp;\n lanes &= ~lane;\n }\n}\nfunction markRootEntangled(root, entangledLanes) {\n // In addition to entangling each of the given lanes with each other, we also\n // have to consider _transitive_ entanglements. For each lane that is already\n // entangled with *any* of the given lanes, that lane is now transitively\n // entangled with *all* the given lanes.\n //\n // Translated: If C is entangled with A, then entangling A with B also\n // entangles C with B.\n //\n // If this is hard to grasp, it might help to intentionally break this\n // function and look at the tests that fail in ReactTransition-test.js. Try\n // commenting out one of the conditions below.\n var rootEntangledLanes = root.entangledLanes |= entangledLanes;\n var entanglements = root.entanglements;\n var lanes = rootEntangledLanes;\n\n while (lanes) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 << index;\n\n if ( // Is this one of the newly entangled lanes?\n lane & entangledLanes | // Is this lane transitively entangled with the newly entangled lanes?\n entanglements[index] & entangledLanes) {\n entanglements[index] |= entangledLanes;\n }\n\n lanes &= ~lane;\n }\n}\nfunction getBumpedLaneForHydration(root, renderLanes) {\n var renderLane = getHighestPriorityLane(renderLanes);\n var lane;\n\n switch (renderLane) {\n case InputContinuousLane:\n lane = InputContinuousHydrationLane;\n break;\n\n case DefaultLane:\n lane = DefaultHydrationLane;\n break;\n\n case TransitionLane1:\n case TransitionLane2:\n case TransitionLane3:\n case TransitionLane4:\n case TransitionLane5:\n case TransitionLane6:\n case TransitionLane7:\n case TransitionLane8:\n case TransitionLane9:\n case TransitionLane10:\n case TransitionLane11:\n case TransitionLane12:\n case TransitionLane13:\n case TransitionLane14:\n case TransitionLane15:\n case TransitionLane16:\n case RetryLane1:\n case RetryLane2:\n case RetryLane3:\n case RetryLane4:\n case RetryLane5:\n lane = TransitionHydrationLane;\n break;\n\n case IdleLane:\n lane = IdleHydrationLane;\n break;\n\n default:\n // Everything else is already either a hydration lane, or shouldn't\n // be retried at a hydration lane.\n lane = NoLane;\n break;\n } // Check if the lane we chose is suspended. If so, that indicates that we\n // already attempted and failed to hydrate at that level. Also check if we're\n // already rendering that lane, which is rare but could happen.\n\n\n if ((lane & (root.suspendedLanes | renderLanes)) !== NoLane) {\n // Give up trying to hydrate and fall back to client render.\n return NoLane;\n }\n\n return lane;\n}\nfunction addFiberToLanesMap(root, fiber, lanes) {\n\n if (!isDevToolsPresent) {\n return;\n }\n\n var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap;\n\n while (lanes > 0) {\n var index = laneToIndex(lanes);\n var lane = 1 << index;\n var updaters = pendingUpdatersLaneMap[index];\n updaters.add(fiber);\n lanes &= ~lane;\n }\n}\nfunction movePendingFibersToMemoized(root, lanes) {\n\n if (!isDevToolsPresent) {\n return;\n }\n\n var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap;\n var memoizedUpdaters = root.memoizedUpdaters;\n\n while (lanes > 0) {\n var index = laneToIndex(lanes);\n var lane = 1 << index;\n var updaters = pendingUpdatersLaneMap[index];\n\n if (updaters.size > 0) {\n updaters.forEach(function (fiber) {\n var alternate = fiber.alternate;\n\n if (alternate === null || !memoizedUpdaters.has(alternate)) {\n memoizedUpdaters.add(fiber);\n }\n });\n updaters.clear();\n }\n\n lanes &= ~lane;\n }\n}\nfunction getTransitionsForLanes(root, lanes) {\n {\n return null;\n }\n}\n\nvar DiscreteEventPriority = SyncLane;\nvar ContinuousEventPriority = InputContinuousLane;\nvar DefaultEventPriority = DefaultLane;\nvar IdleEventPriority = IdleLane;\nvar currentUpdatePriority = NoLane;\nfunction getCurrentUpdatePriority() {\n return currentUpdatePriority;\n}\nfunction setCurrentUpdatePriority(newPriority) {\n currentUpdatePriority = newPriority;\n}\nfunction runWithPriority(priority, fn) {\n var previousPriority = currentUpdatePriority;\n\n try {\n currentUpdatePriority = priority;\n return fn();\n } finally {\n currentUpdatePriority = previousPriority;\n }\n}\nfunction higherEventPriority(a, b) {\n return a !== 0 && a < b ? a : b;\n}\nfunction lowerEventPriority(a, b) {\n return a === 0 || a > b ? a : b;\n}\nfunction isHigherEventPriority(a, b) {\n return a !== 0 && a < b;\n}\nfunction lanesToEventPriority(lanes) {\n var lane = getHighestPriorityLane(lanes);\n\n if (!isHigherEventPriority(DiscreteEventPriority, lane)) {\n return DiscreteEventPriority;\n }\n\n if (!isHigherEventPriority(ContinuousEventPriority, lane)) {\n return ContinuousEventPriority;\n }\n\n if (includesNonIdleWork(lane)) {\n return DefaultEventPriority;\n }\n\n return IdleEventPriority;\n}\n\n// This is imported by the event replaying implementation in React DOM. It's\n// in a separate file to break a circular dependency between the renderer and\n// the reconciler.\nfunction isRootDehydrated(root) {\n var currentState = root.current.memoizedState;\n return currentState.isDehydrated;\n}\n\nvar _attemptSynchronousHydration;\n\nfunction setAttemptSynchronousHydration(fn) {\n _attemptSynchronousHydration = fn;\n}\nfunction attemptSynchronousHydration(fiber) {\n _attemptSynchronousHydration(fiber);\n}\nvar attemptContinuousHydration;\nfunction setAttemptContinuousHydration(fn) {\n attemptContinuousHydration = fn;\n}\nvar attemptHydrationAtCurrentPriority;\nfunction setAttemptHydrationAtCurrentPriority(fn) {\n attemptHydrationAtCurrentPriority = fn;\n}\nvar getCurrentUpdatePriority$1;\nfunction setGetCurrentUpdatePriority(fn) {\n getCurrentUpdatePriority$1 = fn;\n}\nvar attemptHydrationAtPriority;\nfunction setAttemptHydrationAtPriority(fn) {\n attemptHydrationAtPriority = fn;\n} // TODO: Upgrade this definition once we're on a newer version of Flow that\n// has this definition built-in.\n\nvar hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.\n\nvar queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.\n// if the last target was dehydrated.\n\nvar queuedFocus = null;\nvar queuedDrag = null;\nvar queuedMouse = null; // For pointer events there can be one latest event per pointerId.\n\nvar queuedPointers = new Map();\nvar queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.\n\nvar queuedExplicitHydrationTargets = [];\nvar discreteReplayableEvents = ['mousedown', 'mouseup', 'touchcancel', 'touchend', 'touchstart', 'auxclick', 'dblclick', 'pointercancel', 'pointerdown', 'pointerup', 'dragend', 'dragstart', 'drop', 'compositionend', 'compositionstart', 'keydown', 'keypress', 'keyup', 'input', 'textInput', // Intentionally camelCase\n'copy', 'cut', 'paste', 'click', 'change', 'contextmenu', 'reset', 'submit'];\nfunction isDiscreteEventThatRequiresHydration(eventType) {\n return discreteReplayableEvents.indexOf(eventType) > -1;\n}\n\nfunction createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n return {\n blockedOn: blockedOn,\n domEventName: domEventName,\n eventSystemFlags: eventSystemFlags,\n nativeEvent: nativeEvent,\n targetContainers: [targetContainer]\n };\n}\n\nfunction clearIfContinuousEvent(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'focusin':\n case 'focusout':\n queuedFocus = null;\n break;\n\n case 'dragenter':\n case 'dragleave':\n queuedDrag = null;\n break;\n\n case 'mouseover':\n case 'mouseout':\n queuedMouse = null;\n break;\n\n case 'pointerover':\n case 'pointerout':\n {\n var pointerId = nativeEvent.pointerId;\n queuedPointers.delete(pointerId);\n break;\n }\n\n case 'gotpointercapture':\n case 'lostpointercapture':\n {\n var _pointerId = nativeEvent.pointerId;\n queuedPointerCaptures.delete(_pointerId);\n break;\n }\n }\n}\n\nfunction accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {\n var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);\n\n if (blockedOn !== null) {\n var _fiber2 = getInstanceFromNode(blockedOn);\n\n if (_fiber2 !== null) {\n // Attempt to increase the priority of this target.\n attemptContinuousHydration(_fiber2);\n }\n }\n\n return queuedEvent;\n } // If we have already queued this exact event, then it's because\n // the different event systems have different DOM event listeners.\n // We can accumulate the flags, and the targetContainers, and\n // store a single event to be replayed.\n\n\n existingQueuedEvent.eventSystemFlags |= eventSystemFlags;\n var targetContainers = existingQueuedEvent.targetContainers;\n\n if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {\n targetContainers.push(targetContainer);\n }\n\n return existingQueuedEvent;\n}\n\nfunction queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n // These set relatedTarget to null because the replayed event will be treated as if we\n // moved from outside the window (no target) onto the target once it hydrates.\n // Instead of mutating we could clone the event.\n switch (domEventName) {\n case 'focusin':\n {\n var focusEvent = nativeEvent;\n queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);\n return true;\n }\n\n case 'dragenter':\n {\n var dragEvent = nativeEvent;\n queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);\n return true;\n }\n\n case 'mouseover':\n {\n var mouseEvent = nativeEvent;\n queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);\n return true;\n }\n\n case 'pointerover':\n {\n var pointerEvent = nativeEvent;\n var pointerId = pointerEvent.pointerId;\n queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));\n return true;\n }\n\n case 'gotpointercapture':\n {\n var _pointerEvent = nativeEvent;\n var _pointerId2 = _pointerEvent.pointerId;\n queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));\n return true;\n }\n }\n\n return false;\n} // Check if this target is unblocked. Returns true if it's unblocked.\n\nfunction attemptExplicitHydrationTarget(queuedTarget) {\n // TODO: This function shares a lot of logic with findInstanceBlockingEvent.\n // Try to unify them. It's a bit tricky since it would require two return\n // values.\n var targetInst = getClosestInstanceFromNode(queuedTarget.target);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted !== null) {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n // We're blocked on hydrating this boundary.\n // Increase its priority.\n queuedTarget.blockedOn = instance;\n attemptHydrationAtPriority(queuedTarget.priority, function () {\n attemptHydrationAtCurrentPriority(nearestMounted);\n });\n return;\n }\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (isRootDehydrated(root)) {\n queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of\n // a root other than sync.\n\n return;\n }\n }\n }\n }\n\n queuedTarget.blockedOn = null;\n}\n\nfunction queueExplicitHydrationTarget(target) {\n // TODO: This will read the priority if it's dispatched by the React\n // event system but not native events. Should read window.event.type, like\n // we do for updates (getCurrentEventPriority).\n var updatePriority = getCurrentUpdatePriority$1();\n var queuedTarget = {\n blockedOn: null,\n target: target,\n priority: updatePriority\n };\n var i = 0;\n\n for (; i < queuedExplicitHydrationTargets.length; i++) {\n // Stop once we hit the first target with lower priority than\n if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i].priority)) {\n break;\n }\n }\n\n queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);\n\n if (i === 0) {\n attemptExplicitHydrationTarget(queuedTarget);\n }\n}\n\nfunction attemptReplayContinuousQueuedEvent(queuedEvent) {\n if (queuedEvent.blockedOn !== null) {\n return false;\n }\n\n var targetContainers = queuedEvent.targetContainers;\n\n while (targetContainers.length > 0) {\n var targetContainer = targetContainers[0];\n var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);\n\n if (nextBlockedOn === null) {\n {\n var nativeEvent = queuedEvent.nativeEvent;\n var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent);\n setReplayingEvent(nativeEventClone);\n nativeEvent.target.dispatchEvent(nativeEventClone);\n resetReplayingEvent();\n }\n } else {\n // We're still blocked. Try again later.\n var _fiber3 = getInstanceFromNode(nextBlockedOn);\n\n if (_fiber3 !== null) {\n attemptContinuousHydration(_fiber3);\n }\n\n queuedEvent.blockedOn = nextBlockedOn;\n return false;\n } // This target container was successfully dispatched. Try the next.\n\n\n targetContainers.shift();\n }\n\n return true;\n}\n\nfunction attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {\n if (attemptReplayContinuousQueuedEvent(queuedEvent)) {\n map.delete(key);\n }\n}\n\nfunction replayUnblockedEvents() {\n hasScheduledReplayAttempt = false;\n\n\n if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {\n queuedFocus = null;\n }\n\n if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {\n queuedDrag = null;\n }\n\n if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {\n queuedMouse = null;\n }\n\n queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);\n queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);\n}\n\nfunction scheduleCallbackIfUnblocked(queuedEvent, unblocked) {\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n\n if (!hasScheduledReplayAttempt) {\n hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are\n // now unblocked. This first might not actually be unblocked yet.\n // We could check it early to avoid scheduling an unnecessary callback.\n\n Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);\n }\n }\n}\n\nfunction retryIfBlockedOn(unblocked) {\n // Mark anything that was blocked on this as no longer blocked\n // and eligible for a replay.\n if (queuedDiscreteEvents.length > 0) {\n scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's\n // worth it because we expect very few discrete events to queue up and once\n // we are actually fully unblocked it will be fast to replay them.\n\n for (var i = 1; i < queuedDiscreteEvents.length; i++) {\n var queuedEvent = queuedDiscreteEvents[i];\n\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n }\n }\n }\n\n if (queuedFocus !== null) {\n scheduleCallbackIfUnblocked(queuedFocus, unblocked);\n }\n\n if (queuedDrag !== null) {\n scheduleCallbackIfUnblocked(queuedDrag, unblocked);\n }\n\n if (queuedMouse !== null) {\n scheduleCallbackIfUnblocked(queuedMouse, unblocked);\n }\n\n var unblock = function (queuedEvent) {\n return scheduleCallbackIfUnblocked(queuedEvent, unblocked);\n };\n\n queuedPointers.forEach(unblock);\n queuedPointerCaptures.forEach(unblock);\n\n for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {\n var queuedTarget = queuedExplicitHydrationTargets[_i];\n\n if (queuedTarget.blockedOn === unblocked) {\n queuedTarget.blockedOn = null;\n }\n }\n\n while (queuedExplicitHydrationTargets.length > 0) {\n var nextExplicitTarget = queuedExplicitHydrationTargets[0];\n\n if (nextExplicitTarget.blockedOn !== null) {\n // We're still blocked.\n break;\n } else {\n attemptExplicitHydrationTarget(nextExplicitTarget);\n\n if (nextExplicitTarget.blockedOn === null) {\n // We're unblocked.\n queuedExplicitHydrationTargets.shift();\n }\n }\n }\n}\n\nvar ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; // TODO: can we stop exporting these?\n\nvar _enabled = true; // This is exported in FB builds for use by legacy FB layer infra.\n// We'd like to remove this but it's not clear if this is safe.\n\nfunction setEnabled(enabled) {\n _enabled = !!enabled;\n}\nfunction isEnabled() {\n return _enabled;\n}\nfunction createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {\n var eventPriority = getEventPriority(domEventName);\n var listenerWrapper;\n\n switch (eventPriority) {\n case DiscreteEventPriority:\n listenerWrapper = dispatchDiscreteEvent;\n break;\n\n case ContinuousEventPriority:\n listenerWrapper = dispatchContinuousEvent;\n break;\n\n case DefaultEventPriority:\n default:\n listenerWrapper = dispatchEvent;\n break;\n }\n\n return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);\n}\n\nfunction dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {\n var previousPriority = getCurrentUpdatePriority();\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = null;\n\n try {\n setCurrentUpdatePriority(DiscreteEventPriority);\n dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);\n } finally {\n setCurrentUpdatePriority(previousPriority);\n ReactCurrentBatchConfig.transition = prevTransition;\n }\n}\n\nfunction dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {\n var previousPriority = getCurrentUpdatePriority();\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = null;\n\n try {\n setCurrentUpdatePriority(ContinuousEventPriority);\n dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);\n } finally {\n setCurrentUpdatePriority(previousPriority);\n ReactCurrentBatchConfig.transition = prevTransition;\n }\n}\n\nfunction dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n if (!_enabled) {\n return;\n }\n\n {\n dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent);\n }\n}\n\nfunction dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);\n\n if (blockedOn === null) {\n dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);\n clearIfContinuousEvent(domEventName, nativeEvent);\n return;\n }\n\n if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {\n nativeEvent.stopPropagation();\n return;\n } // We need to clear only if we didn't queue because\n // queueing is accumulative.\n\n\n clearIfContinuousEvent(domEventName, nativeEvent);\n\n if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) {\n while (blockedOn !== null) {\n var fiber = getInstanceFromNode(blockedOn);\n\n if (fiber !== null) {\n attemptSynchronousHydration(fiber);\n }\n\n var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);\n\n if (nextBlockedOn === null) {\n dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);\n }\n\n if (nextBlockedOn === blockedOn) {\n break;\n }\n\n blockedOn = nextBlockedOn;\n }\n\n if (blockedOn !== null) {\n nativeEvent.stopPropagation();\n }\n\n return;\n } // This is not replayable so we'll invoke it but without a target,\n // in case the event system needs to trace it.\n\n\n dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);\n}\n\nvar return_targetInst = null; // Returns a SuspenseInstance or Container if it's blocked.\n// The return_targetInst field above is conceptually part of the return value.\n\nfunction findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n // TODO: Warn if _enabled is false.\n return_targetInst = null;\n var nativeEventTarget = getEventTarget(nativeEvent);\n var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted === null) {\n // This tree has been unmounted already. Dispatch without a target.\n targetInst = null;\n } else {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n // Queue the event to be replayed later. Abort dispatching since we\n // don't want this event dispatched twice through the event system.\n // TODO: If this is the first discrete event in the queue. Schedule an increased\n // priority for this boundary.\n return instance;\n } // This shouldn't happen, something went wrong but to avoid blocking\n // the whole system, dispatch the event without a target.\n // TODO: Warn.\n\n\n targetInst = null;\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (isRootDehydrated(root)) {\n // If this happens during a replay something went wrong and it might block\n // the whole system.\n return getContainerFromFiber(nearestMounted);\n }\n\n targetInst = null;\n } else if (nearestMounted !== targetInst) {\n // If we get an event (ex: img onload) before committing that\n // component's mount, ignore it for now (that is, treat it as if it was an\n // event on a non-React tree). We might also consider queueing events and\n // dispatching them after the mount.\n targetInst = null;\n }\n }\n }\n\n return_targetInst = targetInst; // We're not blocked on anything.\n\n return null;\n}\nfunction getEventPriority(domEventName) {\n switch (domEventName) {\n // Used by SimpleEventPlugin:\n case 'cancel':\n case 'click':\n case 'close':\n case 'contextmenu':\n case 'copy':\n case 'cut':\n case 'auxclick':\n case 'dblclick':\n case 'dragend':\n case 'dragstart':\n case 'drop':\n case 'focusin':\n case 'focusout':\n case 'input':\n case 'invalid':\n case 'keydown':\n case 'keypress':\n case 'keyup':\n case 'mousedown':\n case 'mouseup':\n case 'paste':\n case 'pause':\n case 'play':\n case 'pointercancel':\n case 'pointerdown':\n case 'pointerup':\n case 'ratechange':\n case 'reset':\n case 'resize':\n case 'seeked':\n case 'submit':\n case 'touchcancel':\n case 'touchend':\n case 'touchstart':\n case 'volumechange': // Used by polyfills:\n // eslint-disable-next-line no-fallthrough\n\n case 'change':\n case 'selectionchange':\n case 'textInput':\n case 'compositionstart':\n case 'compositionend':\n case 'compositionupdate': // Only enableCreateEventHandleAPI:\n // eslint-disable-next-line no-fallthrough\n\n case 'beforeblur':\n case 'afterblur': // Not used by React but could be by user code:\n // eslint-disable-next-line no-fallthrough\n\n case 'beforeinput':\n case 'blur':\n case 'fullscreenchange':\n case 'focus':\n case 'hashchange':\n case 'popstate':\n case 'select':\n case 'selectstart':\n return DiscreteEventPriority;\n\n case 'drag':\n case 'dragenter':\n case 'dragexit':\n case 'dragleave':\n case 'dragover':\n case 'mousemove':\n case 'mouseout':\n case 'mouseover':\n case 'pointermove':\n case 'pointerout':\n case 'pointerover':\n case 'scroll':\n case 'toggle':\n case 'touchmove':\n case 'wheel': // Not used by React but could be by user code:\n // eslint-disable-next-line no-fallthrough\n\n case 'mouseenter':\n case 'mouseleave':\n case 'pointerenter':\n case 'pointerleave':\n return ContinuousEventPriority;\n\n case 'message':\n {\n // We might be in the Scheduler callback.\n // Eventually this mechanism will be replaced by a check\n // of the current priority on the native scheduler.\n var schedulerPriority = getCurrentPriorityLevel();\n\n switch (schedulerPriority) {\n case ImmediatePriority:\n return DiscreteEventPriority;\n\n case UserBlockingPriority:\n return ContinuousEventPriority;\n\n case NormalPriority:\n case LowPriority:\n // TODO: Handle LowSchedulerPriority, somehow. Maybe the same lane as hydration.\n return DefaultEventPriority;\n\n case IdlePriority:\n return IdleEventPriority;\n\n default:\n return DefaultEventPriority;\n }\n }\n\n default:\n return DefaultEventPriority;\n }\n}\n\nfunction addEventBubbleListener(target, eventType, listener) {\n target.addEventListener(eventType, listener, false);\n return listener;\n}\nfunction addEventCaptureListener(target, eventType, listener) {\n target.addEventListener(eventType, listener, true);\n return listener;\n}\nfunction addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {\n target.addEventListener(eventType, listener, {\n capture: true,\n passive: passive\n });\n return listener;\n}\nfunction addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {\n target.addEventListener(eventType, listener, {\n passive: passive\n });\n return listener;\n}\n\n/**\n * These variables store information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n *\n */\nvar root = null;\nvar startText = null;\nvar fallbackText = null;\nfunction initialize(nativeEventTarget) {\n root = nativeEventTarget;\n startText = getText();\n return true;\n}\nfunction reset() {\n root = null;\n startText = null;\n fallbackText = null;\n}\nfunction getData() {\n if (fallbackText) {\n return fallbackText;\n }\n\n var start;\n var startValue = startText;\n var startLength = startValue.length;\n var end;\n var endValue = getText();\n var endLength = endValue.length;\n\n for (start = 0; start < startLength; start++) {\n if (startValue[start] !== endValue[start]) {\n break;\n }\n }\n\n var minEnd = startLength - start;\n\n for (end = 1; end <= minEnd; end++) {\n if (startValue[startLength - end] !== endValue[endLength - end]) {\n break;\n }\n }\n\n var sliceTail = end > 1 ? 1 - end : undefined;\n fallbackText = endValue.slice(start, sliceTail);\n return fallbackText;\n}\nfunction getText() {\n if ('value' in root) {\n return root.value;\n }\n\n return root.textContent;\n}\n\n/**\n * `charCode` represents the actual \"character code\" and is safe to use with\n * `String.fromCharCode`. As such, only keys that correspond to printable\n * characters produce a valid `charCode`, the only exception to this is Enter.\n * The Tab-key is considered non-printable and does not have a `charCode`,\n * presumably because it does not produce a tab-character in browsers.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {number} Normalized `charCode` property.\n */\nfunction getEventCharCode(nativeEvent) {\n var charCode;\n var keyCode = nativeEvent.keyCode;\n\n if ('charCode' in nativeEvent) {\n charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.\n\n if (charCode === 0 && keyCode === 13) {\n charCode = 13;\n }\n } else {\n // IE8 does not implement `charCode`, but `keyCode` has the correct value.\n charCode = keyCode;\n } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)\n // report Enter as charCode 10 when ctrl is pressed.\n\n\n if (charCode === 10) {\n charCode = 13;\n } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.\n // Must not discard the (non-)printable Enter-key.\n\n\n if (charCode >= 32 || charCode === 13) {\n return charCode;\n }\n\n return 0;\n}\n\nfunction functionThatReturnsTrue() {\n return true;\n}\n\nfunction functionThatReturnsFalse() {\n return false;\n} // This is intentionally a factory so that we have different returned constructors.\n// If we had a single constructor, it would be megamorphic and engines would deopt.\n\n\nfunction createSyntheticEvent(Interface) {\n /**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n */\n function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {\n this._reactName = reactName;\n this._targetInst = targetInst;\n this.type = reactEventType;\n this.nativeEvent = nativeEvent;\n this.target = nativeEventTarget;\n this.currentTarget = null;\n\n for (var _propName in Interface) {\n if (!Interface.hasOwnProperty(_propName)) {\n continue;\n }\n\n var normalize = Interface[_propName];\n\n if (normalize) {\n this[_propName] = normalize(nativeEvent);\n } else {\n this[_propName] = nativeEvent[_propName];\n }\n }\n\n var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n\n if (defaultPrevented) {\n this.isDefaultPrevented = functionThatReturnsTrue;\n } else {\n this.isDefaultPrevented = functionThatReturnsFalse;\n }\n\n this.isPropagationStopped = functionThatReturnsFalse;\n return this;\n }\n\n assign(SyntheticBaseEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = true;\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.preventDefault) {\n event.preventDefault(); // $FlowFixMe - flow is not aware of `unknown` in IE\n } else if (typeof event.returnValue !== 'unknown') {\n event.returnValue = false;\n }\n\n this.isDefaultPrevented = functionThatReturnsTrue;\n },\n stopPropagation: function () {\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation(); // $FlowFixMe - flow is not aware of `unknown` in IE\n } else if (typeof event.cancelBubble !== 'unknown') {\n // The ChangeEventPlugin registers a \"propertychange\" event for\n // IE. This event does not support bubbling or cancelling, and\n // any references to cancelBubble throw \"Member not found\". A\n // typeof check of \"unknown\" circumvents this issue (and is also\n // IE specific).\n event.cancelBubble = true;\n }\n\n this.isPropagationStopped = functionThatReturnsTrue;\n },\n\n /**\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\n * them back into the pool. This allows a way to hold onto a reference that\n * won't be added back into the pool.\n */\n persist: function () {// Modern event system doesn't use pooling.\n },\n\n /**\n * Checks if this event should be released back into the pool.\n *\n * @return {boolean} True if this should not be released, false otherwise.\n */\n isPersistent: functionThatReturnsTrue\n });\n return SyntheticBaseEvent;\n}\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\n\nvar EventInterface = {\n eventPhase: 0,\n bubbles: 0,\n cancelable: 0,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: 0,\n isTrusted: 0\n};\nvar SyntheticEvent = createSyntheticEvent(EventInterface);\n\nvar UIEventInterface = assign({}, EventInterface, {\n view: 0,\n detail: 0\n});\n\nvar SyntheticUIEvent = createSyntheticEvent(UIEventInterface);\nvar lastMovementX;\nvar lastMovementY;\nvar lastMouseEvent;\n\nfunction updateMouseMovementPolyfillState(event) {\n if (event !== lastMouseEvent) {\n if (lastMouseEvent && event.type === 'mousemove') {\n lastMovementX = event.screenX - lastMouseEvent.screenX;\n lastMovementY = event.screenY - lastMouseEvent.screenY;\n } else {\n lastMovementX = 0;\n lastMovementY = 0;\n }\n\n lastMouseEvent = event;\n }\n}\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\n\nvar MouseEventInterface = assign({}, UIEventInterface, {\n screenX: 0,\n screenY: 0,\n clientX: 0,\n clientY: 0,\n pageX: 0,\n pageY: 0,\n ctrlKey: 0,\n shiftKey: 0,\n altKey: 0,\n metaKey: 0,\n getModifierState: getEventModifierState,\n button: 0,\n buttons: 0,\n relatedTarget: function (event) {\n if (event.relatedTarget === undefined) return event.fromElement === event.srcElement ? event.toElement : event.fromElement;\n return event.relatedTarget;\n },\n movementX: function (event) {\n if ('movementX' in event) {\n return event.movementX;\n }\n\n updateMouseMovementPolyfillState(event);\n return lastMovementX;\n },\n movementY: function (event) {\n if ('movementY' in event) {\n return event.movementY;\n } // Don't need to call updateMouseMovementPolyfillState() here\n // because it's guaranteed to have already run when movementX\n // was copied.\n\n\n return lastMovementY;\n }\n});\n\nvar SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);\n/**\n * @interface DragEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar DragEventInterface = assign({}, MouseEventInterface, {\n dataTransfer: 0\n});\n\nvar SyntheticDragEvent = createSyntheticEvent(DragEventInterface);\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar FocusEventInterface = assign({}, UIEventInterface, {\n relatedTarget: 0\n});\n\nvar SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent\n */\n\nvar AnimationEventInterface = assign({}, EventInterface, {\n animationName: 0,\n elapsedTime: 0,\n pseudoElement: 0\n});\n\nvar SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\n\nvar ClipboardEventInterface = assign({}, EventInterface, {\n clipboardData: function (event) {\n return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n }\n});\n\nvar SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\n\nvar CompositionEventInterface = assign({}, EventInterface, {\n data: 0\n});\n\nvar SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\n * /#events-inputevents\n */\n// Happens to share the same list for now.\n\nvar SyntheticInputEvent = SyntheticCompositionEvent;\n/**\n * Normalization of deprecated HTML5 `key` values\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\n\nvar normalizeKey = {\n Esc: 'Escape',\n Spacebar: ' ',\n Left: 'ArrowLeft',\n Up: 'ArrowUp',\n Right: 'ArrowRight',\n Down: 'ArrowDown',\n Del: 'Delete',\n Win: 'OS',\n Menu: 'ContextMenu',\n Apps: 'ContextMenu',\n Scroll: 'ScrollLock',\n MozPrintableKey: 'Unidentified'\n};\n/**\n * Translation from legacy `keyCode` to HTML5 `key`\n * Only special keys supported, all others depend on keyboard layout or browser\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\n\nvar translateToKey = {\n '8': 'Backspace',\n '9': 'Tab',\n '12': 'Clear',\n '13': 'Enter',\n '16': 'Shift',\n '17': 'Control',\n '18': 'Alt',\n '19': 'Pause',\n '20': 'CapsLock',\n '27': 'Escape',\n '32': ' ',\n '33': 'PageUp',\n '34': 'PageDown',\n '35': 'End',\n '36': 'Home',\n '37': 'ArrowLeft',\n '38': 'ArrowUp',\n '39': 'ArrowRight',\n '40': 'ArrowDown',\n '45': 'Insert',\n '46': 'Delete',\n '112': 'F1',\n '113': 'F2',\n '114': 'F3',\n '115': 'F4',\n '116': 'F5',\n '117': 'F6',\n '118': 'F7',\n '119': 'F8',\n '120': 'F9',\n '121': 'F10',\n '122': 'F11',\n '123': 'F12',\n '144': 'NumLock',\n '145': 'ScrollLock',\n '224': 'Meta'\n};\n/**\n * @param {object} nativeEvent Native browser event.\n * @return {string} Normalized `key` property.\n */\n\nfunction getEventKey(nativeEvent) {\n if (nativeEvent.key) {\n // Normalize inconsistent values reported by browsers due to\n // implementations of a working draft specification.\n // FireFox implements `key` but returns `MozPrintableKey` for all\n // printable characters (normalized to `Unidentified`), ignore it.\n var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n\n if (key !== 'Unidentified') {\n return key;\n }\n } // Browser does not implement `key`, polyfill as much of it as we can.\n\n\n if (nativeEvent.type === 'keypress') {\n var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can\n // thus be captured by `keypress`, no other non-printable key should.\n\n return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);\n }\n\n if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n // While user keyboard layout determines the actual meaning of each\n // `keyCode` value, almost all function keys have a universal value.\n return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n }\n\n return '';\n}\n/**\n * Translation from modifier key to the associated property in the event.\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers\n */\n\n\nvar modifierKeyToProp = {\n Alt: 'altKey',\n Control: 'ctrlKey',\n Meta: 'metaKey',\n Shift: 'shiftKey'\n}; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support\n// getModifierState. If getModifierState is not supported, we map it to a set of\n// modifier keys exposed by the event. In this case, Lock-keys are not supported.\n\nfunction modifierStateGetter(keyArg) {\n var syntheticEvent = this;\n var nativeEvent = syntheticEvent.nativeEvent;\n\n if (nativeEvent.getModifierState) {\n return nativeEvent.getModifierState(keyArg);\n }\n\n var keyProp = modifierKeyToProp[keyArg];\n return keyProp ? !!nativeEvent[keyProp] : false;\n}\n\nfunction getEventModifierState(nativeEvent) {\n return modifierStateGetter;\n}\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\n\nvar KeyboardEventInterface = assign({}, UIEventInterface, {\n key: getEventKey,\n code: 0,\n location: 0,\n ctrlKey: 0,\n shiftKey: 0,\n altKey: 0,\n metaKey: 0,\n repeat: 0,\n locale: 0,\n getModifierState: getEventModifierState,\n // Legacy Interface\n charCode: function (event) {\n // `charCode` is the result of a KeyPress event and represents the value of\n // the actual printable character.\n // KeyPress is deprecated, but its replacement is not yet final and not\n // implemented in any major browser. Only KeyPress has charCode.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n return 0;\n },\n keyCode: function (event) {\n // `keyCode` is the result of a KeyDown/Up event and represents the value of\n // physical keyboard key.\n // The actual meaning of the value depends on the users' keyboard layout\n // which cannot be detected. Assuming that it is a US keyboard layout\n // provides a surprisingly accurate mapping for US and European users.\n // Due to this, it is left to the user to implement at this time.\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n },\n which: function (event) {\n // `which` is an alias for either `keyCode` or `charCode` depending on the\n // type of the event.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n }\n});\n\nvar SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);\n/**\n * @interface PointerEvent\n * @see http://www.w3.org/TR/pointerevents/\n */\n\nvar PointerEventInterface = assign({}, MouseEventInterface, {\n pointerId: 0,\n width: 0,\n height: 0,\n pressure: 0,\n tangentialPressure: 0,\n tiltX: 0,\n tiltY: 0,\n twist: 0,\n pointerType: 0,\n isPrimary: 0\n});\n\nvar SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\n\nvar TouchEventInterface = assign({}, UIEventInterface, {\n touches: 0,\n targetTouches: 0,\n changedTouches: 0,\n altKey: 0,\n metaKey: 0,\n ctrlKey: 0,\n shiftKey: 0,\n getModifierState: getEventModifierState\n});\n\nvar SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent\n */\n\nvar TransitionEventInterface = assign({}, EventInterface, {\n propertyName: 0,\n elapsedTime: 0,\n pseudoElement: 0\n});\n\nvar SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar WheelEventInterface = assign({}, MouseEventInterface, {\n deltaX: function (event) {\n return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).\n 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;\n },\n deltaY: function (event) {\n return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).\n 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).\n 'wheelDelta' in event ? -event.wheelDelta : 0;\n },\n deltaZ: 0,\n // Browsers without \"deltaMode\" is reporting in raw wheel delta where one\n // notch on the scroll is always +/- 120, roughly equivalent to pixels.\n // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or\n // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.\n deltaMode: 0\n});\n\nvar SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);\n\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\n\nvar START_KEYCODE = 229;\nvar canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;\nvar documentMode = null;\n\nif (canUseDOM && 'documentMode' in document) {\n documentMode = document.documentMode;\n} // Webkit offers a very useful `textInput` event that can be used to\n// directly represent `beforeInput`. The IE `textinput` event is not as\n// useful, so we don't use it.\n\n\nvar canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied\n// by the native compositionend event may be incorrect. Japanese ideographic\n// spaces, for instance (\\u3000) are not recorded correctly.\n\nvar useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);\n\nfunction registerEvents() {\n registerTwoPhaseEvent('onBeforeInput', ['compositionend', 'keypress', 'textInput', 'paste']);\n registerTwoPhaseEvent('onCompositionEnd', ['compositionend', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n registerTwoPhaseEvent('onCompositionStart', ['compositionstart', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n registerTwoPhaseEvent('onCompositionUpdate', ['compositionupdate', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n} // Track whether we've ever handled a keypress on the space key.\n\n\nvar hasSpaceKeypress = false;\n/**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires `keypress` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n */\n\nfunction isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\n/**\n * Translate native top level events into event types.\n */\n\n\nfunction getCompositionEventType(domEventName) {\n switch (domEventName) {\n case 'compositionstart':\n return 'onCompositionStart';\n\n case 'compositionend':\n return 'onCompositionEnd';\n\n case 'compositionupdate':\n return 'onCompositionUpdate';\n }\n}\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n */\n\n\nfunction isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}\n/**\n * Does our fallback mode think that this event is the end of composition?\n */\n\n\nfunction isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n // Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}\n/**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the `data` property populated in the `detail` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n */\n\n\nfunction getDataFromCustomEvent(nativeEvent) {\n var detail = nativeEvent.detail;\n\n if (typeof detail === 'object' && 'data' in detail) {\n return detail.data;\n }\n\n return null;\n}\n/**\n * Check if a composition event was triggered by Korean IME.\n * Our fallback mode does not work well with IE's Korean IME,\n * so just use native composition events when Korean IME is used.\n * Although CompositionEvent.locale property is deprecated,\n * it is available in IE, where our fallback mode is enabled.\n *\n * @param {object} nativeEvent\n * @return {boolean}\n */\n\n\nfunction isUsingKoreanIME(nativeEvent) {\n return nativeEvent.locale === 'ko';\n} // Track the current IME composition status, if any.\n\n\nvar isComposing = false;\n/**\n * @return {?object} A SyntheticCompositionEvent.\n */\n\nfunction extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {\n var eventType;\n var fallbackData;\n\n if (canUseCompositionEvent) {\n eventType = getCompositionEventType(domEventName);\n } else if (!isComposing) {\n if (isFallbackCompositionStart(domEventName, nativeEvent)) {\n eventType = 'onCompositionStart';\n }\n } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {\n eventType = 'onCompositionEnd';\n }\n\n if (!eventType) {\n return null;\n }\n\n if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {\n // The current composition is stored statically and must not be\n // overwritten while composition continues.\n if (!isComposing && eventType === 'onCompositionStart') {\n isComposing = initialize(nativeEventTarget);\n } else if (eventType === 'onCompositionEnd') {\n if (isComposing) {\n fallbackData = getData();\n }\n }\n }\n\n var listeners = accumulateTwoPhaseListeners(targetInst, eventType);\n\n if (listeners.length > 0) {\n var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n\n if (fallbackData) {\n // Inject data generated from fallback path into the synthetic event.\n // This matches the property of native CompositionEventInterface.\n event.data = fallbackData;\n } else {\n var customData = getDataFromCustomEvent(nativeEvent);\n\n if (customData !== null) {\n event.data = customData;\n }\n }\n }\n}\n\nfunction getNativeBeforeInputChars(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'compositionend':\n return getDataFromCustomEvent(nativeEvent);\n\n case 'keypress':\n /**\n * If native `textInput` events are available, our goal is to make\n * use of them. However, there is a special case: the spacebar key.\n * In Webkit, preventing default on a spacebar `textInput` event\n * cancels character insertion, but it *also* causes the browser\n * to fall back to its default spacebar behavior of scrolling the\n * page.\n *\n * Tracking at:\n * https://code.google.com/p/chromium/issues/detail?id=355103\n *\n * To avoid this issue, use the keypress event as if no `textInput`\n * event is available.\n */\n var which = nativeEvent.which;\n\n if (which !== SPACEBAR_CODE) {\n return null;\n }\n\n hasSpaceKeypress = true;\n return SPACEBAR_CHAR;\n\n case 'textInput':\n // Record the characters to be added to the DOM.\n var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled\n // it at the keypress level and bail immediately. Android Chrome\n // doesn't give us keycodes, so we need to ignore it.\n\n if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n return null;\n }\n\n return chars;\n\n default:\n // For other native event types, do nothing.\n return null;\n }\n}\n/**\n * For browsers that do not provide the `textInput` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n */\n\n\nfunction getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}\n/**\n * Extract a SyntheticInputEvent for `beforeInput`, based on either native\n * `textInput` or fallback behavior.\n *\n * @return {?object} A SyntheticInputEvent.\n */\n\n\nfunction extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {\n var chars;\n\n if (canUseTextInputEvent) {\n chars = getNativeBeforeInputChars(domEventName, nativeEvent);\n } else {\n chars = getFallbackBeforeInputChars(domEventName, nativeEvent);\n } // If no characters are being inserted, no BeforeInput event should\n // be fired.\n\n\n if (!chars) {\n return null;\n }\n\n var listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput');\n\n if (listeners.length > 0) {\n var event = new SyntheticInputEvent('onBeforeInput', 'beforeinput', null, nativeEvent, nativeEventTarget);\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n event.data = chars;\n }\n}\n/**\n * Create an `onBeforeInput` event to match\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\n *\n * This event plugin is based on the native `textInput` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * `onKeyPress` and `onCompositionEnd`, but before `onInput`.\n *\n * `beforeInput` is spec'd but not implemented in any browsers, and\n * the `input` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, `textInput` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting `composition` events, thus\n * allowing us to share composition fallback code for both `beforeInput` and\n * `composition` event types.\n */\n\n\nfunction extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n}\n\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\nvar supportedInputTypes = {\n color: true,\n date: true,\n datetime: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n password: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true\n};\n\nfunction isTextInputElement(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n\n if (nodeName === 'input') {\n return !!supportedInputTypes[elem.type];\n }\n\n if (nodeName === 'textarea') {\n return true;\n }\n\n return false;\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as `change`,\n * `reset`, `load`, `error`, and `select`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \"click\".\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\n\nfunction isEventSupported(eventNameSuffix) {\n if (!canUseDOM) {\n return false;\n }\n\n var eventName = 'on' + eventNameSuffix;\n var isSupported = (eventName in document);\n\n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n\n return isSupported;\n}\n\nfunction registerEvents$1() {\n registerTwoPhaseEvent('onChange', ['change', 'click', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'selectionchange']);\n}\n\nfunction createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {\n // Flag this event loop as needing state restore.\n enqueueStateRestore(target);\n var listeners = accumulateTwoPhaseListeners(inst, 'onChange');\n\n if (listeners.length > 0) {\n var event = new SyntheticEvent('onChange', 'change', null, nativeEvent, target);\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n }\n}\n/**\n * For IE shims\n */\n\n\nvar activeElement = null;\nvar activeElementInst = null;\n/**\n * SECTION: handle `change` event\n */\n\nfunction shouldUseChangeEvent(elem) {\n var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n}\n\nfunction manualDispatchChangeEvent(nativeEvent) {\n var dispatchQueue = [];\n createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the\n // other events and have it go through ReactBrowserEventEmitter. Since it\n // doesn't, we manually listen for the events and so we have to enqueue and\n // process the abstract event manually.\n //\n // Batching is necessary here in order to ensure that all event handlers run\n // before the next rerender (including event handlers attached to ancestor\n // elements instead of directly on the input). Without this, controlled\n // components don't work properly in conjunction with event bubbling because\n // the component is rerendered and the value reverted before all the event\n // handlers can run. See https://github.com/facebook/react/issues/708.\n\n batchedUpdates(runEventInBatch, dispatchQueue);\n}\n\nfunction runEventInBatch(dispatchQueue) {\n processDispatchQueue(dispatchQueue, 0);\n}\n\nfunction getInstIfValueChanged(targetInst) {\n var targetNode = getNodeFromInstance(targetInst);\n\n if (updateValueIfChanged(targetNode)) {\n return targetInst;\n }\n}\n\nfunction getTargetInstForChangeEvent(domEventName, targetInst) {\n if (domEventName === 'change') {\n return targetInst;\n }\n}\n/**\n * SECTION: handle `input` event\n */\n\n\nvar isInputEventSupported = false;\n\nif (canUseDOM) {\n // IE9 claims to support the input event but fails to trigger it when\n // deleting text, so we ignore its input events.\n isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);\n}\n/**\n * (For IE <=9) Starts tracking propertychange events on the passed-in element\n * and override the value property so that we can distinguish user events from\n * value changes in JS.\n */\n\n\nfunction startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}\n/**\n * (For IE <=9) Removes the event listeners from the currently-tracked element,\n * if any exists.\n */\n\n\nfunction stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}\n/**\n * (For IE <=9) Handles a propertychange event, sending a `change` event if\n * the value of the active element has changed.\n */\n\n\nfunction handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}\n\nfunction handleEventsForInputEventPolyfill(domEventName, target, targetInst) {\n if (domEventName === 'focusin') {\n // In IE9, propertychange fires for most input events but is buggy and\n // doesn't fire when text is deleted, but conveniently, selectionchange\n // appears to fire in all of the remaining cases so we catch those and\n // forward the event if the value has changed\n // In either case, we don't want to call the event handler if the value\n // is changed from JS so we redefine a setter for `.value` that updates\n // our activeElementValue variable, allowing us to ignore those changes\n //\n // stopWatching() should be a noop here but we call it just in case we\n // missed a blur event somehow.\n stopWatchingForValueChange();\n startWatchingForValueChange(target, targetInst);\n } else if (domEventName === 'focusout') {\n stopWatchingForValueChange();\n }\n} // For IE8 and IE9.\n\n\nfunction getTargetInstForInputEventPolyfill(domEventName, targetInst) {\n if (domEventName === 'selectionchange' || domEventName === 'keyup' || domEventName === 'keydown') {\n // On the selectionchange event, the target is just document which isn't\n // helpful for us so just check activeElement instead.\n //\n // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n // propertychange on the first input event after setting `value` from a\n // script and fires only keydown, keypress, keyup. Catching keyup usually\n // gets it and catching keydown lets us fire an event for the first\n // keystroke if user does a key repeat (it'll be a little delayed: right\n // before the second keystroke). Other input methods (e.g., paste) seem to\n // fire selectionchange normally.\n return getInstIfValueChanged(activeElementInst);\n }\n}\n/**\n * SECTION: handle `click` event\n */\n\n\nfunction shouldUseClickEvent(elem) {\n // Use the `click` event to detect changes to checkbox and radio inputs.\n // This approach works across all browsers, whereas `change` does not fire\n // until `blur` in IE8.\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}\n\nfunction getTargetInstForClickEvent(domEventName, targetInst) {\n if (domEventName === 'click') {\n return getInstIfValueChanged(targetInst);\n }\n}\n\nfunction getTargetInstForInputOrChangeEvent(domEventName, targetInst) {\n if (domEventName === 'input' || domEventName === 'change') {\n return getInstIfValueChanged(targetInst);\n }\n}\n\nfunction handleControlledInputBlur(node) {\n var state = node._wrapperState;\n\n if (!state || !state.controlled || node.type !== 'number') {\n return;\n }\n\n {\n // If controlled, assign the value attribute to the current value on blur\n setDefaultValue(node, 'number', node.value);\n }\n}\n/**\n * This plugin creates an `onChange` event that normalizes change events\n * across form elements. This event fires at a time when it's possible to\n * change the element's value without seeing a flicker.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - select\n */\n\n\nfunction extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n var getTargetInstFunc, handleEventFunc;\n\n if (shouldUseChangeEvent(targetNode)) {\n getTargetInstFunc = getTargetInstForChangeEvent;\n } else if (isTextInputElement(targetNode)) {\n if (isInputEventSupported) {\n getTargetInstFunc = getTargetInstForInputOrChangeEvent;\n } else {\n getTargetInstFunc = getTargetInstForInputEventPolyfill;\n handleEventFunc = handleEventsForInputEventPolyfill;\n }\n } else if (shouldUseClickEvent(targetNode)) {\n getTargetInstFunc = getTargetInstForClickEvent;\n }\n\n if (getTargetInstFunc) {\n var inst = getTargetInstFunc(domEventName, targetInst);\n\n if (inst) {\n createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);\n return;\n }\n }\n\n if (handleEventFunc) {\n handleEventFunc(domEventName, targetNode, targetInst);\n } // When blurring, set the value attribute for number inputs\n\n\n if (domEventName === 'focusout') {\n handleControlledInputBlur(targetNode);\n }\n}\n\nfunction registerEvents$2() {\n registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']);\n registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']);\n registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']);\n registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']);\n}\n/**\n * For almost every interaction we care about, there will be both a top-level\n * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that\n * we do not extract duplicate events. However, moving the mouse into the\n * browser from outside will not fire a `mouseout` event. In this case, we use\n * the `mouseover` top-level event.\n */\n\n\nfunction extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n var isOverEvent = domEventName === 'mouseover' || domEventName === 'pointerover';\n var isOutEvent = domEventName === 'mouseout' || domEventName === 'pointerout';\n\n if (isOverEvent && !isReplayingEvent(nativeEvent)) {\n // If this is an over event with a target, we might have already dispatched\n // the event in the out event of the other target. If this is replayed,\n // then it's because we couldn't dispatch against this target previously\n // so we have to do it now instead.\n var related = nativeEvent.relatedTarget || nativeEvent.fromElement;\n\n if (related) {\n // If the related node is managed by React, we can assume that we have\n // already dispatched the corresponding events during its mouseout.\n if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {\n return;\n }\n }\n }\n\n if (!isOutEvent && !isOverEvent) {\n // Must not be a mouse or pointer in or out - ignoring.\n return;\n }\n\n var win; // TODO: why is this nullable in the types but we read from it?\n\n if (nativeEventTarget.window === nativeEventTarget) {\n // `nativeEventTarget` is probably a window object.\n win = nativeEventTarget;\n } else {\n // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.\n var doc = nativeEventTarget.ownerDocument;\n\n if (doc) {\n win = doc.defaultView || doc.parentWindow;\n } else {\n win = window;\n }\n }\n\n var from;\n var to;\n\n if (isOutEvent) {\n var _related = nativeEvent.relatedTarget || nativeEvent.toElement;\n\n from = targetInst;\n to = _related ? getClosestInstanceFromNode(_related) : null;\n\n if (to !== null) {\n var nearestMounted = getNearestMountedFiber(to);\n\n if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {\n to = null;\n }\n }\n } else {\n // Moving to a node from outside the window.\n from = null;\n to = targetInst;\n }\n\n if (from === to) {\n // Nothing pertains to our managed components.\n return;\n }\n\n var SyntheticEventCtor = SyntheticMouseEvent;\n var leaveEventType = 'onMouseLeave';\n var enterEventType = 'onMouseEnter';\n var eventTypePrefix = 'mouse';\n\n if (domEventName === 'pointerout' || domEventName === 'pointerover') {\n SyntheticEventCtor = SyntheticPointerEvent;\n leaveEventType = 'onPointerLeave';\n enterEventType = 'onPointerEnter';\n eventTypePrefix = 'pointer';\n }\n\n var fromNode = from == null ? win : getNodeFromInstance(from);\n var toNode = to == null ? win : getNodeFromInstance(to);\n var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + 'leave', from, nativeEvent, nativeEventTarget);\n leave.target = fromNode;\n leave.relatedTarget = toNode;\n var enter = null; // We should only process this nativeEvent if we are processing\n // the first ancestor. Next time, we will ignore the event.\n\n var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);\n\n if (nativeTargetInst === targetInst) {\n var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + 'enter', to, nativeEvent, nativeEventTarget);\n enterEvent.target = toNode;\n enterEvent.relatedTarget = fromNode;\n enter = enterEvent;\n }\n\n accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);\n}\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\n\nfunction shallowEqual(objA, objB) {\n if (objectIs(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n } // Test for A's keys different from B.\n\n\n for (var i = 0; i < keysA.length; i++) {\n var currentKey = keysA[i];\n\n if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n */\n\nfunction getLeafNode(node) {\n while (node && node.firstChild) {\n node = node.firstChild;\n }\n\n return node;\n}\n/**\n * Get the next sibling within a container. This will walk up the\n * DOM if a node's siblings have been exhausted.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {?DOMElement|DOMTextNode}\n */\n\n\nfunction getSiblingNode(node) {\n while (node) {\n if (node.nextSibling) {\n return node.nextSibling;\n }\n\n node = node.parentNode;\n }\n}\n/**\n * Get object describing the nodes which contain characters at offset.\n *\n * @param {DOMElement|DOMTextNode} root\n * @param {number} offset\n * @return {?object}\n */\n\n\nfunction getNodeForCharacterOffset(root, offset) {\n var node = getLeafNode(root);\n var nodeStart = 0;\n var nodeEnd = 0;\n\n while (node) {\n if (node.nodeType === TEXT_NODE) {\n nodeEnd = nodeStart + node.textContent.length;\n\n if (nodeStart <= offset && nodeEnd >= offset) {\n return {\n node: node,\n offset: offset - nodeStart\n };\n }\n\n nodeStart = nodeEnd;\n }\n\n node = getLeafNode(getSiblingNode(node));\n }\n}\n\n/**\n * @param {DOMElement} outerNode\n * @return {?object}\n */\n\nfunction getOffsets(outerNode) {\n var ownerDocument = outerNode.ownerDocument;\n var win = ownerDocument && ownerDocument.defaultView || window;\n var selection = win.getSelection && win.getSelection();\n\n if (!selection || selection.rangeCount === 0) {\n return null;\n }\n\n var anchorNode = selection.anchorNode,\n anchorOffset = selection.anchorOffset,\n focusNode = selection.focusNode,\n focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be \"anonymous divs\", e.g. the\n // up/down buttons on an <input type=\"number\">. Anonymous divs do not seem to\n // expose properties, triggering a \"Permission denied error\" if any of its\n // properties are accessed. The only seemingly possible way to avoid erroring\n // is to access a property that typically works for non-anonymous divs and\n // catch any error that may otherwise arise. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n\n try {\n /* eslint-disable no-unused-expressions */\n anchorNode.nodeType;\n focusNode.nodeType;\n /* eslint-enable no-unused-expressions */\n } catch (e) {\n return null;\n }\n\n return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);\n}\n/**\n * Returns {start, end} where `start` is the character/codepoint index of\n * (anchorNode, anchorOffset) within the textContent of `outerNode`, and\n * `end` is the index of (focusNode, focusOffset).\n *\n * Returns null if you pass in garbage input but we should probably just crash.\n *\n * Exported only for testing.\n */\n\nfunction getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {\n var length = 0;\n var start = -1;\n var end = -1;\n var indexWithinAnchor = 0;\n var indexWithinFocus = 0;\n var node = outerNode;\n var parentNode = null;\n\n outer: while (true) {\n var next = null;\n\n while (true) {\n if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {\n start = length + anchorOffset;\n }\n\n if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {\n end = length + focusOffset;\n }\n\n if (node.nodeType === TEXT_NODE) {\n length += node.nodeValue.length;\n }\n\n if ((next = node.firstChild) === null) {\n break;\n } // Moving from `node` to its first child `next`.\n\n\n parentNode = node;\n node = next;\n }\n\n while (true) {\n if (node === outerNode) {\n // If `outerNode` has children, this is always the second time visiting\n // it. If it has no children, this is still the first loop, and the only\n // valid selection is anchorNode and focusNode both equal to this node\n // and both offsets 0, in which case we will have handled above.\n break outer;\n }\n\n if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {\n start = length;\n }\n\n if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {\n end = length;\n }\n\n if ((next = node.nextSibling) !== null) {\n break;\n }\n\n node = parentNode;\n parentNode = node.parentNode;\n } // Moving from `node` to its next sibling `next`.\n\n\n node = next;\n }\n\n if (start === -1 || end === -1) {\n // This should never happen. (Would happen if the anchor/focus nodes aren't\n // actually inside the passed-in node.)\n return null;\n }\n\n return {\n start: start,\n end: end\n };\n}\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programmatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n *\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\n\nfunction setOffsets(node, offsets) {\n var doc = node.ownerDocument || document;\n var win = doc && doc.defaultView || window; // Edge fails with \"Object expected\" in some scenarios.\n // (For instance: TinyMCE editor used in a list component that supports pasting to add more,\n // fails when pasting 100+ items)\n\n if (!win.getSelection) {\n return;\n }\n\n var selection = win.getSelection();\n var length = node.textContent.length;\n var start = Math.min(offsets.start, length);\n var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.\n // Flip backward selections, so we can set with a single range.\n\n if (!selection.extend && start > end) {\n var temp = end;\n end = start;\n start = temp;\n }\n\n var startMarker = getNodeForCharacterOffset(node, start);\n var endMarker = getNodeForCharacterOffset(node, end);\n\n if (startMarker && endMarker) {\n if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {\n return;\n }\n\n var range = doc.createRange();\n range.setStart(startMarker.node, startMarker.offset);\n selection.removeAllRanges();\n\n if (start > end) {\n selection.addRange(range);\n selection.extend(endMarker.node, endMarker.offset);\n } else {\n range.setEnd(endMarker.node, endMarker.offset);\n selection.addRange(range);\n }\n }\n}\n\nfunction isTextNode(node) {\n return node && node.nodeType === TEXT_NODE;\n}\n\nfunction containsNode(outerNode, innerNode) {\n if (!outerNode || !innerNode) {\n return false;\n } else if (outerNode === innerNode) {\n return true;\n } else if (isTextNode(outerNode)) {\n return false;\n } else if (isTextNode(innerNode)) {\n return containsNode(outerNode, innerNode.parentNode);\n } else if ('contains' in outerNode) {\n return outerNode.contains(innerNode);\n } else if (outerNode.compareDocumentPosition) {\n return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n } else {\n return false;\n }\n}\n\nfunction isInDocument(node) {\n return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);\n}\n\nfunction isSameOriginFrame(iframe) {\n try {\n // Accessing the contentDocument of a HTMLIframeElement can cause the browser\n // to throw, e.g. if it has a cross-origin src attribute.\n // Safari will show an error in the console when the access results in \"Blocked a frame with origin\". e.g:\n // iframe.contentDocument.defaultView;\n // A safety way is to access one of the cross origin properties: Window or Location\n // Which might result in \"SecurityError\" DOM Exception and it is compatible to Safari.\n // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl\n return typeof iframe.contentWindow.location.href === 'string';\n } catch (err) {\n return false;\n }\n}\n\nfunction getActiveElementDeep() {\n var win = window;\n var element = getActiveElement();\n\n while (element instanceof win.HTMLIFrameElement) {\n if (isSameOriginFrame(element)) {\n win = element.contentWindow;\n } else {\n return element;\n }\n\n element = getActiveElement(win.document);\n }\n\n return element;\n}\n/**\n * @ReactInputSelection: React input selection module. Based on Selection.js,\n * but modified to be suitable for react and has a couple of bug fixes (doesn't\n * assume buttons have range selections allowed).\n * Input selection module for React.\n */\n\n/**\n * @hasSelectionCapabilities: we get the element types that support selection\n * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`\n * and `selectionEnd` rows.\n */\n\n\nfunction hasSelectionCapabilities(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');\n}\nfunction getSelectionInformation() {\n var focusedElem = getActiveElementDeep();\n return {\n focusedElem: focusedElem,\n selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null\n };\n}\n/**\n * @restoreSelection: If any selection information was potentially lost,\n * restore it. This is useful when performing operations that could remove dom\n * nodes and place them back in, resulting in focus being lost.\n */\n\nfunction restoreSelection(priorSelectionInformation) {\n var curFocusedElem = getActiveElementDeep();\n var priorFocusedElem = priorSelectionInformation.focusedElem;\n var priorSelectionRange = priorSelectionInformation.selectionRange;\n\n if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {\n if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {\n setSelection(priorFocusedElem, priorSelectionRange);\n } // Focusing a node can change the scroll position, which is undesirable\n\n\n var ancestors = [];\n var ancestor = priorFocusedElem;\n\n while (ancestor = ancestor.parentNode) {\n if (ancestor.nodeType === ELEMENT_NODE) {\n ancestors.push({\n element: ancestor,\n left: ancestor.scrollLeft,\n top: ancestor.scrollTop\n });\n }\n }\n\n if (typeof priorFocusedElem.focus === 'function') {\n priorFocusedElem.focus();\n }\n\n for (var i = 0; i < ancestors.length; i++) {\n var info = ancestors[i];\n info.element.scrollLeft = info.left;\n info.element.scrollTop = info.top;\n }\n }\n}\n/**\n * @getSelection: Gets the selection bounds of a focused textarea, input or\n * contentEditable node.\n * -@input: Look up selection bounds of this input\n * -@return {start: selectionStart, end: selectionEnd}\n */\n\nfunction getSelection(input) {\n var selection;\n\n if ('selectionStart' in input) {\n // Modern browser with input or textarea.\n selection = {\n start: input.selectionStart,\n end: input.selectionEnd\n };\n } else {\n // Content editable or old IE textarea.\n selection = getOffsets(input);\n }\n\n return selection || {\n start: 0,\n end: 0\n };\n}\n/**\n * @setSelection: Sets the selection bounds of a textarea or input and focuses\n * the input.\n * -@input Set selection bounds of this input or textarea\n * -@offsets Object of same form that is returned from get*\n */\n\nfunction setSelection(input, offsets) {\n var start = offsets.start;\n var end = offsets.end;\n\n if (end === undefined) {\n end = start;\n }\n\n if ('selectionStart' in input) {\n input.selectionStart = start;\n input.selectionEnd = Math.min(end, input.value.length);\n } else {\n setOffsets(input, offsets);\n }\n}\n\nvar skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;\n\nfunction registerEvents$3() {\n registerTwoPhaseEvent('onSelect', ['focusout', 'contextmenu', 'dragend', 'focusin', 'keydown', 'keyup', 'mousedown', 'mouseup', 'selectionchange']);\n}\n\nvar activeElement$1 = null;\nvar activeElementInst$1 = null;\nvar lastSelection = null;\nvar mouseDown = false;\n/**\n * Get an object which is a unique representation of the current selection.\n *\n * The return value will not be consistent across nodes or browsers, but\n * two identical selections on the same node will return identical objects.\n */\n\nfunction getSelection$1(node) {\n if ('selectionStart' in node && hasSelectionCapabilities(node)) {\n return {\n start: node.selectionStart,\n end: node.selectionEnd\n };\n } else {\n var win = node.ownerDocument && node.ownerDocument.defaultView || window;\n var selection = win.getSelection();\n return {\n anchorNode: selection.anchorNode,\n anchorOffset: selection.anchorOffset,\n focusNode: selection.focusNode,\n focusOffset: selection.focusOffset\n };\n }\n}\n/**\n * Get document associated with the event target.\n */\n\n\nfunction getEventTargetDocument(eventTarget) {\n return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;\n}\n/**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\n * @param {object} nativeEventTarget\n * @return {?SyntheticEvent}\n */\n\n\nfunction constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {\n // Ensure we have the right element, and that the user is not dragging a\n // selection (this matches native `select` event behavior). In HTML5, select\n // fires only on input and textarea thus if there's no focused element we\n // won't dispatch.\n var doc = getEventTargetDocument(nativeEventTarget);\n\n if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {\n return;\n } // Only fire when selection has actually changed.\n\n\n var currentSelection = getSelection$1(activeElement$1);\n\n if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {\n lastSelection = currentSelection;\n var listeners = accumulateTwoPhaseListeners(activeElementInst$1, 'onSelect');\n\n if (listeners.length > 0) {\n var event = new SyntheticEvent('onSelect', 'select', null, nativeEvent, nativeEventTarget);\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n event.target = activeElement$1;\n }\n }\n}\n/**\n * This plugin creates an `onSelect` event that normalizes select events\n * across form elements.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - contentEditable\n *\n * This differs from native browser implementations in the following ways:\n * - Fires on contentEditable fields as well as inputs.\n * - Fires for collapsed selection.\n * - Fires after user input.\n */\n\n\nfunction extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}\n\n/**\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\n *\n * @param {string} styleProp\n * @param {string} eventName\n * @returns {object}\n */\n\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n prefixes['Moz' + styleProp] = 'moz' + eventName;\n return prefixes;\n}\n/**\n * A list of event names to a configurable list of vendor prefixes.\n */\n\n\nvar vendorPrefixes = {\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\n animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\n animationstart: makePrefixMap('Animation', 'AnimationStart'),\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\n};\n/**\n * Event names that have already been detected and prefixed (if applicable).\n */\n\nvar prefixedEventNames = {};\n/**\n * Element to check for prefixes on.\n */\n\nvar style = {};\n/**\n * Bootstrap if a DOM exists.\n */\n\nif (canUseDOM) {\n style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,\n // the un-prefixed \"animation\" and \"transition\" properties are defined on the\n // style object but the events that fire will still be prefixed, so we need\n // to check if the un-prefixed events are usable, and if not remove them from the map.\n\n if (!('AnimationEvent' in window)) {\n delete vendorPrefixes.animationend.animation;\n delete vendorPrefixes.animationiteration.animation;\n delete vendorPrefixes.animationstart.animation;\n } // Same as above\n\n\n if (!('TransitionEvent' in window)) {\n delete vendorPrefixes.transitionend.transition;\n }\n}\n/**\n * Attempts to determine the correct vendor prefixed event name.\n *\n * @param {string} eventName\n * @returns {string}\n */\n\n\nfunction getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) {\n return prefixedEventNames[eventName];\n } else if (!vendorPrefixes[eventName]) {\n return eventName;\n }\n\n var prefixMap = vendorPrefixes[eventName];\n\n for (var styleProp in prefixMap) {\n if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n return prefixedEventNames[eventName] = prefixMap[styleProp];\n }\n }\n\n return eventName;\n}\n\nvar ANIMATION_END = getVendorPrefixedEventName('animationend');\nvar ANIMATION_ITERATION = getVendorPrefixedEventName('animationiteration');\nvar ANIMATION_START = getVendorPrefixedEventName('animationstart');\nvar TRANSITION_END = getVendorPrefixedEventName('transitionend');\n\nvar topLevelEventsToReactNames = new Map(); // NOTE: Capitalization is important in this list!\n//\n// E.g. it needs \"pointerDown\", not \"pointerdown\".\n// This is because we derive both React name (\"onPointerDown\")\n// and DOM name (\"pointerdown\") from the same list.\n//\n// Exceptions that don't match this convention are listed separately.\n//\n// prettier-ignore\n\nvar simpleEventPluginEvents = ['abort', 'auxClick', 'cancel', 'canPlay', 'canPlayThrough', 'click', 'close', 'contextMenu', 'copy', 'cut', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'gotPointerCapture', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'lostPointerCapture', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'pointerCancel', 'pointerDown', 'pointerMove', 'pointerOut', 'pointerOver', 'pointerUp', 'progress', 'rateChange', 'reset', 'resize', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchStart', 'volumeChange', 'scroll', 'toggle', 'touchMove', 'waiting', 'wheel'];\n\nfunction registerSimpleEvent(domEventName, reactName) {\n topLevelEventsToReactNames.set(domEventName, reactName);\n registerTwoPhaseEvent(reactName, [domEventName]);\n}\n\nfunction registerSimpleEvents() {\n for (var i = 0; i < simpleEventPluginEvents.length; i++) {\n var eventName = simpleEventPluginEvents[i];\n var domEventName = eventName.toLowerCase();\n var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1);\n registerSimpleEvent(domEventName, 'on' + capitalizedEvent);\n } // Special cases where event names don't match.\n\n\n registerSimpleEvent(ANIMATION_END, 'onAnimationEnd');\n registerSimpleEvent(ANIMATION_ITERATION, 'onAnimationIteration');\n registerSimpleEvent(ANIMATION_START, 'onAnimationStart');\n registerSimpleEvent('dblclick', 'onDoubleClick');\n registerSimpleEvent('focusin', 'onFocus');\n registerSimpleEvent('focusout', 'onBlur');\n registerSimpleEvent(TRANSITION_END, 'onTransitionEnd');\n}\n\nfunction extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n var reactName = topLevelEventsToReactNames.get(domEventName);\n\n if (reactName === undefined) {\n return;\n }\n\n var SyntheticEventCtor = SyntheticEvent;\n var reactEventType = domEventName;\n\n switch (domEventName) {\n case 'keypress':\n // Firefox creates a keypress event for function keys too. This removes\n // the unwanted keypress events. Enter is however both printable and\n // non-printable. One would expect Tab to be as well (but it isn't).\n if (getEventCharCode(nativeEvent) === 0) {\n return;\n }\n\n /* falls through */\n\n case 'keydown':\n case 'keyup':\n SyntheticEventCtor = SyntheticKeyboardEvent;\n break;\n\n case 'focusin':\n reactEventType = 'focus';\n SyntheticEventCtor = SyntheticFocusEvent;\n break;\n\n case 'focusout':\n reactEventType = 'blur';\n SyntheticEventCtor = SyntheticFocusEvent;\n break;\n\n case 'beforeblur':\n case 'afterblur':\n SyntheticEventCtor = SyntheticFocusEvent;\n break;\n\n case 'click':\n // Firefox creates a click event on right mouse clicks. This removes the\n // unwanted click events.\n if (nativeEvent.button === 2) {\n return;\n }\n\n /* falls through */\n\n case 'auxclick':\n case 'dblclick':\n case 'mousedown':\n case 'mousemove':\n case 'mouseup': // TODO: Disabled elements should not respond to mouse events\n\n /* falls through */\n\n case 'mouseout':\n case 'mouseover':\n case 'contextmenu':\n SyntheticEventCtor = SyntheticMouseEvent;\n break;\n\n case 'drag':\n case 'dragend':\n case 'dragenter':\n case 'dragexit':\n case 'dragleave':\n case 'dragover':\n case 'dragstart':\n case 'drop':\n SyntheticEventCtor = SyntheticDragEvent;\n break;\n\n case 'touchcancel':\n case 'touchend':\n case 'touchmove':\n case 'touchstart':\n SyntheticEventCtor = SyntheticTouchEvent;\n break;\n\n case ANIMATION_END:\n case ANIMATION_ITERATION:\n case ANIMATION_START:\n SyntheticEventCtor = SyntheticAnimationEvent;\n break;\n\n case TRANSITION_END:\n SyntheticEventCtor = SyntheticTransitionEvent;\n break;\n\n case 'scroll':\n SyntheticEventCtor = SyntheticUIEvent;\n break;\n\n case 'wheel':\n SyntheticEventCtor = SyntheticWheelEvent;\n break;\n\n case 'copy':\n case 'cut':\n case 'paste':\n SyntheticEventCtor = SyntheticClipboardEvent;\n break;\n\n case 'gotpointercapture':\n case 'lostpointercapture':\n case 'pointercancel':\n case 'pointerdown':\n case 'pointermove':\n case 'pointerout':\n case 'pointerover':\n case 'pointerup':\n SyntheticEventCtor = SyntheticPointerEvent;\n break;\n }\n\n var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;\n\n {\n // Some events don't bubble in the browser.\n // In the past, React has always bubbled them, but this can be surprising.\n // We're going to try aligning closer to the browser behavior by not bubbling\n // them in React either. We'll start by not bubbling onScroll, and then expand.\n var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from\n // nonDelegatedEvents list in DOMPluginEventSystem.\n // Then we can remove this special list.\n // This is a breaking change that can wait until React 18.\n domEventName === 'scroll';\n\n var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);\n\n if (_listeners.length > 0) {\n // Intentionally create event lazily.\n var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);\n\n dispatchQueue.push({\n event: _event,\n listeners: _listeners\n });\n }\n }\n}\n\n// TODO: remove top-level side effect.\nregisterSimpleEvents();\nregisterEvents$2();\nregisterEvents$1();\nregisterEvents$3();\nregisterEvents();\n\nfunction extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n // TODO: we should remove the concept of a \"SimpleEventPlugin\".\n // This is the basic functionality of the event system. All\n // the other plugins are essentially polyfills. So the plugin\n // should probably be inlined somewhere and have its logic\n // be core the to event system. This would potentially allow\n // us to ship builds of React without the polyfilled plugins below.\n extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0; // We don't process these events unless we are in the\n // event's native \"bubble\" phase, which means that we're\n // not in the capture phase. That's because we emulate\n // the capture phase here still. This is a trade-off,\n // because in an ideal world we would not emulate and use\n // the phases properly, like we do with the SimpleEvent\n // plugin. However, the plugins below either expect\n // emulation (EnterLeave) or use state localized to that\n // plugin (BeforeInput, Change, Select). The state in\n // these modules complicates things, as you'll essentially\n // get the case where the capture phase event might change\n // state, only for the following bubble event to come in\n // later and not trigger anything as the state now\n // invalidates the heuristics of the event plugin. We\n // could alter all these plugins to work in such ways, but\n // that might cause other unknown side-effects that we\n // can't foresee right now.\n\n if (shouldProcessPolyfillPlugins) {\n extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n }\n} // List of events that need to be individually attached to media elements.\n\n\nvar mediaEventTypes = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'encrypted', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'resize', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting']; // We should not delegate these events to the container, but rather\n// set them on the actual target element itself. This is primarily\n// because these events do not consistently bubble in the DOM.\n\nvar nonDelegatedEvents = new Set(['cancel', 'close', 'invalid', 'load', 'scroll', 'toggle'].concat(mediaEventTypes));\n\nfunction executeDispatch(event, listener, currentTarget) {\n var type = event.type || 'unknown-event';\n event.currentTarget = currentTarget;\n invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n event.currentTarget = null;\n}\n\nfunction processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {\n var previousInstance;\n\n if (inCapturePhase) {\n for (var i = dispatchListeners.length - 1; i >= 0; i--) {\n var _dispatchListeners$i = dispatchListeners[i],\n instance = _dispatchListeners$i.instance,\n currentTarget = _dispatchListeners$i.currentTarget,\n listener = _dispatchListeners$i.listener;\n\n if (instance !== previousInstance && event.isPropagationStopped()) {\n return;\n }\n\n executeDispatch(event, listener, currentTarget);\n previousInstance = instance;\n }\n } else {\n for (var _i = 0; _i < dispatchListeners.length; _i++) {\n var _dispatchListeners$_i = dispatchListeners[_i],\n _instance = _dispatchListeners$_i.instance,\n _currentTarget = _dispatchListeners$_i.currentTarget,\n _listener = _dispatchListeners$_i.listener;\n\n if (_instance !== previousInstance && event.isPropagationStopped()) {\n return;\n }\n\n executeDispatch(event, _listener, _currentTarget);\n previousInstance = _instance;\n }\n }\n}\n\nfunction processDispatchQueue(dispatchQueue, eventSystemFlags) {\n var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;\n\n for (var i = 0; i < dispatchQueue.length; i++) {\n var _dispatchQueue$i = dispatchQueue[i],\n event = _dispatchQueue$i.event,\n listeners = _dispatchQueue$i.listeners;\n processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); // event system doesn't use pooling.\n } // This would be a good time to rethrow if any of the event handlers threw.\n\n\n rethrowCaughtError();\n}\n\nfunction dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {\n var nativeEventTarget = getEventTarget(nativeEvent);\n var dispatchQueue = [];\n extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n processDispatchQueue(dispatchQueue, eventSystemFlags);\n}\n\nfunction listenToNonDelegatedEvent(domEventName, targetElement) {\n {\n if (!nonDelegatedEvents.has(domEventName)) {\n error('Did not expect a listenToNonDelegatedEvent() call for \"%s\". ' + 'This is a bug in React. Please file an issue.', domEventName);\n }\n }\n\n var isCapturePhaseListener = false;\n var listenerSet = getEventListenerSet(targetElement);\n var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);\n\n if (!listenerSet.has(listenerSetKey)) {\n addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);\n listenerSet.add(listenerSetKey);\n }\n}\nfunction listenToNativeEvent(domEventName, isCapturePhaseListener, target) {\n {\n if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) {\n error('Did not expect a listenToNativeEvent() call for \"%s\" in the bubble phase. ' + 'This is a bug in React. Please file an issue.', domEventName);\n }\n }\n\n var eventSystemFlags = 0;\n\n if (isCapturePhaseListener) {\n eventSystemFlags |= IS_CAPTURE_PHASE;\n }\n\n addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);\n} // This is only used by createEventHandle when the\nvar listeningMarker = '_reactListening' + Math.random().toString(36).slice(2);\nfunction listenToAllSupportedEvents(rootContainerElement) {\n if (!rootContainerElement[listeningMarker]) {\n rootContainerElement[listeningMarker] = true;\n allNativeEvents.forEach(function (domEventName) {\n // We handle selectionchange separately because it\n // doesn't bubble and needs to be on the document.\n if (domEventName !== 'selectionchange') {\n if (!nonDelegatedEvents.has(domEventName)) {\n listenToNativeEvent(domEventName, false, rootContainerElement);\n }\n\n listenToNativeEvent(domEventName, true, rootContainerElement);\n }\n });\n var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n\n if (ownerDocument !== null) {\n // The selectionchange event also needs deduplication\n // but it is attached to the document.\n if (!ownerDocument[listeningMarker]) {\n ownerDocument[listeningMarker] = true;\n listenToNativeEvent('selectionchange', false, ownerDocument);\n }\n }\n }\n}\n\nfunction addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {\n var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); // If passive option is not supported, then the event will be\n // active and not passive.\n\n var isPassiveListener = undefined;\n\n if (passiveBrowserEventsSupported) {\n // Browsers introduced an intervention, making these events\n // passive by default on document. React doesn't bind them\n // to document anymore, but changing this now would undo\n // the performance wins from the change. So we emulate\n // the existing behavior manually on the roots now.\n // https://github.com/facebook/react/issues/19651\n if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') {\n isPassiveListener = true;\n }\n }\n\n targetContainer = targetContainer;\n var unsubscribeListener; // When legacyFBSupport is enabled, it's for when we\n\n\n if (isCapturePhaseListener) {\n if (isPassiveListener !== undefined) {\n unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);\n } else {\n unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);\n }\n } else {\n if (isPassiveListener !== undefined) {\n unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);\n } else {\n unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);\n }\n }\n}\n\nfunction isMatchingRootContainer(grandContainer, targetContainer) {\n return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;\n}\n\nfunction dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {\n var ancestorInst = targetInst;\n\n if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {\n var targetContainerNode = targetContainer; // If we are using the legacy FB support flag, we\n\n if (targetInst !== null) {\n // The below logic attempts to work out if we need to change\n // the target fiber to a different ancestor. We had similar logic\n // in the legacy event system, except the big difference between\n // systems is that the modern event system now has an event listener\n // attached to each React Root and React Portal Root. Together,\n // the DOM nodes representing these roots are the \"rootContainer\".\n // To figure out which ancestor instance we should use, we traverse\n // up the fiber tree from the target instance and attempt to find\n // root boundaries that match that of our current \"rootContainer\".\n // If we find that \"rootContainer\", we find the parent fiber\n // sub-tree for that root and make that our ancestor instance.\n var node = targetInst;\n\n mainLoop: while (true) {\n if (node === null) {\n return;\n }\n\n var nodeTag = node.tag;\n\n if (nodeTag === HostRoot || nodeTag === HostPortal) {\n var container = node.stateNode.containerInfo;\n\n if (isMatchingRootContainer(container, targetContainerNode)) {\n break;\n }\n\n if (nodeTag === HostPortal) {\n // The target is a portal, but it's not the rootContainer we're looking for.\n // Normally portals handle their own events all the way down to the root.\n // So we should be able to stop now. However, we don't know if this portal\n // was part of *our* root.\n var grandNode = node.return;\n\n while (grandNode !== null) {\n var grandTag = grandNode.tag;\n\n if (grandTag === HostRoot || grandTag === HostPortal) {\n var grandContainer = grandNode.stateNode.containerInfo;\n\n if (isMatchingRootContainer(grandContainer, targetContainerNode)) {\n // This is the rootContainer we're looking for and we found it as\n // a parent of the Portal. That means we can ignore it because the\n // Portal will bubble through to us.\n return;\n }\n }\n\n grandNode = grandNode.return;\n }\n } // Now we need to find it's corresponding host fiber in the other\n // tree. To do this we can use getClosestInstanceFromNode, but we\n // need to validate that the fiber is a host instance, otherwise\n // we need to traverse up through the DOM till we find the correct\n // node that is from the other tree.\n\n\n while (container !== null) {\n var parentNode = getClosestInstanceFromNode(container);\n\n if (parentNode === null) {\n return;\n }\n\n var parentTag = parentNode.tag;\n\n if (parentTag === HostComponent || parentTag === HostText) {\n node = ancestorInst = parentNode;\n continue mainLoop;\n }\n\n container = container.parentNode;\n }\n }\n\n node = node.return;\n }\n }\n }\n\n batchedUpdates(function () {\n return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);\n });\n}\n\nfunction createDispatchListener(instance, listener, currentTarget) {\n return {\n instance: instance,\n listener: listener,\n currentTarget: currentTarget\n };\n}\n\nfunction accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) {\n var captureName = reactName !== null ? reactName + 'Capture' : null;\n var reactEventName = inCapturePhase ? captureName : reactName;\n var listeners = [];\n var instance = targetFiber;\n var lastHostComponent = null; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance2 = instance,\n stateNode = _instance2.stateNode,\n tag = _instance2.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n lastHostComponent = stateNode; // createEventHandle listeners\n\n\n if (reactEventName !== null) {\n var listener = getListener(instance, reactEventName);\n\n if (listener != null) {\n listeners.push(createDispatchListener(instance, listener, lastHostComponent));\n }\n }\n } // If we are only accumulating events for the target, then we don't\n // continue to propagate through the React fiber tree to find other\n // listeners.\n\n\n if (accumulateTargetOnly) {\n break;\n } // If we are processing the onBeforeBlur event, then we need to take\n\n instance = instance.return;\n }\n\n return listeners;\n} // We should only use this function for:\n// - BeforeInputEventPlugin\n// - ChangeEventPlugin\n// - SelectEventPlugin\n// This is because we only process these plugins\n// in the bubble phase, so we need to accumulate two\n// phase event listeners (via emulation).\n\nfunction accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}\n\nfunction getParent(inst) {\n if (inst === null) {\n return null;\n }\n\n do {\n inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.\n // That is depending on if we want nested subtrees (layers) to bubble\n // events to their parent. We could also go through parentNode on the\n // host node but that wouldn't work for React Native and doesn't let us\n // do the portal feature.\n } while (inst && inst.tag !== HostComponent);\n\n if (inst) {\n return inst;\n }\n\n return null;\n}\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\n\n\nfunction getLowestCommonAncestor(instA, instB) {\n var nodeA = instA;\n var nodeB = instB;\n var depthA = 0;\n\n for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {\n depthA++;\n }\n\n var depthB = 0;\n\n for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {\n depthB++;\n } // If A is deeper, crawl up.\n\n\n while (depthA - depthB > 0) {\n nodeA = getParent(nodeA);\n depthA--;\n } // If B is deeper, crawl up.\n\n\n while (depthB - depthA > 0) {\n nodeB = getParent(nodeB);\n depthB--;\n } // Walk in lockstep until we find a match.\n\n\n var depth = depthA;\n\n while (depth--) {\n if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {\n return nodeA;\n }\n\n nodeA = getParent(nodeA);\n nodeB = getParent(nodeB);\n }\n\n return null;\n}\n\nfunction accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {\n var registrationName = event._reactName;\n var listeners = [];\n var instance = target;\n\n while (instance !== null) {\n if (instance === common) {\n break;\n }\n\n var _instance4 = instance,\n alternate = _instance4.alternate,\n stateNode = _instance4.stateNode,\n tag = _instance4.tag;\n\n if (alternate !== null && alternate === common) {\n break;\n }\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n\n if (inCapturePhase) {\n var captureListener = getListener(instance, registrationName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n } else if (!inCapturePhase) {\n var bubbleListener = getListener(instance, registrationName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n }\n\n instance = instance.return;\n }\n\n if (listeners.length !== 0) {\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n }\n} // We should only use this function for:\n// - EnterLeaveEventPlugin\n// This is because we only process this plugin\n// in the bubble phase, so we need to accumulate two\n// phase event listeners.\n\n\nfunction accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\n if (from !== null) {\n accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);\n }\n\n if (to !== null && enterEvent !== null) {\n accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);\n }\n}\nfunction getListenerSetKey(domEventName, capture) {\n return domEventName + \"__\" + (capture ? 'capture' : 'bubble');\n}\n\nvar didWarnInvalidHydration = false;\nvar DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';\nvar SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';\nvar SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';\nvar AUTOFOCUS = 'autoFocus';\nvar CHILDREN = 'children';\nvar STYLE = 'style';\nvar HTML$1 = '__html';\nvar warnedUnknownTags;\nvar validatePropertiesInDevelopment;\nvar warnForPropDifference;\nvar warnForExtraAttributes;\nvar warnForInvalidEventListener;\nvar canDiffStyleForHydrationWarning;\nvar normalizeHTML;\n\n{\n warnedUnknownTags = {\n // There are working polyfills for <dialog>. Let people use it.\n dialog: true,\n // Electron ships a custom <webview> tag to display external web content in\n // an isolated frame and process.\n // This tag is not present in non Electron environments such as JSDom which\n // is often used for testing purposes.\n // @see https://electronjs.org/docs/api/webview-tag\n webview: true\n };\n\n validatePropertiesInDevelopment = function (type, props) {\n validateProperties(type, props);\n validateProperties$1(type, props);\n validateProperties$2(type, props, {\n registrationNameDependencies: registrationNameDependencies,\n possibleRegistrationNames: possibleRegistrationNames\n });\n }; // IE 11 parses & normalizes the style attribute as opposed to other\n // browsers. It adds spaces and sorts the properties in some\n // non-alphabetical order. Handling that would require sorting CSS\n // properties in the client & server versions or applying\n // `expectedStyle` to a temporary DOM node to read its `style` attribute\n // normalized. Since it only affects IE, we're skipping style warnings\n // in that browser completely in favor of doing all that work.\n // See https://github.com/facebook/react/issues/11807\n\n\n canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;\n\n warnForPropDifference = function (propName, serverValue, clientValue) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);\n var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);\n\n if (normalizedServerValue === normalizedClientValue) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));\n };\n\n warnForExtraAttributes = function (attributeNames) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n var names = [];\n attributeNames.forEach(function (name) {\n names.push(name);\n });\n\n error('Extra attributes from the server: %s', names);\n };\n\n warnForInvalidEventListener = function (registrationName, listener) {\n if (listener === false) {\n error('Expected `%s` listener to be a function, instead got `false`.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);\n } else {\n error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);\n }\n }; // Parse the HTML and read it back to normalize the HTML string so that it\n // can be used for comparison.\n\n\n normalizeHTML = function (parent, html) {\n // We could have created a separate document here to avoid\n // re-initializing custom elements if they exist. But this breaks\n // how <noscript> is being handled. So we use the same document.\n // See the discussion in https://github.com/facebook/react/pull/11157.\n var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);\n testElement.innerHTML = html;\n return testElement.innerHTML;\n };\n} // HTML parsing normalizes CR and CRLF to LF.\n// It also can turn \\u0000 into \\uFFFD inside attributes.\n// https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream\n// If we have a mismatch, it might be caused by that.\n// We will still patch up in this case but not fire the warning.\n\n\nvar NORMALIZE_NEWLINES_REGEX = /\\r\\n?/g;\nvar NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\\u0000|\\uFFFD/g;\n\nfunction normalizeMarkupForTextOrAttribute(markup) {\n {\n checkHtmlStringCoercion(markup);\n }\n\n var markupString = typeof markup === 'string' ? markup : '' + markup;\n return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');\n}\n\nfunction checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) {\n var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);\n var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);\n\n if (normalizedServerText === normalizedClientText) {\n return;\n }\n\n if (shouldWarnDev) {\n {\n if (!didWarnInvalidHydration) {\n didWarnInvalidHydration = true;\n\n error('Text content did not match. Server: \"%s\" Client: \"%s\"', normalizedServerText, normalizedClientText);\n }\n }\n }\n\n if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {\n // In concurrent roots, we throw when there's a text mismatch and revert to\n // client rendering, up to the nearest Suspense boundary.\n throw new Error('Text content does not match server-rendered HTML.');\n }\n}\n\nfunction getOwnerDocumentFromRootContainer(rootContainerElement) {\n return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n}\n\nfunction noop() {}\n\nfunction trapClickOnNonInteractiveElement(node) {\n // Mobile Safari does not fire properly bubble click events on\n // non-interactive elements, which means delegated click listeners do not\n // fire. The workaround for this bug involves attaching an empty click\n // listener on the target node.\n // https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n // Just set it using the onclick property so that we don't have to manage any\n // bookkeeping for it. Not sure if we need to clear it when the listener is\n // removed.\n // TODO: Only do this for the relevant Safaris maybe?\n node.onclick = noop;\n}\n\nfunction setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {\n for (var propKey in nextProps) {\n if (!nextProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = nextProps[propKey];\n\n if (propKey === STYLE) {\n {\n if (nextProp) {\n // Freeze the next style object so that we can assume it won't be\n // mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n } // Relies on `updateStylesByID` not mutating `styleUpdates`.\n\n\n setValueForStyles(domElement, nextProp);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n setInnerHTML(domElement, nextHtml);\n }\n } else if (propKey === CHILDREN) {\n if (typeof nextProp === 'string') {\n // Avoid setting initial textContent when the text is empty. In IE11 setting\n // textContent on a <textarea> will cause the placeholder to not\n // show within the <textarea> until it has been focused and blurred again.\n // https://github.com/facebook/react/issues/6731#issuecomment-254874553\n var canSetTextContent = tag !== 'textarea' || nextProp !== '';\n\n if (canSetTextContent) {\n setTextContent(domElement, nextProp);\n }\n } else if (typeof nextProp === 'number') {\n setTextContent(domElement, '' + nextProp);\n }\n } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n if (propKey === 'onScroll') {\n listenToNonDelegatedEvent('scroll', domElement);\n }\n }\n } else if (nextProp != null) {\n setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);\n }\n }\n}\n\nfunction updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {\n // TODO: Handle wasCustomComponentTag\n for (var i = 0; i < updatePayload.length; i += 2) {\n var propKey = updatePayload[i];\n var propValue = updatePayload[i + 1];\n\n if (propKey === STYLE) {\n setValueForStyles(domElement, propValue);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n setInnerHTML(domElement, propValue);\n } else if (propKey === CHILDREN) {\n setTextContent(domElement, propValue);\n } else {\n setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);\n }\n }\n}\n\nfunction createElement(type, props, rootContainerElement, parentNamespace) {\n var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML\n // tags get no namespace.\n\n var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);\n var domElement;\n var namespaceURI = parentNamespace;\n\n if (namespaceURI === HTML_NAMESPACE) {\n namespaceURI = getIntrinsicNamespace(type);\n }\n\n if (namespaceURI === HTML_NAMESPACE) {\n {\n isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to\n // allow <SVG> or <mATH>.\n\n if (!isCustomComponentTag && type !== type.toLowerCase()) {\n error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);\n }\n }\n\n if (type === 'script') {\n // Create the script via .innerHTML so its \"parser-inserted\" flag is\n // set to true and it does not execute\n var div = ownerDocument.createElement('div');\n\n div.innerHTML = '<script><' + '/script>'; // eslint-disable-line\n // This is guaranteed to yield a script element.\n\n var firstChild = div.firstChild;\n domElement = div.removeChild(firstChild);\n } else if (typeof props.is === 'string') {\n // $FlowIssue `createElement` should be updated for Web Components\n domElement = ownerDocument.createElement(type, {\n is: props.is\n });\n } else {\n // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.\n // See discussion in https://github.com/facebook/react/pull/6896\n // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240\n domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`\n // attributes on `select`s needs to be added before `option`s are inserted.\n // This prevents:\n // - a bug where the `select` does not scroll to the correct option because singular\n // `select` elements automatically pick the first item #13222\n // - a bug where the `select` set the first item as selected despite the `size` attribute #14239\n // See https://github.com/facebook/react/issues/13222\n // and https://github.com/facebook/react/issues/14239\n\n if (type === 'select') {\n var node = domElement;\n\n if (props.multiple) {\n node.multiple = true;\n } else if (props.size) {\n // Setting a size greater than 1 causes a select to behave like `multiple=true`, where\n // it is possible that no option is selected.\n //\n // This is only necessary when a select in \"single selection mode\".\n node.size = props.size;\n }\n }\n }\n } else {\n domElement = ownerDocument.createElementNS(namespaceURI, type);\n }\n\n {\n if (namespaceURI === HTML_NAMESPACE) {\n if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !hasOwnProperty.call(warnedUnknownTags, type)) {\n warnedUnknownTags[type] = true;\n\n error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);\n }\n }\n }\n\n return domElement;\n}\nfunction createTextNode(text, rootContainerElement) {\n return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);\n}\nfunction setInitialProperties(domElement, tag, rawProps, rootContainerElement) {\n var isCustomComponentTag = isCustomComponent(tag, rawProps);\n\n {\n validatePropertiesInDevelopment(tag, rawProps);\n } // TODO: Make sure that we check isMounted before firing any of these events.\n\n\n var props;\n\n switch (tag) {\n case 'dialog':\n listenToNonDelegatedEvent('cancel', domElement);\n listenToNonDelegatedEvent('close', domElement);\n props = rawProps;\n break;\n\n case 'iframe':\n case 'object':\n case 'embed':\n // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the load event.\n listenToNonDelegatedEvent('load', domElement);\n props = rawProps;\n break;\n\n case 'video':\n case 'audio':\n // We listen to these events in case to ensure emulated bubble\n // listeners still fire for all the media events.\n for (var i = 0; i < mediaEventTypes.length; i++) {\n listenToNonDelegatedEvent(mediaEventTypes[i], domElement);\n }\n\n props = rawProps;\n break;\n\n case 'source':\n // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the error event.\n listenToNonDelegatedEvent('error', domElement);\n props = rawProps;\n break;\n\n case 'img':\n case 'image':\n case 'link':\n // We listen to these events in case to ensure emulated bubble\n // listeners still fire for error and load events.\n listenToNonDelegatedEvent('error', domElement);\n listenToNonDelegatedEvent('load', domElement);\n props = rawProps;\n break;\n\n case 'details':\n // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the toggle event.\n listenToNonDelegatedEvent('toggle', domElement);\n props = rawProps;\n break;\n\n case 'input':\n initWrapperState(domElement, rawProps);\n props = getHostProps(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n break;\n\n case 'option':\n validateProps(domElement, rawProps);\n props = rawProps;\n break;\n\n case 'select':\n initWrapperState$1(domElement, rawProps);\n props = getHostProps$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n break;\n\n case 'textarea':\n initWrapperState$2(domElement, rawProps);\n props = getHostProps$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n break;\n\n default:\n props = rawProps;\n }\n\n assertValidProps(tag, props);\n setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);\n\n switch (tag) {\n case 'input':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper(domElement, rawProps, false);\n break;\n\n case 'textarea':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper$3(domElement);\n break;\n\n case 'option':\n postMountWrapper$1(domElement, rawProps);\n break;\n\n case 'select':\n postMountWrapper$2(domElement, rawProps);\n break;\n\n default:\n if (typeof props.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n} // Calculate the diff between the two objects.\n\nfunction diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {\n {\n validatePropertiesInDevelopment(tag, nextRawProps);\n }\n\n var updatePayload = null;\n var lastProps;\n var nextProps;\n\n switch (tag) {\n case 'input':\n lastProps = getHostProps(domElement, lastRawProps);\n nextProps = getHostProps(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'select':\n lastProps = getHostProps$1(domElement, lastRawProps);\n nextProps = getHostProps$1(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'textarea':\n lastProps = getHostProps$2(domElement, lastRawProps);\n nextProps = getHostProps$2(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n default:\n lastProps = lastRawProps;\n nextProps = nextRawProps;\n\n if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n\n assertValidProps(tag, nextProps);\n var propKey;\n var styleName;\n var styleUpdates = null;\n\n for (propKey in lastProps) {\n if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {\n continue;\n }\n\n if (propKey === STYLE) {\n var lastStyle = lastProps[propKey];\n\n for (styleName in lastStyle) {\n if (lastStyle.hasOwnProperty(styleName)) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = '';\n }\n }\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n // This is a special case. If any listener updates we need to ensure\n // that the \"current\" fiber pointer gets updated so we need a commit\n // to update this element.\n if (!updatePayload) {\n updatePayload = [];\n }\n } else {\n // For all other deleted properties we add it to the queue. We use\n // the allowed property list in the commit phase instead.\n (updatePayload = updatePayload || []).push(propKey, null);\n }\n }\n\n for (propKey in nextProps) {\n var nextProp = nextProps[propKey];\n var lastProp = lastProps != null ? lastProps[propKey] : undefined;\n\n if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {\n continue;\n }\n\n if (propKey === STYLE) {\n {\n if (nextProp) {\n // Freeze the next style object so that we can assume it won't be\n // mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n }\n\n if (lastProp) {\n // Unset styles on `lastProp` but not on `nextProp`.\n for (styleName in lastProp) {\n if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = '';\n }\n } // Update styles that changed since `lastProp`.\n\n\n for (styleName in nextProp) {\n if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = nextProp[styleName];\n }\n }\n } else {\n // Relies on `updateStylesByID` not mutating `styleUpdates`.\n if (!styleUpdates) {\n if (!updatePayload) {\n updatePayload = [];\n }\n\n updatePayload.push(propKey, styleUpdates);\n }\n\n styleUpdates = nextProp;\n }\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n var lastHtml = lastProp ? lastProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n if (lastHtml !== nextHtml) {\n (updatePayload = updatePayload || []).push(propKey, nextHtml);\n }\n }\n } else if (propKey === CHILDREN) {\n if (typeof nextProp === 'string' || typeof nextProp === 'number') {\n (updatePayload = updatePayload || []).push(propKey, '' + nextProp);\n }\n } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n // We eagerly listen to this even though we haven't committed yet.\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n if (propKey === 'onScroll') {\n listenToNonDelegatedEvent('scroll', domElement);\n }\n }\n\n if (!updatePayload && lastProp !== nextProp) {\n // This is a special case. If any listener updates we need to ensure\n // that the \"current\" props pointer gets updated so we need a commit\n // to update this element.\n updatePayload = [];\n }\n } else {\n // For any other property we always add it to the queue and then we\n // filter it out using the allowed property list during the commit.\n (updatePayload = updatePayload || []).push(propKey, nextProp);\n }\n }\n\n if (styleUpdates) {\n {\n validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);\n }\n\n (updatePayload = updatePayload || []).push(STYLE, styleUpdates);\n }\n\n return updatePayload;\n} // Apply the diff.\n\nfunction updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {\n // Update checked *before* name.\n // In the middle of an update, it is possible to have multiple checked.\n // When a checked radio tries to change name, browser makes another radio's checked false.\n if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {\n updateChecked(domElement, nextRawProps);\n }\n\n var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);\n var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.\n\n updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props\n // changed.\n\n switch (tag) {\n case 'input':\n // Update the wrapper around inputs *after* updating props. This has to\n // happen after `updateDOMProperties`. Otherwise HTML5 input validations\n // raise warnings and prevent the new value from being assigned.\n updateWrapper(domElement, nextRawProps);\n break;\n\n case 'textarea':\n updateWrapper$1(domElement, nextRawProps);\n break;\n\n case 'select':\n // <select> value update needs to occur after <option> children\n // reconciliation\n postUpdateWrapper(domElement, nextRawProps);\n break;\n }\n}\n\nfunction getPossibleStandardName(propName) {\n {\n var lowerCasedName = propName.toLowerCase();\n\n if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n return null;\n }\n\n return possibleStandardNames[lowerCasedName] || null;\n }\n}\n\nfunction diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) {\n var isCustomComponentTag;\n var extraAttributeNames;\n\n {\n isCustomComponentTag = isCustomComponent(tag, rawProps);\n validatePropertiesInDevelopment(tag, rawProps);\n } // TODO: Make sure that we check isMounted before firing any of these events.\n\n\n switch (tag) {\n case 'dialog':\n listenToNonDelegatedEvent('cancel', domElement);\n listenToNonDelegatedEvent('close', domElement);\n break;\n\n case 'iframe':\n case 'object':\n case 'embed':\n // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the load event.\n listenToNonDelegatedEvent('load', domElement);\n break;\n\n case 'video':\n case 'audio':\n // We listen to these events in case to ensure emulated bubble\n // listeners still fire for all the media events.\n for (var i = 0; i < mediaEventTypes.length; i++) {\n listenToNonDelegatedEvent(mediaEventTypes[i], domElement);\n }\n\n break;\n\n case 'source':\n // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the error event.\n listenToNonDelegatedEvent('error', domElement);\n break;\n\n case 'img':\n case 'image':\n case 'link':\n // We listen to these events in case to ensure emulated bubble\n // listeners still fire for error and load events.\n listenToNonDelegatedEvent('error', domElement);\n listenToNonDelegatedEvent('load', domElement);\n break;\n\n case 'details':\n // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the toggle event.\n listenToNonDelegatedEvent('toggle', domElement);\n break;\n\n case 'input':\n initWrapperState(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n break;\n\n case 'option':\n validateProps(domElement, rawProps);\n break;\n\n case 'select':\n initWrapperState$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n break;\n\n case 'textarea':\n initWrapperState$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n // listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n break;\n }\n\n assertValidProps(tag, rawProps);\n\n {\n extraAttributeNames = new Set();\n var attributes = domElement.attributes;\n\n for (var _i = 0; _i < attributes.length; _i++) {\n var name = attributes[_i].name.toLowerCase();\n\n switch (name) {\n // Controlled attributes are not validated\n // TODO: Only ignore them on controlled tags.\n case 'value':\n break;\n\n case 'checked':\n break;\n\n case 'selected':\n break;\n\n default:\n // Intentionally use the original name.\n // See discussion in https://github.com/facebook/react/pull/10676.\n extraAttributeNames.add(attributes[_i].name);\n }\n }\n }\n\n var updatePayload = null;\n\n for (var propKey in rawProps) {\n if (!rawProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = rawProps[propKey];\n\n if (propKey === CHILDREN) {\n // For text content children we compare against textContent. This\n // might match additional HTML that is hidden when we read it using\n // textContent. E.g. \"foo\" will match \"f<span>oo</span>\" but that still\n // satisfies our requirement. Our requirement is not to produce perfect\n // HTML and attributes. Ideally we should preserve structure but it's\n // ok not to if the visible content is still enough to indicate what\n // even listeners these nodes might be wired up to.\n // TODO: Warn if there is more than a single textNode as a child.\n // TODO: Should we use domElement.firstChild.nodeValue to compare?\n if (typeof nextProp === 'string') {\n if (domElement.textContent !== nextProp) {\n if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {\n checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);\n }\n\n updatePayload = [CHILDREN, nextProp];\n }\n } else if (typeof nextProp === 'number') {\n if (domElement.textContent !== '' + nextProp) {\n if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {\n checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);\n }\n\n updatePayload = [CHILDREN, '' + nextProp];\n }\n }\n } else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n if (propKey === 'onScroll') {\n listenToNonDelegatedEvent('scroll', domElement);\n }\n }\n } else if (shouldWarnDev && true && // Convince Flow we've calculated it (it's DEV-only in this method.)\n typeof isCustomComponentTag === 'boolean') {\n // Validate that the properties correspond to their expected values.\n var serverValue = void 0;\n var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey);\n\n if (rawProps[SUPPRESS_HYDRATION_WARNING] === true) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated\n // TODO: Only ignore them on controlled tags.\n propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var serverHTML = domElement.innerHTML;\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n var expectedHTML = normalizeHTML(domElement, nextHtml);\n\n if (expectedHTML !== serverHTML) {\n warnForPropDifference(propKey, serverHTML, expectedHTML);\n }\n }\n } else if (propKey === STYLE) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey);\n\n if (canDiffStyleForHydrationWarning) {\n var expectedStyle = createDangerousStringForStyles(nextProp);\n serverValue = domElement.getAttribute('style');\n\n if (expectedStyle !== serverValue) {\n warnForPropDifference(propKey, serverValue, expectedStyle);\n }\n }\n } else if (isCustomComponentTag && !enableCustomElementPropertySupport) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey.toLowerCase());\n serverValue = getValueForAttribute(domElement, propKey, nextProp);\n\n if (nextProp !== serverValue) {\n warnForPropDifference(propKey, serverValue, nextProp);\n }\n } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {\n var isMismatchDueToBadCasing = false;\n\n if (propertyInfo !== null) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propertyInfo.attributeName);\n serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);\n } else {\n var ownNamespace = parentNamespace;\n\n if (ownNamespace === HTML_NAMESPACE) {\n ownNamespace = getIntrinsicNamespace(tag);\n }\n\n if (ownNamespace === HTML_NAMESPACE) {\n // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey.toLowerCase());\n } else {\n var standardName = getPossibleStandardName(propKey);\n\n if (standardName !== null && standardName !== propKey) {\n // If an SVG prop is supplied with bad casing, it will\n // be successfully parsed from HTML, but will produce a mismatch\n // (and would be incorrectly rendered on the client).\n // However, we already warn about bad casing elsewhere.\n // So we'll skip the misleading extra mismatch warning in this case.\n isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.\n\n extraAttributeNames.delete(standardName);\n } // $FlowFixMe - Should be inferred as not undefined.\n\n\n extraAttributeNames.delete(propKey);\n }\n\n serverValue = getValueForAttribute(domElement, propKey, nextProp);\n }\n\n var dontWarnCustomElement = enableCustomElementPropertySupport ;\n\n if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) {\n warnForPropDifference(propKey, serverValue, nextProp);\n }\n }\n }\n }\n\n {\n if (shouldWarnDev) {\n if ( // $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {\n // $FlowFixMe - Should be inferred as not undefined.\n warnForExtraAttributes(extraAttributeNames);\n }\n }\n }\n\n switch (tag) {\n case 'input':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper(domElement, rawProps, true);\n break;\n\n case 'textarea':\n // TODO: Make sure we check if this is still unmounted or do any clean\n // up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper$3(domElement);\n break;\n\n case 'select':\n case 'option':\n // For input and textarea we current always set the value property at\n // post mount to force it to diverge from attributes. However, for\n // option and select we don't quite do the same thing and select\n // is not resilient to the DOM state changing so we don't do that here.\n // TODO: Consider not doing this for input and textarea.\n break;\n\n default:\n if (typeof rawProps.onClick === 'function') {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n\n return updatePayload;\n}\nfunction diffHydratedText(textNode, text, isConcurrentMode) {\n var isDifferent = textNode.nodeValue !== text;\n return isDifferent;\n}\nfunction warnForDeletedHydratableElement(parentNode, child) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForDeletedHydratableText(parentNode, child) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Did not expect server HTML to contain the text node \"%s\" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForInsertedHydratedElement(parentNode, tag, props) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForInsertedHydratedText(parentNode, text) {\n {\n if (text === '') {\n // We expect to insert empty text nodes since they're not represented in\n // the HTML.\n // TODO: Remove this special case if we can just avoid inserting empty\n // text nodes.\n return;\n }\n\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Expected server HTML to contain a matching text node for \"%s\" in <%s>.', text, parentNode.nodeName.toLowerCase());\n }\n}\nfunction restoreControlledState$3(domElement, tag, props) {\n switch (tag) {\n case 'input':\n restoreControlledState(domElement, props);\n return;\n\n case 'textarea':\n restoreControlledState$2(domElement, props);\n return;\n\n case 'select':\n restoreControlledState$1(domElement, props);\n return;\n }\n}\n\nvar validateDOMNesting = function () {};\n\nvar updatedAncestorInfo = function () {};\n\n{\n // This validation code was written based on the HTML5 parsing spec:\n // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n //\n // Note: this does not catch all invalid nesting, nor does it try to (as it's\n // not clear what practical benefit doing so provides); instead, we warn only\n // for cases where the parser will give a parse tree differing from what React\n // intended. For example, <b><div></div></b> is invalid but we don't warn\n // because it still parses correctly; we do warn for other cases like nested\n // <p> tags where the beginning of the second element implicitly closes the\n // first, causing a confusing mess.\n // https://html.spec.whatwg.org/multipage/syntax.html#special\n var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n\n var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point\n // TODO: Distinguish by namespace here -- for <title>, including it here\n // errs on the side of fewer warnings\n 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope\n\n var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags\n\n var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];\n var emptyAncestorInfo = {\n current: null,\n formTag: null,\n aTagInScope: null,\n buttonTagInScope: null,\n nobrTagInScope: null,\n pTagInButtonScope: null,\n listItemTagAutoclosing: null,\n dlItemTagAutoclosing: null\n };\n\n updatedAncestorInfo = function (oldInfo, tag) {\n var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);\n\n var info = {\n tag: tag\n };\n\n if (inScopeTags.indexOf(tag) !== -1) {\n ancestorInfo.aTagInScope = null;\n ancestorInfo.buttonTagInScope = null;\n ancestorInfo.nobrTagInScope = null;\n }\n\n if (buttonScopeTags.indexOf(tag) !== -1) {\n ancestorInfo.pTagInButtonScope = null;\n } // See rules for 'li', 'dd', 'dt' start tags in\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n\n\n if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {\n ancestorInfo.listItemTagAutoclosing = null;\n ancestorInfo.dlItemTagAutoclosing = null;\n }\n\n ancestorInfo.current = info;\n\n if (tag === 'form') {\n ancestorInfo.formTag = info;\n }\n\n if (tag === 'a') {\n ancestorInfo.aTagInScope = info;\n }\n\n if (tag === 'button') {\n ancestorInfo.buttonTagInScope = info;\n }\n\n if (tag === 'nobr') {\n ancestorInfo.nobrTagInScope = info;\n }\n\n if (tag === 'p') {\n ancestorInfo.pTagInButtonScope = info;\n }\n\n if (tag === 'li') {\n ancestorInfo.listItemTagAutoclosing = info;\n }\n\n if (tag === 'dd' || tag === 'dt') {\n ancestorInfo.dlItemTagAutoclosing = info;\n }\n\n return ancestorInfo;\n };\n /**\n * Returns whether\n */\n\n\n var isTagValidWithParent = function (tag, parentTag) {\n // First, let's check if we're in an unusual parsing mode...\n switch (parentTag) {\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect\n case 'select':\n return tag === 'option' || tag === 'optgroup' || tag === '#text';\n\n case 'optgroup':\n return tag === 'option' || tag === '#text';\n // Strictly speaking, seeing an <option> doesn't mean we're in a <select>\n // but\n\n case 'option':\n return tag === '#text';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption\n // No special behavior since these rules fall back to \"in body\" mode for\n // all except special table nodes which cause bad parsing behavior anyway.\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr\n\n case 'tr':\n return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody\n\n case 'tbody':\n case 'thead':\n case 'tfoot':\n return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup\n\n case 'colgroup':\n return tag === 'col' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable\n\n case 'table':\n return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead\n\n case 'head':\n return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';\n // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element\n\n case 'html':\n return tag === 'head' || tag === 'body' || tag === 'frameset';\n\n case 'frameset':\n return tag === 'frame';\n\n case '#document':\n return tag === 'html';\n } // Probably in the \"in body\" parsing mode, so we outlaw only tag combos\n // where the parsing rules cause implicit opens or closes to be added.\n // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n\n\n switch (tag) {\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';\n\n case 'rp':\n case 'rt':\n return impliedEndTags.indexOf(parentTag) === -1;\n\n case 'body':\n case 'caption':\n case 'col':\n case 'colgroup':\n case 'frameset':\n case 'frame':\n case 'head':\n case 'html':\n case 'tbody':\n case 'td':\n case 'tfoot':\n case 'th':\n case 'thead':\n case 'tr':\n // These tags are only valid with a few parents that have special child\n // parsing rules -- if we're down here, then none of those matched and\n // so we allow it only if we don't know what the parent is, as all other\n // cases are invalid.\n return parentTag == null;\n }\n\n return true;\n };\n /**\n * Returns whether\n */\n\n\n var findInvalidAncestorForTag = function (tag, ancestorInfo) {\n switch (tag) {\n case 'address':\n case 'article':\n case 'aside':\n case 'blockquote':\n case 'center':\n case 'details':\n case 'dialog':\n case 'dir':\n case 'div':\n case 'dl':\n case 'fieldset':\n case 'figcaption':\n case 'figure':\n case 'footer':\n case 'header':\n case 'hgroup':\n case 'main':\n case 'menu':\n case 'nav':\n case 'ol':\n case 'p':\n case 'section':\n case 'summary':\n case 'ul':\n case 'pre':\n case 'listing':\n case 'table':\n case 'hr':\n case 'xmp':\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n return ancestorInfo.pTagInButtonScope;\n\n case 'form':\n return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;\n\n case 'li':\n return ancestorInfo.listItemTagAutoclosing;\n\n case 'dd':\n case 'dt':\n return ancestorInfo.dlItemTagAutoclosing;\n\n case 'button':\n return ancestorInfo.buttonTagInScope;\n\n case 'a':\n // Spec says something about storing a list of markers, but it sounds\n // equivalent to this check.\n return ancestorInfo.aTagInScope;\n\n case 'nobr':\n return ancestorInfo.nobrTagInScope;\n }\n\n return null;\n };\n\n var didWarn$1 = {};\n\n validateDOMNesting = function (childTag, childText, ancestorInfo) {\n ancestorInfo = ancestorInfo || emptyAncestorInfo;\n var parentInfo = ancestorInfo.current;\n var parentTag = parentInfo && parentInfo.tag;\n\n if (childText != null) {\n if (childTag != null) {\n error('validateDOMNesting: when childText is passed, childTag should be null');\n }\n\n childTag = '#text';\n }\n\n var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;\n var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);\n var invalidParentOrAncestor = invalidParent || invalidAncestor;\n\n if (!invalidParentOrAncestor) {\n return;\n }\n\n var ancestorTag = invalidParentOrAncestor.tag;\n var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag;\n\n if (didWarn$1[warnKey]) {\n return;\n }\n\n didWarn$1[warnKey] = true;\n var tagDisplayName = childTag;\n var whitespaceInfo = '';\n\n if (childTag === '#text') {\n if (/\\S/.test(childText)) {\n tagDisplayName = 'Text nodes';\n } else {\n tagDisplayName = 'Whitespace text nodes';\n whitespaceInfo = \" Make sure you don't have any extra whitespace between tags on \" + 'each line of your source code.';\n }\n } else {\n tagDisplayName = '<' + childTag + '>';\n }\n\n if (invalidParent) {\n var info = '';\n\n if (ancestorTag === 'table' && childTag === 'tr') {\n info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';\n }\n\n error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);\n } else {\n error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);\n }\n };\n}\n\nvar SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';\nvar SUSPENSE_START_DATA = '$';\nvar SUSPENSE_END_DATA = '/$';\nvar SUSPENSE_PENDING_START_DATA = '$?';\nvar SUSPENSE_FALLBACK_START_DATA = '$!';\nvar STYLE$1 = 'style';\nvar eventsEnabled = null;\nvar selectionInformation = null;\nfunction getRootHostContext(rootContainerInstance) {\n var type;\n var namespace;\n var nodeType = rootContainerInstance.nodeType;\n\n switch (nodeType) {\n case DOCUMENT_NODE:\n case DOCUMENT_FRAGMENT_NODE:\n {\n type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';\n var root = rootContainerInstance.documentElement;\n namespace = root ? root.namespaceURI : getChildNamespace(null, '');\n break;\n }\n\n default:\n {\n var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;\n var ownNamespace = container.namespaceURI || null;\n type = container.tagName;\n namespace = getChildNamespace(ownNamespace, type);\n break;\n }\n }\n\n {\n var validatedTag = type.toLowerCase();\n var ancestorInfo = updatedAncestorInfo(null, validatedTag);\n return {\n namespace: namespace,\n ancestorInfo: ancestorInfo\n };\n }\n}\nfunction getChildHostContext(parentHostContext, type, rootContainerInstance) {\n {\n var parentHostContextDev = parentHostContext;\n var namespace = getChildNamespace(parentHostContextDev.namespace, type);\n var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);\n return {\n namespace: namespace,\n ancestorInfo: ancestorInfo\n };\n }\n}\nfunction getPublicInstance(instance) {\n return instance;\n}\nfunction prepareForCommit(containerInfo) {\n eventsEnabled = isEnabled();\n selectionInformation = getSelectionInformation();\n var activeInstance = null;\n\n setEnabled(false);\n return activeInstance;\n}\nfunction resetAfterCommit(containerInfo) {\n restoreSelection(selectionInformation);\n setEnabled(eventsEnabled);\n eventsEnabled = null;\n selectionInformation = null;\n}\nfunction createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n var parentNamespace;\n\n {\n // TODO: take namespace into account when validating.\n var hostContextDev = hostContext;\n validateDOMNesting(type, null, hostContextDev.ancestorInfo);\n\n if (typeof props.children === 'string' || typeof props.children === 'number') {\n var string = '' + props.children;\n var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n validateDOMNesting(null, string, ownAncestorInfo);\n }\n\n parentNamespace = hostContextDev.namespace;\n }\n\n var domElement = createElement(type, props, rootContainerInstance, parentNamespace);\n precacheFiberNode(internalInstanceHandle, domElement);\n updateFiberProps(domElement, props);\n return domElement;\n}\nfunction appendInitialChild(parentInstance, child) {\n parentInstance.appendChild(child);\n}\nfunction finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {\n setInitialProperties(domElement, type, props, rootContainerInstance);\n\n switch (type) {\n case 'button':\n case 'input':\n case 'select':\n case 'textarea':\n return !!props.autoFocus;\n\n case 'img':\n return true;\n\n default:\n return false;\n }\n}\nfunction prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {\n {\n var hostContextDev = hostContext;\n\n if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {\n var string = '' + newProps.children;\n var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n validateDOMNesting(null, string, ownAncestorInfo);\n }\n }\n\n return diffProperties(domElement, type, oldProps, newProps);\n}\nfunction shouldSetTextContent(type, props) {\n return type === 'textarea' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;\n}\nfunction createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {\n {\n var hostContextDev = hostContext;\n validateDOMNesting(null, text, hostContextDev.ancestorInfo);\n }\n\n var textNode = createTextNode(text, rootContainerInstance);\n precacheFiberNode(internalInstanceHandle, textNode);\n return textNode;\n}\nfunction getCurrentEventPriority() {\n var currentEvent = window.event;\n\n if (currentEvent === undefined) {\n return DefaultEventPriority;\n }\n\n return getEventPriority(currentEvent.type);\n}\n// if a component just imports ReactDOM (e.g. for findDOMNode).\n// Some environments might not have setTimeout or clearTimeout.\n\nvar scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;\nvar cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;\nvar noTimeout = -1;\nvar localPromise = typeof Promise === 'function' ? Promise : undefined; // -------------------\nvar scheduleMicrotask = typeof queueMicrotask === 'function' ? queueMicrotask : typeof localPromise !== 'undefined' ? function (callback) {\n return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);\n} : scheduleTimeout; // TODO: Determine the best fallback here.\n\nfunction handleErrorInNextTick(error) {\n setTimeout(function () {\n throw error;\n });\n} // -------------------\nfunction commitMount(domElement, type, newProps, internalInstanceHandle) {\n // Despite the naming that might imply otherwise, this method only\n // fires if there is an `Update` effect scheduled during mounting.\n // This happens if `finalizeInitialChildren` returns `true` (which it\n // does to implement the `autoFocus` attribute on the client). But\n // there are also other cases when this might happen (such as patching\n // up text content during hydration mismatch). So we'll check this again.\n switch (type) {\n case 'button':\n case 'input':\n case 'select':\n case 'textarea':\n if (newProps.autoFocus) {\n domElement.focus();\n }\n\n return;\n\n case 'img':\n {\n if (newProps.src) {\n domElement.src = newProps.src;\n }\n\n return;\n }\n }\n}\nfunction commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {\n // Apply the diff to the DOM node.\n updateProperties(domElement, updatePayload, type, oldProps, newProps); // Update the props handle so that we know which props are the ones with\n // with current event handlers.\n\n updateFiberProps(domElement, newProps);\n}\nfunction resetTextContent(domElement) {\n setTextContent(domElement, '');\n}\nfunction commitTextUpdate(textInstance, oldText, newText) {\n textInstance.nodeValue = newText;\n}\nfunction appendChild(parentInstance, child) {\n parentInstance.appendChild(child);\n}\nfunction appendChildToContainer(container, child) {\n var parentNode;\n\n if (container.nodeType === COMMENT_NODE) {\n parentNode = container.parentNode;\n parentNode.insertBefore(child, container);\n } else {\n parentNode = container;\n parentNode.appendChild(child);\n } // This container might be used for a portal.\n // If something inside a portal is clicked, that click should bubble\n // through the React tree. However, on Mobile Safari the click would\n // never bubble through the *DOM* tree unless an ancestor with onclick\n // event exists. So we wouldn't see it and dispatch it.\n // This is why we ensure that non React root containers have inline onclick\n // defined.\n // https://github.com/facebook/react/issues/11918\n\n\n var reactRootContainer = container._reactRootContainer;\n\n if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {\n // TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(parentNode);\n }\n}\nfunction insertBefore(parentInstance, child, beforeChild) {\n parentInstance.insertBefore(child, beforeChild);\n}\nfunction insertInContainerBefore(container, child, beforeChild) {\n if (container.nodeType === COMMENT_NODE) {\n container.parentNode.insertBefore(child, beforeChild);\n } else {\n container.insertBefore(child, beforeChild);\n }\n}\n\nfunction removeChild(parentInstance, child) {\n parentInstance.removeChild(child);\n}\nfunction removeChildFromContainer(container, child) {\n if (container.nodeType === COMMENT_NODE) {\n container.parentNode.removeChild(child);\n } else {\n container.removeChild(child);\n }\n}\nfunction clearSuspenseBoundary(parentInstance, suspenseInstance) {\n var node = suspenseInstance; // Delete all nodes within this suspense boundary.\n // There might be nested nodes so we need to keep track of how\n // deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n do {\n var nextNode = node.nextSibling;\n parentInstance.removeChild(node);\n\n if (nextNode && nextNode.nodeType === COMMENT_NODE) {\n var data = nextNode.data;\n\n if (data === SUSPENSE_END_DATA) {\n if (depth === 0) {\n parentInstance.removeChild(nextNode); // Retry if any event replaying was blocked on this.\n\n retryIfBlockedOn(suspenseInstance);\n return;\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {\n depth++;\n }\n }\n\n node = nextNode;\n } while (node); // TODO: Warn, we didn't find the end comment boundary.\n // Retry if any event replaying was blocked on this.\n\n\n retryIfBlockedOn(suspenseInstance);\n}\nfunction clearSuspenseBoundaryFromContainer(container, suspenseInstance) {\n if (container.nodeType === COMMENT_NODE) {\n clearSuspenseBoundary(container.parentNode, suspenseInstance);\n } else if (container.nodeType === ELEMENT_NODE) {\n clearSuspenseBoundary(container, suspenseInstance);\n } // Retry if any event replaying was blocked on this.\n\n\n retryIfBlockedOn(container);\n}\nfunction hideInstance(instance) {\n // TODO: Does this work for all element types? What about MathML? Should we\n // pass host context to this method?\n instance = instance;\n var style = instance.style;\n\n if (typeof style.setProperty === 'function') {\n style.setProperty('display', 'none', 'important');\n } else {\n style.display = 'none';\n }\n}\nfunction hideTextInstance(textInstance) {\n textInstance.nodeValue = '';\n}\nfunction unhideInstance(instance, props) {\n instance = instance;\n var styleProp = props[STYLE$1];\n var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;\n instance.style.display = dangerousStyleValue('display', display);\n}\nfunction unhideTextInstance(textInstance, text) {\n textInstance.nodeValue = text;\n}\nfunction clearContainer(container) {\n if (container.nodeType === ELEMENT_NODE) {\n container.textContent = '';\n } else if (container.nodeType === DOCUMENT_NODE) {\n if (container.documentElement) {\n container.removeChild(container.documentElement);\n }\n }\n} // -------------------\nfunction canHydrateInstance(instance, type, props) {\n if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {\n return null;\n } // This has now been refined to an element node.\n\n\n return instance;\n}\nfunction canHydrateTextInstance(instance, text) {\n if (text === '' || instance.nodeType !== TEXT_NODE) {\n // Empty strings are not parsed by HTML so there won't be a correct match here.\n return null;\n } // This has now been refined to a text node.\n\n\n return instance;\n}\nfunction canHydrateSuspenseInstance(instance) {\n if (instance.nodeType !== COMMENT_NODE) {\n // Empty strings are not parsed by HTML so there won't be a correct match here.\n return null;\n } // This has now been refined to a suspense node.\n\n\n return instance;\n}\nfunction isSuspenseInstancePending(instance) {\n return instance.data === SUSPENSE_PENDING_START_DATA;\n}\nfunction isSuspenseInstanceFallback(instance) {\n return instance.data === SUSPENSE_FALLBACK_START_DATA;\n}\nfunction getSuspenseInstanceFallbackErrorDetails(instance) {\n var dataset = instance.nextSibling && instance.nextSibling.dataset;\n var digest, message, stack;\n\n if (dataset) {\n digest = dataset.dgst;\n\n {\n message = dataset.msg;\n stack = dataset.stck;\n }\n }\n\n {\n return {\n message: message,\n digest: digest,\n stack: stack\n };\n } // let value = {message: undefined, hash: undefined};\n // const nextSibling = instance.nextSibling;\n // if (nextSibling) {\n // const dataset = ((nextSibling: any): HTMLTemplateElement).dataset;\n // value.message = dataset.msg;\n // value.hash = dataset.hash;\n // if (true) {\n // value.stack = dataset.stack;\n // }\n // }\n // return value;\n\n}\nfunction registerSuspenseInstanceRetry(instance, callback) {\n instance._reactRetry = callback;\n}\n\nfunction getNextHydratable(node) {\n // Skip non-hydratable nodes.\n for (; node != null; node = node.nextSibling) {\n var nodeType = node.nodeType;\n\n if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {\n break;\n }\n\n if (nodeType === COMMENT_NODE) {\n var nodeData = node.data;\n\n if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {\n break;\n }\n\n if (nodeData === SUSPENSE_END_DATA) {\n return null;\n }\n }\n }\n\n return node;\n}\n\nfunction getNextHydratableSibling(instance) {\n return getNextHydratable(instance.nextSibling);\n}\nfunction getFirstHydratableChild(parentInstance) {\n return getNextHydratable(parentInstance.firstChild);\n}\nfunction getFirstHydratableChildWithinContainer(parentContainer) {\n return getNextHydratable(parentContainer.firstChild);\n}\nfunction getFirstHydratableChildWithinSuspenseInstance(parentInstance) {\n return getNextHydratable(parentInstance.nextSibling);\n}\nfunction hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) {\n precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events\n // get attached.\n\n updateFiberProps(instance, props);\n var parentNamespace;\n\n {\n var hostContextDev = hostContext;\n parentNamespace = hostContextDev.namespace;\n } // TODO: Temporary hack to check if we're in a concurrent root. We can delete\n // when the legacy root API is removed.\n\n\n var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;\n return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev);\n}\nfunction hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) {\n precacheFiberNode(internalInstanceHandle, textInstance); // TODO: Temporary hack to check if we're in a concurrent root. We can delete\n // when the legacy root API is removed.\n\n var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;\n return diffHydratedText(textInstance, text);\n}\nfunction hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {\n precacheFiberNode(internalInstanceHandle, suspenseInstance);\n}\nfunction getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {\n var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.\n // There might be nested nodes so we need to keep track of how\n // deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n while (node) {\n if (node.nodeType === COMMENT_NODE) {\n var data = node.data;\n\n if (data === SUSPENSE_END_DATA) {\n if (depth === 0) {\n return getNextHydratableSibling(node);\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n depth++;\n }\n }\n\n node = node.nextSibling;\n } // TODO: Warn, we didn't find the end comment boundary.\n\n\n return null;\n} // Returns the SuspenseInstance if this node is a direct child of a\n// SuspenseInstance. I.e. if its previous sibling is a Comment with\n// SUSPENSE_x_START_DATA. Otherwise, null.\n\nfunction getParentSuspenseInstance(targetInstance) {\n var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.\n // There might be nested nodes so we need to keep track of how\n // deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n while (node) {\n if (node.nodeType === COMMENT_NODE) {\n var data = node.data;\n\n if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n if (depth === 0) {\n return node;\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_END_DATA) {\n depth++;\n }\n }\n\n node = node.previousSibling;\n }\n\n return null;\n}\nfunction commitHydratedContainer(container) {\n // Retry if any event replaying was blocked on this.\n retryIfBlockedOn(container);\n}\nfunction commitHydratedSuspenseInstance(suspenseInstance) {\n // Retry if any event replaying was blocked on this.\n retryIfBlockedOn(suspenseInstance);\n}\nfunction shouldDeleteUnhydratedTailInstances(parentType) {\n return parentType !== 'head' && parentType !== 'body';\n}\nfunction didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) {\n var shouldWarnDev = true;\n checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);\n}\nfunction didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) {\n if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n var shouldWarnDev = true;\n checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);\n }\n}\nfunction didNotHydrateInstanceWithinContainer(parentContainer, instance) {\n {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentContainer, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentContainer, instance);\n }\n }\n}\nfunction didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) {\n {\n // $FlowFixMe: Only Element or Document can be parent nodes.\n var parentNode = parentInstance.parentNode;\n\n if (parentNode !== null) {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentNode, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentNode, instance);\n }\n }\n }\n}\nfunction didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) {\n {\n if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentInstance, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentInstance, instance);\n }\n }\n }\n}\nfunction didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) {\n {\n warnForInsertedHydratedElement(parentContainer, type);\n }\n}\nfunction didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) {\n {\n warnForInsertedHydratedText(parentContainer, text);\n }\n}\nfunction didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) {\n {\n // $FlowFixMe: Only Element or Document can be parent nodes.\n var parentNode = parentInstance.parentNode;\n if (parentNode !== null) warnForInsertedHydratedElement(parentNode, type);\n }\n}\nfunction didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) {\n {\n // $FlowFixMe: Only Element or Document can be parent nodes.\n var parentNode = parentInstance.parentNode;\n if (parentNode !== null) warnForInsertedHydratedText(parentNode, text);\n }\n}\nfunction didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) {\n {\n if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForInsertedHydratedElement(parentInstance, type);\n }\n }\n}\nfunction didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) {\n {\n if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForInsertedHydratedText(parentInstance, text);\n }\n }\n}\nfunction errorHydratingContainer(parentContainer) {\n {\n // TODO: This gets logged by onRecoverableError, too, so we should be\n // able to remove it.\n error('An error occurred during hydration. The server HTML was replaced with client content in <%s>.', parentContainer.nodeName.toLowerCase());\n }\n}\nfunction preparePortalMount(portalInstance) {\n listenToAllSupportedEvents(portalInstance);\n}\n\nvar randomKey = Math.random().toString(36).slice(2);\nvar internalInstanceKey = '__reactFiber$' + randomKey;\nvar internalPropsKey = '__reactProps$' + randomKey;\nvar internalContainerInstanceKey = '__reactContainer$' + randomKey;\nvar internalEventHandlersKey = '__reactEvents$' + randomKey;\nvar internalEventHandlerListenersKey = '__reactListeners$' + randomKey;\nvar internalEventHandlesSetKey = '__reactHandles$' + randomKey;\nfunction detachDeletedInstance(node) {\n // TODO: This function is only called on host components. I don't think all of\n // these fields are relevant.\n delete node[internalInstanceKey];\n delete node[internalPropsKey];\n delete node[internalEventHandlersKey];\n delete node[internalEventHandlerListenersKey];\n delete node[internalEventHandlesSetKey];\n}\nfunction precacheFiberNode(hostInst, node) {\n node[internalInstanceKey] = hostInst;\n}\nfunction markContainerAsRoot(hostRoot, node) {\n node[internalContainerInstanceKey] = hostRoot;\n}\nfunction unmarkContainerAsRoot(node) {\n node[internalContainerInstanceKey] = null;\n}\nfunction isContainerMarkedAsRoot(node) {\n return !!node[internalContainerInstanceKey];\n} // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.\n// If the target node is part of a hydrated or not yet rendered subtree, then\n// this may also return a SuspenseComponent or HostRoot to indicate that.\n// Conceptually the HostRoot fiber is a child of the Container node. So if you\n// pass the Container node as the targetNode, you will not actually get the\n// HostRoot back. To get to the HostRoot, you need to pass a child of it.\n// The same thing applies to Suspense boundaries.\n\nfunction getClosestInstanceFromNode(targetNode) {\n var targetInst = targetNode[internalInstanceKey];\n\n if (targetInst) {\n // Don't return HostRoot or SuspenseComponent here.\n return targetInst;\n } // If the direct event target isn't a React owned DOM node, we need to look\n // to see if one of its parents is a React owned DOM node.\n\n\n var parentNode = targetNode.parentNode;\n\n while (parentNode) {\n // We'll check if this is a container root that could include\n // React nodes in the future. We need to check this first because\n // if we're a child of a dehydrated container, we need to first\n // find that inner container before moving on to finding the parent\n // instance. Note that we don't check this field on the targetNode\n // itself because the fibers are conceptually between the container\n // node and the first child. It isn't surrounding the container node.\n // If it's not a container, we check if it's an instance.\n targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];\n\n if (targetInst) {\n // Since this wasn't the direct target of the event, we might have\n // stepped past dehydrated DOM nodes to get here. However they could\n // also have been non-React nodes. We need to answer which one.\n // If we the instance doesn't have any children, then there can't be\n // a nested suspense boundary within it. So we can use this as a fast\n // bailout. Most of the time, when people add non-React children to\n // the tree, it is using a ref to a child-less DOM node.\n // Normally we'd only need to check one of the fibers because if it\n // has ever gone from having children to deleting them or vice versa\n // it would have deleted the dehydrated boundary nested inside already.\n // However, since the HostRoot starts out with an alternate it might\n // have one on the alternate so we need to check in case this was a\n // root.\n var alternate = targetInst.alternate;\n\n if (targetInst.child !== null || alternate !== null && alternate.child !== null) {\n // Next we need to figure out if the node that skipped past is\n // nested within a dehydrated boundary and if so, which one.\n var suspenseInstance = getParentSuspenseInstance(targetNode);\n\n while (suspenseInstance !== null) {\n // We found a suspense instance. That means that we haven't\n // hydrated it yet. Even though we leave the comments in the\n // DOM after hydrating, and there are boundaries in the DOM\n // that could already be hydrated, we wouldn't have found them\n // through this pass since if the target is hydrated it would\n // have had an internalInstanceKey on it.\n // Let's get the fiber associated with the SuspenseComponent\n // as the deepest instance.\n var targetSuspenseInst = suspenseInstance[internalInstanceKey];\n\n if (targetSuspenseInst) {\n return targetSuspenseInst;\n } // If we don't find a Fiber on the comment, it might be because\n // we haven't gotten to hydrate it yet. There might still be a\n // parent boundary that hasn't above this one so we need to find\n // the outer most that is known.\n\n\n suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent\n // host component also hasn't hydrated yet. We can return it\n // below since it will bail out on the isMounted check later.\n }\n }\n\n return targetInst;\n }\n\n targetNode = parentNode;\n parentNode = targetNode.parentNode;\n }\n\n return null;\n}\n/**\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\n * instance, or null if the node was not rendered by this React.\n */\n\nfunction getInstanceFromNode(node) {\n var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];\n\n if (inst) {\n if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {\n return inst;\n } else {\n return null;\n }\n }\n\n return null;\n}\n/**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n */\n\nfunction getNodeFromInstance(inst) {\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber this, is just the state node right now. We assume it will be\n // a host component or host text.\n return inst.stateNode;\n } // Without this first invariant, passing a non-DOM-component triggers the next\n // invariant for a missing parent, which is super confusing.\n\n\n throw new Error('getNodeFromInstance: Invalid argument.');\n}\nfunction getFiberCurrentPropsFromNode(node) {\n return node[internalPropsKey] || null;\n}\nfunction updateFiberProps(node, props) {\n node[internalPropsKey] = props;\n}\nfunction getEventListenerSet(node) {\n var elementListenerSet = node[internalEventHandlersKey];\n\n if (elementListenerSet === undefined) {\n elementListenerSet = node[internalEventHandlersKey] = new Set();\n }\n\n return elementListenerSet;\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar valueStack = [];\nvar fiberStack;\n\n{\n fiberStack = [];\n}\n\nvar index = -1;\n\nfunction createCursor(defaultValue) {\n return {\n current: defaultValue\n };\n}\n\nfunction pop(cursor, fiber) {\n if (index < 0) {\n {\n error('Unexpected pop.');\n }\n\n return;\n }\n\n {\n if (fiber !== fiberStack[index]) {\n error('Unexpected Fiber popped.');\n }\n }\n\n cursor.current = valueStack[index];\n valueStack[index] = null;\n\n {\n fiberStack[index] = null;\n }\n\n index--;\n}\n\nfunction push(cursor, value, fiber) {\n index++;\n valueStack[index] = cursor.current;\n\n {\n fiberStack[index] = fiber;\n }\n\n cursor.current = value;\n}\n\nvar warnedAboutMissingGetChildContext;\n\n{\n warnedAboutMissingGetChildContext = {};\n}\n\nvar emptyContextObject = {};\n\n{\n Object.freeze(emptyContextObject);\n} // A cursor to the current merged context object on the stack.\n\n\nvar contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.\n\nvar didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.\n// We use this to get access to the parent context after we have already\n// pushed the next context provider, and now need to merge their contexts.\n\nvar previousContext = emptyContextObject;\n\nfunction getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {\n {\n if (didPushOwnContextIfProvider && isContextProvider(Component)) {\n // If the fiber is a context provider itself, when we read its context\n // we may have already pushed its own child context on the stack. A context\n // provider should not \"see\" its own child context. Therefore we read the\n // previous (parent) context instead for a context provider.\n return previousContext;\n }\n\n return contextStackCursor.current;\n }\n}\n\nfunction cacheContext(workInProgress, unmaskedContext, maskedContext) {\n {\n var instance = workInProgress.stateNode;\n instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;\n instance.__reactInternalMemoizedMaskedChildContext = maskedContext;\n }\n}\n\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n {\n var type = workInProgress.type;\n var contextTypes = type.contextTypes;\n\n if (!contextTypes) {\n return emptyContextObject;\n } // Avoid recreating masked context unless unmasked context has changed.\n // Failing to do this will result in unnecessary calls to componentWillReceiveProps.\n // This may trigger infinite loops if componentWillReceiveProps calls setState.\n\n\n var instance = workInProgress.stateNode;\n\n if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {\n return instance.__reactInternalMemoizedMaskedChildContext;\n }\n\n var context = {};\n\n for (var key in contextTypes) {\n context[key] = unmaskedContext[key];\n }\n\n {\n var name = getComponentNameFromFiber(workInProgress) || 'Unknown';\n checkPropTypes(contextTypes, context, 'context', name);\n } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n // Context is created before the class component is instantiated so check for instance.\n\n\n if (instance) {\n cacheContext(workInProgress, unmaskedContext, context);\n }\n\n return context;\n }\n}\n\nfunction hasContextChanged() {\n {\n return didPerformWorkStackCursor.current;\n }\n}\n\nfunction isContextProvider(type) {\n {\n var childContextTypes = type.childContextTypes;\n return childContextTypes !== null && childContextTypes !== undefined;\n }\n}\n\nfunction popContext(fiber) {\n {\n pop(didPerformWorkStackCursor, fiber);\n pop(contextStackCursor, fiber);\n }\n}\n\nfunction popTopLevelContextObject(fiber) {\n {\n pop(didPerformWorkStackCursor, fiber);\n pop(contextStackCursor, fiber);\n }\n}\n\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n {\n if (contextStackCursor.current !== emptyContextObject) {\n throw new Error('Unexpected context found on stack. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n\n push(contextStackCursor, context, fiber);\n push(didPerformWorkStackCursor, didChange, fiber);\n }\n}\n\nfunction processChildContext(fiber, type, parentContext) {\n {\n var instance = fiber.stateNode;\n var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.\n // It has only been added in Fiber to match the (unintentional) behavior in Stack.\n\n if (typeof instance.getChildContext !== 'function') {\n {\n var componentName = getComponentNameFromFiber(fiber) || 'Unknown';\n\n if (!warnedAboutMissingGetChildContext[componentName]) {\n warnedAboutMissingGetChildContext[componentName] = true;\n\n error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);\n }\n }\n\n return parentContext;\n }\n\n var childContext = instance.getChildContext();\n\n for (var contextKey in childContext) {\n if (!(contextKey in childContextTypes)) {\n throw new Error((getComponentNameFromFiber(fiber) || 'Unknown') + \".getChildContext(): key \\\"\" + contextKey + \"\\\" is not defined in childContextTypes.\");\n }\n }\n\n {\n var name = getComponentNameFromFiber(fiber) || 'Unknown';\n checkPropTypes(childContextTypes, childContext, 'child context', name);\n }\n\n return assign({}, parentContext, childContext);\n }\n}\n\nfunction pushContextProvider(workInProgress) {\n {\n var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.\n // If the instance does not exist yet, we will push null at first,\n // and replace it on the stack later when invalidating the context.\n\n var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.\n // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.\n\n previousContext = contextStackCursor.current;\n push(contextStackCursor, memoizedMergedChildContext, workInProgress);\n push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);\n return true;\n }\n}\n\nfunction invalidateContextProvider(workInProgress, type, didChange) {\n {\n var instance = workInProgress.stateNode;\n\n if (!instance) {\n throw new Error('Expected to have an instance by this point. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n\n if (didChange) {\n // Merge parent and own context.\n // Skip this if we're not updating due to sCU.\n // This avoids unnecessarily recomputing memoized values.\n var mergedContext = processChildContext(workInProgress, type, previousContext);\n instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.\n // It is important to unwind the context in the reverse order.\n\n pop(didPerformWorkStackCursor, workInProgress);\n pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.\n\n push(contextStackCursor, mergedContext, workInProgress);\n push(didPerformWorkStackCursor, didChange, workInProgress);\n } else {\n pop(didPerformWorkStackCursor, workInProgress);\n push(didPerformWorkStackCursor, didChange, workInProgress);\n }\n }\n}\n\nfunction findCurrentUnmaskedContext(fiber) {\n {\n // Currently this is only used with renderSubtreeIntoContainer; not sure if it\n // makes sense elsewhere\n if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) {\n throw new Error('Expected subtree parent to be a mounted class component. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n\n var node = fiber;\n\n do {\n switch (node.tag) {\n case HostRoot:\n return node.stateNode.context;\n\n case ClassComponent:\n {\n var Component = node.type;\n\n if (isContextProvider(Component)) {\n return node.stateNode.__reactInternalMemoizedMergedChildContext;\n }\n\n break;\n }\n }\n\n node = node.return;\n } while (node !== null);\n\n throw new Error('Found unexpected detached subtree parent. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n}\n\nvar LegacyRoot = 0;\nvar ConcurrentRoot = 1;\n\nvar syncQueue = null;\nvar includesLegacySyncCallbacks = false;\nvar isFlushingSyncQueue = false;\nfunction scheduleSyncCallback(callback) {\n // Push this callback into an internal queue. We'll flush these either in\n // the next tick, or earlier if something calls `flushSyncCallbackQueue`.\n if (syncQueue === null) {\n syncQueue = [callback];\n } else {\n // Push onto existing queue. Don't need to schedule a callback because\n // we already scheduled one when we created the queue.\n syncQueue.push(callback);\n }\n}\nfunction scheduleLegacySyncCallback(callback) {\n includesLegacySyncCallbacks = true;\n scheduleSyncCallback(callback);\n}\nfunction flushSyncCallbacksOnlyInLegacyMode() {\n // Only flushes the queue if there's a legacy sync callback scheduled.\n // TODO: There's only a single type of callback: performSyncOnWorkOnRoot. So\n // it might make more sense for the queue to be a list of roots instead of a\n // list of generic callbacks. Then we can have two: one for legacy roots, one\n // for concurrent roots. And this method would only flush the legacy ones.\n if (includesLegacySyncCallbacks) {\n flushSyncCallbacks();\n }\n}\nfunction flushSyncCallbacks() {\n if (!isFlushingSyncQueue && syncQueue !== null) {\n // Prevent re-entrance.\n isFlushingSyncQueue = true;\n var i = 0;\n var previousUpdatePriority = getCurrentUpdatePriority();\n\n try {\n var isSync = true;\n var queue = syncQueue; // TODO: Is this necessary anymore? The only user code that runs in this\n // queue is in the render or commit phases.\n\n setCurrentUpdatePriority(DiscreteEventPriority);\n\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(isSync);\n } while (callback !== null);\n }\n\n syncQueue = null;\n includesLegacySyncCallbacks = false;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n if (syncQueue !== null) {\n syncQueue = syncQueue.slice(i + 1);\n } // Resume flushing in the next tick\n\n\n scheduleCallback(ImmediatePriority, flushSyncCallbacks);\n throw error;\n } finally {\n setCurrentUpdatePriority(previousUpdatePriority);\n isFlushingSyncQueue = false;\n }\n }\n\n return null;\n}\n\n// TODO: Use the unified fiber stack module instead of this local one?\n// Intentionally not using it yet to derisk the initial implementation, because\n// the way we push/pop these values is a bit unusual. If there's a mistake, I'd\n// rather the ids be wrong than crash the whole reconciler.\nvar forkStack = [];\nvar forkStackIndex = 0;\nvar treeForkProvider = null;\nvar treeForkCount = 0;\nvar idStack = [];\nvar idStackIndex = 0;\nvar treeContextProvider = null;\nvar treeContextId = 1;\nvar treeContextOverflow = '';\nfunction isForkedChild(workInProgress) {\n warnIfNotHydrating();\n return (workInProgress.flags & Forked) !== NoFlags;\n}\nfunction getForksAtLevel(workInProgress) {\n warnIfNotHydrating();\n return treeForkCount;\n}\nfunction getTreeId() {\n var overflow = treeContextOverflow;\n var idWithLeadingBit = treeContextId;\n var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);\n return id.toString(32) + overflow;\n}\nfunction pushTreeFork(workInProgress, totalChildren) {\n // This is called right after we reconcile an array (or iterator) of child\n // fibers, because that's the only place where we know how many children in\n // the whole set without doing extra work later, or storing addtional\n // information on the fiber.\n //\n // That's why this function is separate from pushTreeId — it's called during\n // the render phase of the fork parent, not the child, which is where we push\n // the other context values.\n //\n // In the Fizz implementation this is much simpler because the child is\n // rendered in the same callstack as the parent.\n //\n // It might be better to just add a `forks` field to the Fiber type. It would\n // make this module simpler.\n warnIfNotHydrating();\n forkStack[forkStackIndex++] = treeForkCount;\n forkStack[forkStackIndex++] = treeForkProvider;\n treeForkProvider = workInProgress;\n treeForkCount = totalChildren;\n}\nfunction pushTreeId(workInProgress, totalChildren, index) {\n warnIfNotHydrating();\n idStack[idStackIndex++] = treeContextId;\n idStack[idStackIndex++] = treeContextOverflow;\n idStack[idStackIndex++] = treeContextProvider;\n treeContextProvider = workInProgress;\n var baseIdWithLeadingBit = treeContextId;\n var baseOverflow = treeContextOverflow; // The leftmost 1 marks the end of the sequence, non-inclusive. It's not part\n // of the id; we use it to account for leading 0s.\n\n var baseLength = getBitLength(baseIdWithLeadingBit) - 1;\n var baseId = baseIdWithLeadingBit & ~(1 << baseLength);\n var slot = index + 1;\n var length = getBitLength(totalChildren) + baseLength; // 30 is the max length we can store without overflowing, taking into\n // consideration the leading 1 we use to mark the end of the sequence.\n\n if (length > 30) {\n // We overflowed the bitwise-safe range. Fall back to slower algorithm.\n // This branch assumes the length of the base id is greater than 5; it won't\n // work for smaller ids, because you need 5 bits per character.\n //\n // We encode the id in multiple steps: first the base id, then the\n // remaining digits.\n //\n // Each 5 bit sequence corresponds to a single base 32 character. So for\n // example, if the current id is 23 bits long, we can convert 20 of those\n // bits into a string of 4 characters, with 3 bits left over.\n //\n // First calculate how many bits in the base id represent a complete\n // sequence of characters.\n var numberOfOverflowBits = baseLength - baseLength % 5; // Then create a bitmask that selects only those bits.\n\n var newOverflowBits = (1 << numberOfOverflowBits) - 1; // Select the bits, and convert them to a base 32 string.\n\n var newOverflow = (baseId & newOverflowBits).toString(32); // Now we can remove those bits from the base id.\n\n var restOfBaseId = baseId >> numberOfOverflowBits;\n var restOfBaseLength = baseLength - numberOfOverflowBits; // Finally, encode the rest of the bits using the normal algorithm. Because\n // we made more room, this time it won't overflow.\n\n var restOfLength = getBitLength(totalChildren) + restOfBaseLength;\n var restOfNewBits = slot << restOfBaseLength;\n var id = restOfNewBits | restOfBaseId;\n var overflow = newOverflow + baseOverflow;\n treeContextId = 1 << restOfLength | id;\n treeContextOverflow = overflow;\n } else {\n // Normal path\n var newBits = slot << baseLength;\n\n var _id = newBits | baseId;\n\n var _overflow = baseOverflow;\n treeContextId = 1 << length | _id;\n treeContextOverflow = _overflow;\n }\n}\nfunction pushMaterializedTreeId(workInProgress) {\n warnIfNotHydrating(); // This component materialized an id. This will affect any ids that appear\n // in its children.\n\n var returnFiber = workInProgress.return;\n\n if (returnFiber !== null) {\n var numberOfForks = 1;\n var slotIndex = 0;\n pushTreeFork(workInProgress, numberOfForks);\n pushTreeId(workInProgress, numberOfForks, slotIndex);\n }\n}\n\nfunction getBitLength(number) {\n return 32 - clz32(number);\n}\n\nfunction getLeadingBit(id) {\n return 1 << getBitLength(id) - 1;\n}\n\nfunction popTreeContext(workInProgress) {\n // Restore the previous values.\n // This is a bit more complicated than other context-like modules in Fiber\n // because the same Fiber may appear on the stack multiple times and for\n // different reasons. We have to keep popping until the work-in-progress is\n // no longer at the top of the stack.\n while (workInProgress === treeForkProvider) {\n treeForkProvider = forkStack[--forkStackIndex];\n forkStack[forkStackIndex] = null;\n treeForkCount = forkStack[--forkStackIndex];\n forkStack[forkStackIndex] = null;\n }\n\n while (workInProgress === treeContextProvider) {\n treeContextProvider = idStack[--idStackIndex];\n idStack[idStackIndex] = null;\n treeContextOverflow = idStack[--idStackIndex];\n idStack[idStackIndex] = null;\n treeContextId = idStack[--idStackIndex];\n idStack[idStackIndex] = null;\n }\n}\nfunction getSuspendedTreeContext() {\n warnIfNotHydrating();\n\n if (treeContextProvider !== null) {\n return {\n id: treeContextId,\n overflow: treeContextOverflow\n };\n } else {\n return null;\n }\n}\nfunction restoreSuspendedTreeContext(workInProgress, suspendedContext) {\n warnIfNotHydrating();\n idStack[idStackIndex++] = treeContextId;\n idStack[idStackIndex++] = treeContextOverflow;\n idStack[idStackIndex++] = treeContextProvider;\n treeContextId = suspendedContext.id;\n treeContextOverflow = suspendedContext.overflow;\n treeContextProvider = workInProgress;\n}\n\nfunction warnIfNotHydrating() {\n {\n if (!getIsHydrating()) {\n error('Expected to be hydrating. This is a bug in React. Please file ' + 'an issue.');\n }\n }\n}\n\n// This may have been an insertion or a hydration.\n\nvar hydrationParentFiber = null;\nvar nextHydratableInstance = null;\nvar isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches\n// due to earlier mismatches or a suspended fiber.\n\nvar didSuspendOrErrorDEV = false; // Hydration errors that were thrown inside this boundary\n\nvar hydrationErrors = null;\n\nfunction warnIfHydrating() {\n {\n if (isHydrating) {\n error('We should not be hydrating here. This is a bug in React. Please file a bug.');\n }\n }\n}\n\nfunction markDidThrowWhileHydratingDEV() {\n {\n didSuspendOrErrorDEV = true;\n }\n}\nfunction didSuspendOrErrorWhileHydratingDEV() {\n {\n return didSuspendOrErrorDEV;\n }\n}\n\nfunction enterHydrationState(fiber) {\n\n var parentInstance = fiber.stateNode.containerInfo;\n nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance);\n hydrationParentFiber = fiber;\n isHydrating = true;\n hydrationErrors = null;\n didSuspendOrErrorDEV = false;\n return true;\n}\n\nfunction reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) {\n\n nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);\n hydrationParentFiber = fiber;\n isHydrating = true;\n hydrationErrors = null;\n didSuspendOrErrorDEV = false;\n\n if (treeContext !== null) {\n restoreSuspendedTreeContext(fiber, treeContext);\n }\n\n return true;\n}\n\nfunction warnUnhydratedInstance(returnFiber, instance) {\n {\n switch (returnFiber.tag) {\n case HostRoot:\n {\n didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance);\n break;\n }\n\n case HostComponent:\n {\n var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;\n didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance, // TODO: Delete this argument when we remove the legacy root API.\n isConcurrentMode);\n break;\n }\n\n case SuspenseComponent:\n {\n var suspenseState = returnFiber.memoizedState;\n if (suspenseState.dehydrated !== null) didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance);\n break;\n }\n }\n }\n}\n\nfunction deleteHydratableInstance(returnFiber, instance) {\n warnUnhydratedInstance(returnFiber, instance);\n var childToDelete = createFiberFromHostInstanceForDeletion();\n childToDelete.stateNode = instance;\n childToDelete.return = returnFiber;\n var deletions = returnFiber.deletions;\n\n if (deletions === null) {\n returnFiber.deletions = [childToDelete];\n returnFiber.flags |= ChildDeletion;\n } else {\n deletions.push(childToDelete);\n }\n}\n\nfunction warnNonhydratedInstance(returnFiber, fiber) {\n {\n if (didSuspendOrErrorDEV) {\n // Inside a boundary that already suspended. We're currently rendering the\n // siblings of a suspended node. The mismatch may be due to the missing\n // data, so it's probably a false positive.\n return;\n }\n\n switch (returnFiber.tag) {\n case HostRoot:\n {\n var parentContainer = returnFiber.stateNode.containerInfo;\n\n switch (fiber.tag) {\n case HostComponent:\n var type = fiber.type;\n var props = fiber.pendingProps;\n didNotFindHydratableInstanceWithinContainer(parentContainer, type);\n break;\n\n case HostText:\n var text = fiber.pendingProps;\n didNotFindHydratableTextInstanceWithinContainer(parentContainer, text);\n break;\n }\n\n break;\n }\n\n case HostComponent:\n {\n var parentType = returnFiber.type;\n var parentProps = returnFiber.memoizedProps;\n var parentInstance = returnFiber.stateNode;\n\n switch (fiber.tag) {\n case HostComponent:\n {\n var _type = fiber.type;\n var _props = fiber.pendingProps;\n var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;\n didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props, // TODO: Delete this argument when we remove the legacy root API.\n isConcurrentMode);\n break;\n }\n\n case HostText:\n {\n var _text = fiber.pendingProps;\n\n var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;\n\n didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text, // TODO: Delete this argument when we remove the legacy root API.\n _isConcurrentMode);\n break;\n }\n }\n\n break;\n }\n\n case SuspenseComponent:\n {\n var suspenseState = returnFiber.memoizedState;\n var _parentInstance = suspenseState.dehydrated;\n if (_parentInstance !== null) switch (fiber.tag) {\n case HostComponent:\n var _type2 = fiber.type;\n var _props2 = fiber.pendingProps;\n didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2);\n break;\n\n case HostText:\n var _text2 = fiber.pendingProps;\n didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2);\n break;\n }\n break;\n }\n\n default:\n return;\n }\n }\n}\n\nfunction insertNonHydratedInstance(returnFiber, fiber) {\n fiber.flags = fiber.flags & ~Hydrating | Placement;\n warnNonhydratedInstance(returnFiber, fiber);\n}\n\nfunction tryHydrate(fiber, nextInstance) {\n switch (fiber.tag) {\n case HostComponent:\n {\n var type = fiber.type;\n var props = fiber.pendingProps;\n var instance = canHydrateInstance(nextInstance, type);\n\n if (instance !== null) {\n fiber.stateNode = instance;\n hydrationParentFiber = fiber;\n nextHydratableInstance = getFirstHydratableChild(instance);\n return true;\n }\n\n return false;\n }\n\n case HostText:\n {\n var text = fiber.pendingProps;\n var textInstance = canHydrateTextInstance(nextInstance, text);\n\n if (textInstance !== null) {\n fiber.stateNode = textInstance;\n hydrationParentFiber = fiber; // Text Instances don't have children so there's nothing to hydrate.\n\n nextHydratableInstance = null;\n return true;\n }\n\n return false;\n }\n\n case SuspenseComponent:\n {\n var suspenseInstance = canHydrateSuspenseInstance(nextInstance);\n\n if (suspenseInstance !== null) {\n var suspenseState = {\n dehydrated: suspenseInstance,\n treeContext: getSuspendedTreeContext(),\n retryLane: OffscreenLane\n };\n fiber.memoizedState = suspenseState; // Store the dehydrated fragment as a child fiber.\n // This simplifies the code for getHostSibling and deleting nodes,\n // since it doesn't have to consider all Suspense boundaries and\n // check if they're dehydrated ones or not.\n\n var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);\n dehydratedFragment.return = fiber;\n fiber.child = dehydratedFragment;\n hydrationParentFiber = fiber; // While a Suspense Instance does have children, we won't step into\n // it during the first pass. Instead, we'll reenter it later.\n\n nextHydratableInstance = null;\n return true;\n }\n\n return false;\n }\n\n default:\n return false;\n }\n}\n\nfunction shouldClientRenderOnMismatch(fiber) {\n return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags;\n}\n\nfunction throwOnHydrationMismatch(fiber) {\n throw new Error('Hydration failed because the initial UI does not match what was ' + 'rendered on the server.');\n}\n\nfunction tryToClaimNextHydratableInstance(fiber) {\n if (!isHydrating) {\n return;\n }\n\n var nextInstance = nextHydratableInstance;\n\n if (!nextInstance) {\n if (shouldClientRenderOnMismatch(fiber)) {\n warnNonhydratedInstance(hydrationParentFiber, fiber);\n throwOnHydrationMismatch();\n } // Nothing to hydrate. Make it an insertion.\n\n\n insertNonHydratedInstance(hydrationParentFiber, fiber);\n isHydrating = false;\n hydrationParentFiber = fiber;\n return;\n }\n\n var firstAttemptedInstance = nextInstance;\n\n if (!tryHydrate(fiber, nextInstance)) {\n if (shouldClientRenderOnMismatch(fiber)) {\n warnNonhydratedInstance(hydrationParentFiber, fiber);\n throwOnHydrationMismatch();\n } // If we can't hydrate this instance let's try the next one.\n // We use this as a heuristic. It's based on intuition and not data so it\n // might be flawed or unnecessary.\n\n\n nextInstance = getNextHydratableSibling(firstAttemptedInstance);\n var prevHydrationParentFiber = hydrationParentFiber;\n\n if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n // Nothing to hydrate. Make it an insertion.\n insertNonHydratedInstance(hydrationParentFiber, fiber);\n isHydrating = false;\n hydrationParentFiber = fiber;\n return;\n } // We matched the next one, we'll now assume that the first one was\n // superfluous and we'll delete it. Since we can't eagerly delete it\n // we'll have to schedule a deletion. To do that, this node needs a dummy\n // fiber associated with it.\n\n\n deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance);\n }\n}\n\nfunction prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {\n\n var instance = fiber.stateNode;\n var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;\n var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev); // TODO: Type this specific to this type of component.\n\n fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n // is a new ref we mark this as an update.\n\n if (updatePayload !== null) {\n return true;\n }\n\n return false;\n}\n\nfunction prepareToHydrateHostTextInstance(fiber) {\n\n var textInstance = fiber.stateNode;\n var textContent = fiber.memoizedProps;\n var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);\n\n if (shouldUpdate) {\n // We assume that prepareToHydrateHostTextInstance is called in a context where the\n // hydration parent is the parent host component of this host text.\n var returnFiber = hydrationParentFiber;\n\n if (returnFiber !== null) {\n switch (returnFiber.tag) {\n case HostRoot:\n {\n var parentContainer = returnFiber.stateNode.containerInfo;\n var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;\n didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent, // TODO: Delete this argument when we remove the legacy root API.\n isConcurrentMode);\n break;\n }\n\n case HostComponent:\n {\n var parentType = returnFiber.type;\n var parentProps = returnFiber.memoizedProps;\n var parentInstance = returnFiber.stateNode;\n\n var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode;\n\n didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent, // TODO: Delete this argument when we remove the legacy root API.\n _isConcurrentMode2);\n break;\n }\n }\n }\n }\n\n return shouldUpdate;\n}\n\nfunction prepareToHydrateHostSuspenseInstance(fiber) {\n\n var suspenseState = fiber.memoizedState;\n var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;\n\n if (!suspenseInstance) {\n throw new Error('Expected to have a hydrated suspense instance. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n\n hydrateSuspenseInstance(suspenseInstance, fiber);\n}\n\nfunction skipPastDehydratedSuspenseInstance(fiber) {\n\n var suspenseState = fiber.memoizedState;\n var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;\n\n if (!suspenseInstance) {\n throw new Error('Expected to have a hydrated suspense instance. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n\n return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);\n}\n\nfunction popToNextHostParent(fiber) {\n var parent = fiber.return;\n\n while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {\n parent = parent.return;\n }\n\n hydrationParentFiber = parent;\n}\n\nfunction popHydrationState(fiber) {\n\n if (fiber !== hydrationParentFiber) {\n // We're deeper than the current hydration context, inside an inserted\n // tree.\n return false;\n }\n\n if (!isHydrating) {\n // If we're not currently hydrating but we're in a hydration context, then\n // we were an insertion and now need to pop up reenter hydration of our\n // siblings.\n popToNextHostParent(fiber);\n isHydrating = true;\n return false;\n } // If we have any remaining hydratable nodes, we need to delete them now.\n // We only do this deeper than head and body since they tend to have random\n // other nodes in them. We also ignore components with pure text content in\n // side of them. We also don't delete anything inside the root container.\n\n\n if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) {\n var nextInstance = nextHydratableInstance;\n\n if (nextInstance) {\n if (shouldClientRenderOnMismatch(fiber)) {\n warnIfUnhydratedTailNodes(fiber);\n throwOnHydrationMismatch();\n } else {\n while (nextInstance) {\n deleteHydratableInstance(fiber, nextInstance);\n nextInstance = getNextHydratableSibling(nextInstance);\n }\n }\n }\n }\n\n popToNextHostParent(fiber);\n\n if (fiber.tag === SuspenseComponent) {\n nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);\n } else {\n nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;\n }\n\n return true;\n}\n\nfunction hasUnhydratedTailNodes() {\n return isHydrating && nextHydratableInstance !== null;\n}\n\nfunction warnIfUnhydratedTailNodes(fiber) {\n var nextInstance = nextHydratableInstance;\n\n while (nextInstance) {\n warnUnhydratedInstance(fiber, nextInstance);\n nextInstance = getNextHydratableSibling(nextInstance);\n }\n}\n\nfunction resetHydrationState() {\n\n hydrationParentFiber = null;\n nextHydratableInstance = null;\n isHydrating = false;\n didSuspendOrErrorDEV = false;\n}\n\nfunction upgradeHydrationErrorsToRecoverable() {\n if (hydrationErrors !== null) {\n // Successfully completed a forced client render. The errors that occurred\n // during the hydration attempt are now recovered. We will log them in\n // commit phase, once the entire tree has finished.\n queueRecoverableErrors(hydrationErrors);\n hydrationErrors = null;\n }\n}\n\nfunction getIsHydrating() {\n return isHydrating;\n}\n\nfunction queueHydrationError(error) {\n if (hydrationErrors === null) {\n hydrationErrors = [error];\n } else {\n hydrationErrors.push(error);\n }\n}\n\nvar ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;\nvar NoTransition = null;\nfunction requestCurrentTransition() {\n return ReactCurrentBatchConfig$1.transition;\n}\n\nvar ReactStrictModeWarnings = {\n recordUnsafeLifecycleWarnings: function (fiber, instance) {},\n flushPendingUnsafeLifecycleWarnings: function () {},\n recordLegacyContextWarning: function (fiber, instance) {},\n flushLegacyContextWarning: function () {},\n discardPendingWarnings: function () {}\n};\n\n{\n var findStrictRoot = function (fiber) {\n var maybeStrictRoot = null;\n var node = fiber;\n\n while (node !== null) {\n if (node.mode & StrictLegacyMode) {\n maybeStrictRoot = node;\n }\n\n node = node.return;\n }\n\n return maybeStrictRoot;\n };\n\n var setToSortedString = function (set) {\n var array = [];\n set.forEach(function (value) {\n array.push(value);\n });\n return array.sort().join(', ');\n };\n\n var pendingComponentWillMountWarnings = [];\n var pendingUNSAFE_ComponentWillMountWarnings = [];\n var pendingComponentWillReceivePropsWarnings = [];\n var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n var pendingComponentWillUpdateWarnings = [];\n var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.\n\n var didWarnAboutUnsafeLifecycles = new Set();\n\n ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {\n // Dedupe strategy: Warn once per component.\n if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {\n return;\n }\n\n if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.\n instance.componentWillMount.__suppressDeprecationWarning !== true) {\n pendingComponentWillMountWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === 'function') {\n pendingUNSAFE_ComponentWillMountWarnings.push(fiber);\n }\n\n if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n pendingComponentWillReceivePropsWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);\n }\n\n if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n pendingComponentWillUpdateWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {\n pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);\n }\n };\n\n ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {\n // We do an initial pass to gather component names\n var componentWillMountUniqueNames = new Set();\n\n if (pendingComponentWillMountWarnings.length > 0) {\n pendingComponentWillMountWarnings.forEach(function (fiber) {\n componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillMountWarnings = [];\n }\n\n var UNSAFE_componentWillMountUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {\n pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {\n UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillMountWarnings = [];\n }\n\n var componentWillReceivePropsUniqueNames = new Set();\n\n if (pendingComponentWillReceivePropsWarnings.length > 0) {\n pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {\n componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillReceivePropsWarnings = [];\n }\n\n var UNSAFE_componentWillReceivePropsUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {\n pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {\n UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n }\n\n var componentWillUpdateUniqueNames = new Set();\n\n if (pendingComponentWillUpdateWarnings.length > 0) {\n pendingComponentWillUpdateWarnings.forEach(function (fiber) {\n componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillUpdateWarnings = [];\n }\n\n var UNSAFE_componentWillUpdateUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {\n pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {\n UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillUpdateWarnings = [];\n } // Finally, we flush all the warnings\n // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'\n\n\n if (UNSAFE_componentWillMountUniqueNames.size > 0) {\n var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);\n\n error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\\n\\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\\n' + '\\nPlease update the following components: %s', sortedNames);\n }\n\n if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {\n var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);\n\n error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + \"* If you're updating state whenever props change, \" + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\\n' + '\\nPlease update the following components: %s', _sortedNames);\n }\n\n if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {\n var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);\n\n error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + '\\nPlease update the following components: %s', _sortedNames2);\n }\n\n if (componentWillMountUniqueNames.size > 0) {\n var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);\n\n warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\\n\\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames3);\n }\n\n if (componentWillReceivePropsUniqueNames.size > 0) {\n var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);\n\n warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + \"* If you're updating state whenever props change, refactor your \" + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames4);\n }\n\n if (componentWillUpdateUniqueNames.size > 0) {\n var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);\n\n warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames5);\n }\n };\n\n var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.\n\n var didWarnAboutLegacyContext = new Set();\n\n ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {\n var strictRoot = findStrictRoot(fiber);\n\n if (strictRoot === null) {\n error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n\n return;\n } // Dedup strategy: Warn once per component.\n\n\n if (didWarnAboutLegacyContext.has(fiber.type)) {\n return;\n }\n\n var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);\n\n if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {\n if (warningsForRoot === undefined) {\n warningsForRoot = [];\n pendingLegacyContextWarning.set(strictRoot, warningsForRoot);\n }\n\n warningsForRoot.push(fiber);\n }\n };\n\n ReactStrictModeWarnings.flushLegacyContextWarning = function () {\n pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {\n if (fiberArray.length === 0) {\n return;\n }\n\n var firstFiber = fiberArray[0];\n var uniqueNames = new Set();\n fiberArray.forEach(function (fiber) {\n uniqueNames.add(getComponentNameFromFiber(fiber) || 'Component');\n didWarnAboutLegacyContext.add(fiber.type);\n });\n var sortedNames = setToSortedString(uniqueNames);\n\n try {\n setCurrentFiber(firstFiber);\n\n error('Legacy context API has been detected within a strict-mode tree.' + '\\n\\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\\n\\nPlease update the following components: %s' + '\\n\\nLearn more about this warning here: https://reactjs.org/link/legacy-context', sortedNames);\n } finally {\n resetCurrentFiber();\n }\n });\n };\n\n ReactStrictModeWarnings.discardPendingWarnings = function () {\n pendingComponentWillMountWarnings = [];\n pendingUNSAFE_ComponentWillMountWarnings = [];\n pendingComponentWillReceivePropsWarnings = [];\n pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n pendingComponentWillUpdateWarnings = [];\n pendingUNSAFE_ComponentWillUpdateWarnings = [];\n pendingLegacyContextWarning = new Map();\n };\n}\n\nfunction resolveDefaultProps(Component, baseProps) {\n if (Component && Component.defaultProps) {\n // Resolve default props. Taken from ReactElement\n var props = assign({}, baseProps);\n var defaultProps = Component.defaultProps;\n\n for (var propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n\n return props;\n }\n\n return baseProps;\n}\n\nvar valueCursor = createCursor(null);\nvar rendererSigil;\n\n{\n // Use this to detect multiple renderers using the same context\n rendererSigil = {};\n}\n\nvar currentlyRenderingFiber = null;\nvar lastContextDependency = null;\nvar lastFullyObservedContext = null;\nvar isDisallowedContextReadInDEV = false;\nfunction resetContextDependencies() {\n // This is called right before React yields execution, to ensure `readContext`\n // cannot be called outside the render phase.\n currentlyRenderingFiber = null;\n lastContextDependency = null;\n lastFullyObservedContext = null;\n\n {\n isDisallowedContextReadInDEV = false;\n }\n}\nfunction enterDisallowedContextReadInDEV() {\n {\n isDisallowedContextReadInDEV = true;\n }\n}\nfunction exitDisallowedContextReadInDEV() {\n {\n isDisallowedContextReadInDEV = false;\n }\n}\nfunction pushProvider(providerFiber, context, nextValue) {\n {\n push(valueCursor, context._currentValue, providerFiber);\n context._currentValue = nextValue;\n\n {\n if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {\n error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');\n }\n\n context._currentRenderer = rendererSigil;\n }\n }\n}\nfunction popProvider(context, providerFiber) {\n var currentValue = valueCursor.current;\n pop(valueCursor, providerFiber);\n\n {\n {\n context._currentValue = currentValue;\n }\n }\n}\nfunction scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {\n // Update the child lanes of all the ancestors, including the alternates.\n var node = parent;\n\n while (node !== null) {\n var alternate = node.alternate;\n\n if (!isSubsetOfLanes(node.childLanes, renderLanes)) {\n node.childLanes = mergeLanes(node.childLanes, renderLanes);\n\n if (alternate !== null) {\n alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);\n }\n } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) {\n alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);\n }\n\n if (node === propagationRoot) {\n break;\n }\n\n node = node.return;\n }\n\n {\n if (node !== propagationRoot) {\n error('Expected to find the propagation root when scheduling context work. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n }\n}\nfunction propagateContextChange(workInProgress, context, renderLanes) {\n {\n propagateContextChange_eager(workInProgress, context, renderLanes);\n }\n}\n\nfunction propagateContextChange_eager(workInProgress, context, renderLanes) {\n\n var fiber = workInProgress.child;\n\n if (fiber !== null) {\n // Set the return pointer of the child to the work-in-progress fiber.\n fiber.return = workInProgress;\n }\n\n while (fiber !== null) {\n var nextFiber = void 0; // Visit this fiber.\n\n var list = fiber.dependencies;\n\n if (list !== null) {\n nextFiber = fiber.child;\n var dependency = list.firstContext;\n\n while (dependency !== null) {\n // Check if the context matches.\n if (dependency.context === context) {\n // Match! Schedule an update on this fiber.\n if (fiber.tag === ClassComponent) {\n // Schedule a force update on the work-in-progress.\n var lane = pickArbitraryLane(renderLanes);\n var update = createUpdate(NoTimestamp, lane);\n update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the\n // update to the current fiber, too, which means it will persist even if\n // this render is thrown away. Since it's a race condition, not sure it's\n // worth fixing.\n // Inlined `enqueueUpdate` to remove interleaved update check\n\n var updateQueue = fiber.updateQueue;\n\n if (updateQueue === null) ; else {\n var sharedQueue = updateQueue.shared;\n var pending = sharedQueue.pending;\n\n if (pending === null) {\n // This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n sharedQueue.pending = update;\n }\n }\n\n fiber.lanes = mergeLanes(fiber.lanes, renderLanes);\n var alternate = fiber.alternate;\n\n if (alternate !== null) {\n alternate.lanes = mergeLanes(alternate.lanes, renderLanes);\n }\n\n scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress); // Mark the updated lanes on the list, too.\n\n list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the\n // dependency list.\n\n break;\n }\n\n dependency = dependency.next;\n }\n } else if (fiber.tag === ContextProvider) {\n // Don't scan deeper if this is a matching provider\n nextFiber = fiber.type === workInProgress.type ? null : fiber.child;\n } else if (fiber.tag === DehydratedFragment) {\n // If a dehydrated suspense boundary is in this subtree, we don't know\n // if it will have any context consumers in it. The best we can do is\n // mark it as having updates.\n var parentSuspense = fiber.return;\n\n if (parentSuspense === null) {\n throw new Error('We just came from a parent so we must have had a parent. This is a bug in React.');\n }\n\n parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes);\n var _alternate = parentSuspense.alternate;\n\n if (_alternate !== null) {\n _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes);\n } // This is intentionally passing this fiber as the parent\n // because we want to schedule this fiber as having work\n // on its children. We'll use the childLanes on\n // this fiber to indicate that a context has changed.\n\n\n scheduleContextWorkOnParentPath(parentSuspense, renderLanes, workInProgress);\n nextFiber = fiber.sibling;\n } else {\n // Traverse down.\n nextFiber = fiber.child;\n }\n\n if (nextFiber !== null) {\n // Set the return pointer of the child to the work-in-progress fiber.\n nextFiber.return = fiber;\n } else {\n // No child. Traverse to next sibling.\n nextFiber = fiber;\n\n while (nextFiber !== null) {\n if (nextFiber === workInProgress) {\n // We're back to the root of this subtree. Exit.\n nextFiber = null;\n break;\n }\n\n var sibling = nextFiber.sibling;\n\n if (sibling !== null) {\n // Set the return pointer of the sibling to the work-in-progress fiber.\n sibling.return = nextFiber.return;\n nextFiber = sibling;\n break;\n } // No more siblings. Traverse up.\n\n\n nextFiber = nextFiber.return;\n }\n }\n\n fiber = nextFiber;\n }\n}\nfunction prepareToReadContext(workInProgress, renderLanes) {\n currentlyRenderingFiber = workInProgress;\n lastContextDependency = null;\n lastFullyObservedContext = null;\n var dependencies = workInProgress.dependencies;\n\n if (dependencies !== null) {\n {\n var firstContext = dependencies.firstContext;\n\n if (firstContext !== null) {\n if (includesSomeLane(dependencies.lanes, renderLanes)) {\n // Context list has a pending update. Mark that this fiber performed work.\n markWorkInProgressReceivedUpdate();\n } // Reset the work-in-progress list\n\n\n dependencies.firstContext = null;\n }\n }\n }\n}\nfunction readContext(context) {\n {\n // This warning would fire if you read context inside a Hook like useMemo.\n // Unlike the class check below, it's not enforced in production for perf.\n if (isDisallowedContextReadInDEV) {\n error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n }\n }\n\n var value = context._currentValue ;\n\n if (lastFullyObservedContext === context) ; else {\n var contextItem = {\n context: context,\n memoizedValue: value,\n next: null\n };\n\n if (lastContextDependency === null) {\n if (currentlyRenderingFiber === null) {\n throw new Error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n } // This is the first dependency for this component. Create a new list.\n\n\n lastContextDependency = contextItem;\n currentlyRenderingFiber.dependencies = {\n lanes: NoLanes,\n firstContext: contextItem\n };\n } else {\n // Append a new context item.\n lastContextDependency = lastContextDependency.next = contextItem;\n }\n }\n\n return value;\n}\n\n// render. When this render exits, either because it finishes or because it is\n// interrupted, the interleaved updates will be transferred onto the main part\n// of the queue.\n\nvar concurrentQueues = null;\nfunction pushConcurrentUpdateQueue(queue) {\n if (concurrentQueues === null) {\n concurrentQueues = [queue];\n } else {\n concurrentQueues.push(queue);\n }\n}\nfunction finishQueueingConcurrentUpdates() {\n // Transfer the interleaved updates onto the main queue. Each queue has a\n // `pending` field and an `interleaved` field. When they are not null, they\n // point to the last node in a circular linked list. We need to append the\n // interleaved list to the end of the pending list by joining them into a\n // single, circular list.\n if (concurrentQueues !== null) {\n for (var i = 0; i < concurrentQueues.length; i++) {\n var queue = concurrentQueues[i];\n var lastInterleavedUpdate = queue.interleaved;\n\n if (lastInterleavedUpdate !== null) {\n queue.interleaved = null;\n var firstInterleavedUpdate = lastInterleavedUpdate.next;\n var lastPendingUpdate = queue.pending;\n\n if (lastPendingUpdate !== null) {\n var firstPendingUpdate = lastPendingUpdate.next;\n lastPendingUpdate.next = firstInterleavedUpdate;\n lastInterleavedUpdate.next = firstPendingUpdate;\n }\n\n queue.pending = lastInterleavedUpdate;\n }\n }\n\n concurrentQueues = null;\n }\n}\nfunction enqueueConcurrentHookUpdate(fiber, queue, update, lane) {\n var interleaved = queue.interleaved;\n\n if (interleaved === null) {\n // This is the first update. Create a circular list.\n update.next = update; // At the end of the current render, this queue's interleaved updates will\n // be transferred to the pending queue.\n\n pushConcurrentUpdateQueue(queue);\n } else {\n update.next = interleaved.next;\n interleaved.next = update;\n }\n\n queue.interleaved = update;\n return markUpdateLaneFromFiberToRoot(fiber, lane);\n}\nfunction enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) {\n var interleaved = queue.interleaved;\n\n if (interleaved === null) {\n // This is the first update. Create a circular list.\n update.next = update; // At the end of the current render, this queue's interleaved updates will\n // be transferred to the pending queue.\n\n pushConcurrentUpdateQueue(queue);\n } else {\n update.next = interleaved.next;\n interleaved.next = update;\n }\n\n queue.interleaved = update;\n}\nfunction enqueueConcurrentClassUpdate(fiber, queue, update, lane) {\n var interleaved = queue.interleaved;\n\n if (interleaved === null) {\n // This is the first update. Create a circular list.\n update.next = update; // At the end of the current render, this queue's interleaved updates will\n // be transferred to the pending queue.\n\n pushConcurrentUpdateQueue(queue);\n } else {\n update.next = interleaved.next;\n interleaved.next = update;\n }\n\n queue.interleaved = update;\n return markUpdateLaneFromFiberToRoot(fiber, lane);\n}\nfunction enqueueConcurrentRenderForLane(fiber, lane) {\n return markUpdateLaneFromFiberToRoot(fiber, lane);\n} // Calling this function outside this module should only be done for backwards\n// compatibility and should always be accompanied by a warning.\n\nvar unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;\n\nfunction markUpdateLaneFromFiberToRoot(sourceFiber, lane) {\n // Update the source fiber's lanes\n sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);\n var alternate = sourceFiber.alternate;\n\n if (alternate !== null) {\n alternate.lanes = mergeLanes(alternate.lanes, lane);\n }\n\n {\n if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {\n warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);\n }\n } // Walk the parent path to the root and update the child lanes.\n\n\n var node = sourceFiber;\n var parent = sourceFiber.return;\n\n while (parent !== null) {\n parent.childLanes = mergeLanes(parent.childLanes, lane);\n alternate = parent.alternate;\n\n if (alternate !== null) {\n alternate.childLanes = mergeLanes(alternate.childLanes, lane);\n } else {\n {\n if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {\n warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);\n }\n }\n }\n\n node = parent;\n parent = parent.return;\n }\n\n if (node.tag === HostRoot) {\n var root = node.stateNode;\n return root;\n } else {\n return null;\n }\n}\n\nvar UpdateState = 0;\nvar ReplaceState = 1;\nvar ForceUpdate = 2;\nvar CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.\n// It should only be read right after calling `processUpdateQueue`, via\n// `checkHasForceUpdateAfterProcessing`.\n\nvar hasForceUpdate = false;\nvar didWarnUpdateInsideUpdate;\nvar currentlyProcessingQueue;\n\n{\n didWarnUpdateInsideUpdate = false;\n currentlyProcessingQueue = null;\n}\n\nfunction initializeUpdateQueue(fiber) {\n var queue = {\n baseState: fiber.memoizedState,\n firstBaseUpdate: null,\n lastBaseUpdate: null,\n shared: {\n pending: null,\n interleaved: null,\n lanes: NoLanes\n },\n effects: null\n };\n fiber.updateQueue = queue;\n}\nfunction cloneUpdateQueue(current, workInProgress) {\n // Clone the update queue from current. Unless it's already a clone.\n var queue = workInProgress.updateQueue;\n var currentQueue = current.updateQueue;\n\n if (queue === currentQueue) {\n var clone = {\n baseState: currentQueue.baseState,\n firstBaseUpdate: currentQueue.firstBaseUpdate,\n lastBaseUpdate: currentQueue.lastBaseUpdate,\n shared: currentQueue.shared,\n effects: currentQueue.effects\n };\n workInProgress.updateQueue = clone;\n }\n}\nfunction createUpdate(eventTime, lane) {\n var update = {\n eventTime: eventTime,\n lane: lane,\n tag: UpdateState,\n payload: null,\n callback: null,\n next: null\n };\n return update;\n}\nfunction enqueueUpdate(fiber, update, lane) {\n var updateQueue = fiber.updateQueue;\n\n if (updateQueue === null) {\n // Only occurs if the fiber has been unmounted.\n return null;\n }\n\n var sharedQueue = updateQueue.shared;\n\n {\n if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {\n error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');\n\n didWarnUpdateInsideUpdate = true;\n }\n }\n\n if (isUnsafeClassRenderPhaseUpdate()) {\n // This is an unsafe render phase update. Add directly to the update\n // queue so we can process it immediately during the current render.\n var pending = sharedQueue.pending;\n\n if (pending === null) {\n // This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n sharedQueue.pending = update; // Update the childLanes even though we're most likely already rendering\n // this fiber. This is for backwards compatibility in the case where you\n // update a different component during render phase than the one that is\n // currently renderings (a pattern that is accompanied by a warning).\n\n return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);\n } else {\n return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane);\n }\n}\nfunction entangleTransitions(root, fiber, lane) {\n var updateQueue = fiber.updateQueue;\n\n if (updateQueue === null) {\n // Only occurs if the fiber has been unmounted.\n return;\n }\n\n var sharedQueue = updateQueue.shared;\n\n if (isTransitionLane(lane)) {\n var queueLanes = sharedQueue.lanes; // If any entangled lanes are no longer pending on the root, then they must\n // have finished. We can remove them from the shared queue, which represents\n // a superset of the actually pending lanes. In some cases we may entangle\n // more than we need to, but that's OK. In fact it's worse if we *don't*\n // entangle when we should.\n\n queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes.\n\n var newQueueLanes = mergeLanes(queueLanes, lane);\n sharedQueue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if\n // the lane finished since the last time we entangled it. So we need to\n // entangle it again, just to be sure.\n\n markRootEntangled(root, newQueueLanes);\n }\n}\nfunction enqueueCapturedUpdate(workInProgress, capturedUpdate) {\n // Captured updates are updates that are thrown by a child during the render\n // phase. They should be discarded if the render is aborted. Therefore,\n // we should only put them on the work-in-progress queue, not the current one.\n var queue = workInProgress.updateQueue; // Check if the work-in-progress queue is a clone.\n\n var current = workInProgress.alternate;\n\n if (current !== null) {\n var currentQueue = current.updateQueue;\n\n if (queue === currentQueue) {\n // The work-in-progress queue is the same as current. This happens when\n // we bail out on a parent fiber that then captures an error thrown by\n // a child. Since we want to append the update only to the work-in\n // -progress queue, we need to clone the updates. We usually clone during\n // processUpdateQueue, but that didn't happen in this case because we\n // skipped over the parent when we bailed out.\n var newFirst = null;\n var newLast = null;\n var firstBaseUpdate = queue.firstBaseUpdate;\n\n if (firstBaseUpdate !== null) {\n // Loop through the updates and clone them.\n var update = firstBaseUpdate;\n\n do {\n var clone = {\n eventTime: update.eventTime,\n lane: update.lane,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n\n if (newLast === null) {\n newFirst = newLast = clone;\n } else {\n newLast.next = clone;\n newLast = clone;\n }\n\n update = update.next;\n } while (update !== null); // Append the captured update the end of the cloned list.\n\n\n if (newLast === null) {\n newFirst = newLast = capturedUpdate;\n } else {\n newLast.next = capturedUpdate;\n newLast = capturedUpdate;\n }\n } else {\n // There are no base updates.\n newFirst = newLast = capturedUpdate;\n }\n\n queue = {\n baseState: currentQueue.baseState,\n firstBaseUpdate: newFirst,\n lastBaseUpdate: newLast,\n shared: currentQueue.shared,\n effects: currentQueue.effects\n };\n workInProgress.updateQueue = queue;\n return;\n }\n } // Append the update to the end of the list.\n\n\n var lastBaseUpdate = queue.lastBaseUpdate;\n\n if (lastBaseUpdate === null) {\n queue.firstBaseUpdate = capturedUpdate;\n } else {\n lastBaseUpdate.next = capturedUpdate;\n }\n\n queue.lastBaseUpdate = capturedUpdate;\n}\n\nfunction getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {\n switch (update.tag) {\n case ReplaceState:\n {\n var payload = update.payload;\n\n if (typeof payload === 'function') {\n // Updater function\n {\n enterDisallowedContextReadInDEV();\n }\n\n var nextState = payload.call(instance, prevState, nextProps);\n\n {\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n payload.call(instance, prevState, nextProps);\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n\n exitDisallowedContextReadInDEV();\n }\n\n return nextState;\n } // State object\n\n\n return payload;\n }\n\n case CaptureUpdate:\n {\n workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture;\n }\n // Intentional fallthrough\n\n case UpdateState:\n {\n var _payload = update.payload;\n var partialState;\n\n if (typeof _payload === 'function') {\n // Updater function\n {\n enterDisallowedContextReadInDEV();\n }\n\n partialState = _payload.call(instance, prevState, nextProps);\n\n {\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n _payload.call(instance, prevState, nextProps);\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n\n exitDisallowedContextReadInDEV();\n }\n } else {\n // Partial state object\n partialState = _payload;\n }\n\n if (partialState === null || partialState === undefined) {\n // Null and undefined are treated as no-ops.\n return prevState;\n } // Merge the partial state and the previous state.\n\n\n return assign({}, prevState, partialState);\n }\n\n case ForceUpdate:\n {\n hasForceUpdate = true;\n return prevState;\n }\n }\n\n return prevState;\n}\n\nfunction processUpdateQueue(workInProgress, props, instance, renderLanes) {\n // This is always non-null on a ClassComponent or HostRoot\n var queue = workInProgress.updateQueue;\n hasForceUpdate = false;\n\n {\n currentlyProcessingQueue = queue.shared;\n }\n\n var firstBaseUpdate = queue.firstBaseUpdate;\n var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue.\n\n var pendingQueue = queue.shared.pending;\n\n if (pendingQueue !== null) {\n queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first\n // and last so that it's non-circular.\n\n var lastPendingUpdate = pendingQueue;\n var firstPendingUpdate = lastPendingUpdate.next;\n lastPendingUpdate.next = null; // Append pending updates to base queue\n\n if (lastBaseUpdate === null) {\n firstBaseUpdate = firstPendingUpdate;\n } else {\n lastBaseUpdate.next = firstPendingUpdate;\n }\n\n lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then\n // we need to transfer the updates to that queue, too. Because the base\n // queue is a singly-linked list with no cycles, we can append to both\n // lists and take advantage of structural sharing.\n // TODO: Pass `current` as argument\n\n var current = workInProgress.alternate;\n\n if (current !== null) {\n // This is always non-null on a ClassComponent or HostRoot\n var currentQueue = current.updateQueue;\n var currentLastBaseUpdate = currentQueue.lastBaseUpdate;\n\n if (currentLastBaseUpdate !== lastBaseUpdate) {\n if (currentLastBaseUpdate === null) {\n currentQueue.firstBaseUpdate = firstPendingUpdate;\n } else {\n currentLastBaseUpdate.next = firstPendingUpdate;\n }\n\n currentQueue.lastBaseUpdate = lastPendingUpdate;\n }\n }\n } // These values may change as we process the queue.\n\n\n if (firstBaseUpdate !== null) {\n // Iterate through the list of updates to compute the result.\n var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes\n // from the original lanes.\n\n var newLanes = NoLanes;\n var newBaseState = null;\n var newFirstBaseUpdate = null;\n var newLastBaseUpdate = null;\n var update = firstBaseUpdate;\n\n do {\n var updateLane = update.lane;\n var updateEventTime = update.eventTime;\n\n if (!isSubsetOfLanes(renderLanes, updateLane)) {\n // Priority is insufficient. Skip this update. If this is the first\n // skipped update, the previous update/state is the new base\n // update/state.\n var clone = {\n eventTime: updateEventTime,\n lane: updateLane,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n\n if (newLastBaseUpdate === null) {\n newFirstBaseUpdate = newLastBaseUpdate = clone;\n newBaseState = newState;\n } else {\n newLastBaseUpdate = newLastBaseUpdate.next = clone;\n } // Update the remaining priority in the queue.\n\n\n newLanes = mergeLanes(newLanes, updateLane);\n } else {\n // This update does have sufficient priority.\n if (newLastBaseUpdate !== null) {\n var _clone = {\n eventTime: updateEventTime,\n // This update is going to be committed so we never want uncommit\n // it. Using NoLane works because 0 is a subset of all bitmasks, so\n // this will never be skipped by the check above.\n lane: NoLane,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n newLastBaseUpdate = newLastBaseUpdate.next = _clone;\n } // Process this update.\n\n\n newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);\n var callback = update.callback;\n\n if (callback !== null && // If the update was already committed, we should not queue its\n // callback again.\n update.lane !== NoLane) {\n workInProgress.flags |= Callback;\n var effects = queue.effects;\n\n if (effects === null) {\n queue.effects = [update];\n } else {\n effects.push(update);\n }\n }\n }\n\n update = update.next;\n\n if (update === null) {\n pendingQueue = queue.shared.pending;\n\n if (pendingQueue === null) {\n break;\n } else {\n // An update was scheduled from inside a reducer. Add the new\n // pending updates to the end of the list and keep processing.\n var _lastPendingUpdate = pendingQueue; // Intentionally unsound. Pending updates form a circular list, but we\n // unravel them when transferring them to the base queue.\n\n var _firstPendingUpdate = _lastPendingUpdate.next;\n _lastPendingUpdate.next = null;\n update = _firstPendingUpdate;\n queue.lastBaseUpdate = _lastPendingUpdate;\n queue.shared.pending = null;\n }\n }\n } while (true);\n\n if (newLastBaseUpdate === null) {\n newBaseState = newState;\n }\n\n queue.baseState = newBaseState;\n queue.firstBaseUpdate = newFirstBaseUpdate;\n queue.lastBaseUpdate = newLastBaseUpdate; // Interleaved updates are stored on a separate queue. We aren't going to\n // process them during this render, but we do need to track which lanes\n // are remaining.\n\n var lastInterleaved = queue.shared.interleaved;\n\n if (lastInterleaved !== null) {\n var interleaved = lastInterleaved;\n\n do {\n newLanes = mergeLanes(newLanes, interleaved.lane);\n interleaved = interleaved.next;\n } while (interleaved !== lastInterleaved);\n } else if (firstBaseUpdate === null) {\n // `queue.lanes` is used for entangling transitions. We can set it back to\n // zero once the queue is empty.\n queue.shared.lanes = NoLanes;\n } // Set the remaining expiration time to be whatever is remaining in the queue.\n // This should be fine because the only two other things that contribute to\n // expiration time are props and context. We're already in the middle of the\n // begin phase by the time we start processing the queue, so we've already\n // dealt with the props. Context in components that specify\n // shouldComponentUpdate is tricky; but we'll have to account for\n // that regardless.\n\n\n markSkippedUpdateLanes(newLanes);\n workInProgress.lanes = newLanes;\n workInProgress.memoizedState = newState;\n }\n\n {\n currentlyProcessingQueue = null;\n }\n}\n\nfunction callCallback(callback, context) {\n if (typeof callback !== 'function') {\n throw new Error('Invalid argument passed as callback. Expected a function. Instead ' + (\"received: \" + callback));\n }\n\n callback.call(context);\n}\n\nfunction resetHasForceUpdateBeforeProcessing() {\n hasForceUpdate = false;\n}\nfunction checkHasForceUpdateAfterProcessing() {\n return hasForceUpdate;\n}\nfunction commitUpdateQueue(finishedWork, finishedQueue, instance) {\n // Commit the effects\n var effects = finishedQueue.effects;\n finishedQueue.effects = null;\n\n if (effects !== null) {\n for (var i = 0; i < effects.length; i++) {\n var effect = effects[i];\n var callback = effect.callback;\n\n if (callback !== null) {\n effect.callback = null;\n callCallback(callback, instance);\n }\n }\n }\n}\n\nvar fakeInternalInstance = {}; // React.Component uses a shared frozen object by default.\n// We'll use it to determine whether we need to initialize legacy refs.\n\nvar emptyRefsObject = new React.Component().refs;\nvar didWarnAboutStateAssignmentForComponent;\nvar didWarnAboutUninitializedState;\nvar didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;\nvar didWarnAboutLegacyLifecyclesAndDerivedState;\nvar didWarnAboutUndefinedDerivedState;\nvar warnOnUndefinedDerivedState;\nvar warnOnInvalidCallback;\nvar didWarnAboutDirectlyAssigningPropsToState;\nvar didWarnAboutContextTypeAndContextTypes;\nvar didWarnAboutInvalidateContextType;\n\n{\n didWarnAboutStateAssignmentForComponent = new Set();\n didWarnAboutUninitializedState = new Set();\n didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();\n didWarnAboutLegacyLifecyclesAndDerivedState = new Set();\n didWarnAboutDirectlyAssigningPropsToState = new Set();\n didWarnAboutUndefinedDerivedState = new Set();\n didWarnAboutContextTypeAndContextTypes = new Set();\n didWarnAboutInvalidateContextType = new Set();\n var didWarnOnInvalidCallback = new Set();\n\n warnOnInvalidCallback = function (callback, callerName) {\n if (callback === null || typeof callback === 'function') {\n return;\n }\n\n var key = callerName + '_' + callback;\n\n if (!didWarnOnInvalidCallback.has(key)) {\n didWarnOnInvalidCallback.add(key);\n\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n };\n\n warnOnUndefinedDerivedState = function (type, partialState) {\n if (partialState === undefined) {\n var componentName = getComponentNameFromType(type) || 'Component';\n\n if (!didWarnAboutUndefinedDerivedState.has(componentName)) {\n didWarnAboutUndefinedDerivedState.add(componentName);\n\n error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);\n }\n }\n }; // This is so gross but it's at least non-critical and can be removed if\n // it causes problems. This is meant to give a nicer error message for\n // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,\n // ...)) which otherwise throws a \"_processChildContext is not a function\"\n // exception.\n\n\n Object.defineProperty(fakeInternalInstance, '_processChildContext', {\n enumerable: false,\n value: function () {\n throw new Error('_processChildContext is not available in React 16+. This likely ' + 'means you have multiple copies of React and are attempting to nest ' + 'a React 15 tree inside a React 16 tree using ' + \"unstable_renderSubtreeIntoContainer, which isn't supported. Try \" + 'to make sure you have only one copy of React (and ideally, switch ' + 'to ReactDOM.createPortal).');\n }\n });\n Object.freeze(fakeInternalInstance);\n}\n\nfunction applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {\n var prevState = workInProgress.memoizedState;\n var partialState = getDerivedStateFromProps(nextProps, prevState);\n\n {\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n // Invoke the function an extra time to help detect side-effects.\n partialState = getDerivedStateFromProps(nextProps, prevState);\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n\n warnOnUndefinedDerivedState(ctor, partialState);\n } // Merge the partial state and the previous state.\n\n\n var memoizedState = partialState === null || partialState === undefined ? prevState : assign({}, prevState, partialState);\n workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the\n // base state.\n\n if (workInProgress.lanes === NoLanes) {\n // Queue is always non-null for classes\n var updateQueue = workInProgress.updateQueue;\n updateQueue.baseState = memoizedState;\n }\n}\n\nvar classComponentUpdater = {\n isMounted: isMounted,\n enqueueSetState: function (inst, payload, callback) {\n var fiber = get(inst);\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(fiber);\n var update = createUpdate(eventTime, lane);\n update.payload = payload;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'setState');\n }\n\n update.callback = callback;\n }\n\n var root = enqueueUpdate(fiber, update, lane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, lane, eventTime);\n entangleTransitions(root, fiber, lane);\n }\n\n {\n markStateUpdateScheduled(fiber, lane);\n }\n },\n enqueueReplaceState: function (inst, payload, callback) {\n var fiber = get(inst);\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(fiber);\n var update = createUpdate(eventTime, lane);\n update.tag = ReplaceState;\n update.payload = payload;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'replaceState');\n }\n\n update.callback = callback;\n }\n\n var root = enqueueUpdate(fiber, update, lane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, lane, eventTime);\n entangleTransitions(root, fiber, lane);\n }\n\n {\n markStateUpdateScheduled(fiber, lane);\n }\n },\n enqueueForceUpdate: function (inst, callback) {\n var fiber = get(inst);\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(fiber);\n var update = createUpdate(eventTime, lane);\n update.tag = ForceUpdate;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'forceUpdate');\n }\n\n update.callback = callback;\n }\n\n var root = enqueueUpdate(fiber, update, lane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, lane, eventTime);\n entangleTransitions(root, fiber, lane);\n }\n\n {\n markForceUpdateScheduled(fiber, lane);\n }\n }\n};\n\nfunction checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {\n var instance = workInProgress.stateNode;\n\n if (typeof instance.shouldComponentUpdate === 'function') {\n var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);\n\n {\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n // Invoke the function an extra time to help detect side-effects.\n shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n\n if (shouldUpdate === undefined) {\n error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentNameFromType(ctor) || 'Component');\n }\n }\n\n return shouldUpdate;\n }\n\n if (ctor.prototype && ctor.prototype.isPureReactComponent) {\n return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);\n }\n\n return true;\n}\n\nfunction checkClassInstance(workInProgress, ctor, newProps) {\n var instance = workInProgress.stateNode;\n\n {\n var name = getComponentNameFromType(ctor) || 'Component';\n var renderPresent = instance.render;\n\n if (!renderPresent) {\n if (ctor.prototype && typeof ctor.prototype.render === 'function') {\n error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);\n } else {\n error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);\n }\n }\n\n if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {\n error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);\n }\n\n if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);\n }\n\n if (instance.propTypes) {\n error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);\n }\n\n if (instance.contextType) {\n error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);\n }\n\n {\n if (instance.contextTypes) {\n error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);\n }\n\n if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {\n didWarnAboutContextTypeAndContextTypes.add(ctor);\n\n error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);\n }\n }\n\n if (typeof instance.componentShouldUpdate === 'function') {\n error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);\n }\n\n if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {\n error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentNameFromType(ctor) || 'A pure component');\n }\n\n if (typeof instance.componentDidUnmount === 'function') {\n error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);\n }\n\n if (typeof instance.componentDidReceiveProps === 'function') {\n error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);\n }\n\n if (typeof instance.componentWillRecieveProps === 'function') {\n error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);\n }\n\n if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {\n error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);\n }\n\n var hasMutatedProps = instance.props !== newProps;\n\n if (instance.props !== undefined && hasMutatedProps) {\n error('%s(...): When calling super() in `%s`, make sure to pass ' + \"up the same props that your component's constructor was passed.\", name, name);\n }\n\n if (instance.defaultProps) {\n error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {\n didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);\n\n error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentNameFromType(ctor));\n }\n\n if (typeof instance.getDerivedStateFromProps === 'function') {\n error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n }\n\n if (typeof instance.getDerivedStateFromError === 'function') {\n error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n }\n\n if (typeof ctor.getSnapshotBeforeUpdate === 'function') {\n error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);\n }\n\n var _state = instance.state;\n\n if (_state && (typeof _state !== 'object' || isArray(_state))) {\n error('%s.state: must be set to an object or null', name);\n }\n\n if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') {\n error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);\n }\n }\n}\n\nfunction adoptClassInstance(workInProgress, instance) {\n instance.updater = classComponentUpdater;\n workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates\n\n set(instance, workInProgress);\n\n {\n instance._reactInternalInstance = fakeInternalInstance;\n }\n}\n\nfunction constructClassInstance(workInProgress, ctor, props) {\n var isLegacyContextConsumer = false;\n var unmaskedContext = emptyContextObject;\n var context = emptyContextObject;\n var contextType = ctor.contextType;\n\n {\n if ('contextType' in ctor) {\n var isValid = // Allow null for conditional declaration\n contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>\n\n if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {\n didWarnAboutInvalidateContextType.add(ctor);\n var addendum = '';\n\n if (contextType === undefined) {\n addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';\n } else if (typeof contextType !== 'object') {\n addendum = ' However, it is set to a ' + typeof contextType + '.';\n } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {\n addendum = ' Did you accidentally pass the Context.Provider instead?';\n } else if (contextType._context !== undefined) {\n // <Context.Consumer>\n addendum = ' Did you accidentally pass the Context.Consumer instead?';\n } else {\n addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';\n }\n\n error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentNameFromType(ctor) || 'Component', addendum);\n }\n }\n }\n\n if (typeof contextType === 'object' && contextType !== null) {\n context = readContext(contextType);\n } else {\n unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n var contextTypes = ctor.contextTypes;\n isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;\n context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;\n }\n\n var instance = new ctor(props, context); // Instantiate twice to help detect side-effects.\n\n {\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n instance = new ctor(props, context); // eslint-disable-line no-new\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n }\n\n var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;\n adoptClassInstance(workInProgress, instance);\n\n {\n if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {\n var componentName = getComponentNameFromType(ctor) || 'Component';\n\n if (!didWarnAboutUninitializedState.has(componentName)) {\n didWarnAboutUninitializedState.add(componentName);\n\n error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);\n }\n } // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Warn about these lifecycles if they are present.\n // Don't warn about react-lifecycles-compat polyfilled methods though.\n\n\n if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n\n if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {\n foundWillMountName = 'componentWillMount';\n } else if (typeof instance.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n\n if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n\n if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n\n if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n var _componentName = getComponentNameFromType(ctor) || 'Component';\n\n var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n\n if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {\n didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);\n\n error('Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\\n\\n' + 'The above lifecycles should be removed. Learn more about this warning here:\\n' + 'https://reactjs.org/link/unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? \"\\n \" + foundWillMountName : '', foundWillReceivePropsName !== null ? \"\\n \" + foundWillReceivePropsName : '', foundWillUpdateName !== null ? \"\\n \" + foundWillUpdateName : '');\n }\n }\n }\n } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n // ReactFiberContext usually updates this cache but can't for newly-created instances.\n\n\n if (isLegacyContextConsumer) {\n cacheContext(workInProgress, unmaskedContext, context);\n }\n\n return instance;\n}\n\nfunction callComponentWillMount(workInProgress, instance) {\n var oldState = instance.state;\n\n if (typeof instance.componentWillMount === 'function') {\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n\n if (oldState !== instance.state) {\n {\n error('%s.componentWillMount(): Assigning directly to this.state is ' + \"deprecated (except inside a component's \" + 'constructor). Use setState instead.', getComponentNameFromFiber(workInProgress) || 'Component');\n }\n\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n}\n\nfunction callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {\n var oldState = instance.state;\n\n if (typeof instance.componentWillReceiveProps === 'function') {\n instance.componentWillReceiveProps(newProps, nextContext);\n }\n\n if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);\n }\n\n if (instance.state !== oldState) {\n {\n var componentName = getComponentNameFromFiber(workInProgress) || 'Component';\n\n if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {\n didWarnAboutStateAssignmentForComponent.add(componentName);\n\n error('%s.componentWillReceiveProps(): Assigning directly to ' + \"this.state is deprecated (except inside a component's \" + 'constructor). Use setState instead.', componentName);\n }\n }\n\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n} // Invokes the mount life-cycles on a previously never rendered instance.\n\n\nfunction mountClassInstance(workInProgress, ctor, newProps, renderLanes) {\n {\n checkClassInstance(workInProgress, ctor, newProps);\n }\n\n var instance = workInProgress.stateNode;\n instance.props = newProps;\n instance.state = workInProgress.memoizedState;\n instance.refs = emptyRefsObject;\n initializeUpdateQueue(workInProgress);\n var contextType = ctor.contextType;\n\n if (typeof contextType === 'object' && contextType !== null) {\n instance.context = readContext(contextType);\n } else {\n var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n instance.context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n {\n if (instance.state === newProps) {\n var componentName = getComponentNameFromType(ctor) || 'Component';\n\n if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {\n didWarnAboutDirectlyAssigningPropsToState.add(componentName);\n\n error('%s: It is not recommended to assign props directly to state ' + \"because updates to props won't be reflected in state. \" + 'In most cases, it is better to use props directly.', componentName);\n }\n }\n\n if (workInProgress.mode & StrictLegacyMode) {\n ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);\n }\n\n {\n ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);\n }\n }\n\n instance.state = workInProgress.memoizedState;\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n instance.state = workInProgress.memoizedState;\n } // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n\n\n if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's\n // process them now.\n\n processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n instance.state = workInProgress.memoizedState;\n }\n\n if (typeof instance.componentDidMount === 'function') {\n var fiberFlags = Update;\n\n {\n fiberFlags |= LayoutStatic;\n }\n\n if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {\n fiberFlags |= MountLayoutDev;\n }\n\n workInProgress.flags |= fiberFlags;\n }\n}\n\nfunction resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {\n var instance = workInProgress.stateNode;\n var oldProps = workInProgress.memoizedProps;\n instance.props = oldProps;\n var oldContext = instance.context;\n var contextType = ctor.contextType;\n var nextContext = emptyContextObject;\n\n if (typeof contextType === 'object' && contextType !== null) {\n nextContext = readContext(contextType);\n } else {\n var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);\n }\n\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n // ever the previously attempted to render - not the \"current\". However,\n // during componentDidUpdate we pass the \"current\" props.\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n if (oldProps !== newProps || oldContext !== nextContext) {\n callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n }\n }\n\n resetHasForceUpdateBeforeProcessing();\n var oldState = workInProgress.memoizedState;\n var newState = instance.state = oldState;\n processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n newState = workInProgress.memoizedState;\n\n if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidMount === 'function') {\n var fiberFlags = Update;\n\n {\n fiberFlags |= LayoutStatic;\n }\n\n if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {\n fiberFlags |= MountLayoutDev;\n }\n\n workInProgress.flags |= fiberFlags;\n }\n\n return false;\n }\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n newState = workInProgress.memoizedState;\n }\n\n var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n\n if (shouldUpdate) {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n if (typeof instance.componentWillMount === 'function') {\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n }\n\n if (typeof instance.componentDidMount === 'function') {\n var _fiberFlags = Update;\n\n {\n _fiberFlags |= LayoutStatic;\n }\n\n if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {\n _fiberFlags |= MountLayoutDev;\n }\n\n workInProgress.flags |= _fiberFlags;\n }\n } else {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidMount === 'function') {\n var _fiberFlags2 = Update;\n\n {\n _fiberFlags2 |= LayoutStatic;\n }\n\n if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {\n _fiberFlags2 |= MountLayoutDev;\n }\n\n workInProgress.flags |= _fiberFlags2;\n } // If shouldComponentUpdate returned false, we should still update the\n // memoized state to indicate that this work can be reused.\n\n\n workInProgress.memoizedProps = newProps;\n workInProgress.memoizedState = newState;\n } // Update the existing instance's state, props, and context pointers even\n // if shouldComponentUpdate returns false.\n\n\n instance.props = newProps;\n instance.state = newState;\n instance.context = nextContext;\n return shouldUpdate;\n} // Invokes the update life-cycles and returns false if it shouldn't rerender.\n\n\nfunction updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) {\n var instance = workInProgress.stateNode;\n cloneUpdateQueue(current, workInProgress);\n var unresolvedOldProps = workInProgress.memoizedProps;\n var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps);\n instance.props = oldProps;\n var unresolvedNewProps = workInProgress.pendingProps;\n var oldContext = instance.context;\n var contextType = ctor.contextType;\n var nextContext = emptyContextObject;\n\n if (typeof contextType === 'object' && contextType !== null) {\n nextContext = readContext(contextType);\n } else {\n var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);\n }\n\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n // ever the previously attempted to render - not the \"current\". However,\n // during componentDidUpdate we pass the \"current\" props.\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {\n callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n }\n }\n\n resetHasForceUpdateBeforeProcessing();\n var oldState = workInProgress.memoizedState;\n var newState = instance.state = oldState;\n processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n newState = workInProgress.memoizedState;\n\n if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !(enableLazyContextPropagation )) {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidUpdate === 'function') {\n if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.flags |= Update;\n }\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.flags |= Snapshot;\n }\n }\n\n return false;\n }\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n newState = workInProgress.memoizedState;\n }\n\n var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) || // TODO: In some cases, we'll end up checking if context has changed twice,\n // both before and after `shouldComponentUpdate` has been called. Not ideal,\n // but I'm loath to refactor this function. This only happens for memoized\n // components so it's not that common.\n enableLazyContextPropagation ;\n\n if (shouldUpdate) {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {\n if (typeof instance.componentWillUpdate === 'function') {\n instance.componentWillUpdate(newProps, newState, nextContext);\n }\n\n if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);\n }\n }\n\n if (typeof instance.componentDidUpdate === 'function') {\n workInProgress.flags |= Update;\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n workInProgress.flags |= Snapshot;\n }\n } else {\n // If an update was already in progress, we should schedule an Update\n // effect even though we're bailing out, so that cWU/cDU are called.\n if (typeof instance.componentDidUpdate === 'function') {\n if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.flags |= Update;\n }\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.flags |= Snapshot;\n }\n } // If shouldComponentUpdate returned false, we should still update the\n // memoized props/state to indicate that this work can be reused.\n\n\n workInProgress.memoizedProps = newProps;\n workInProgress.memoizedState = newState;\n } // Update the existing instance's state, props, and context pointers even\n // if shouldComponentUpdate returns false.\n\n\n instance.props = newProps;\n instance.state = newState;\n instance.context = nextContext;\n return shouldUpdate;\n}\n\nvar didWarnAboutMaps;\nvar didWarnAboutGenerators;\nvar didWarnAboutStringRefs;\nvar ownerHasKeyUseWarning;\nvar ownerHasFunctionTypeWarning;\n\nvar warnForMissingKey = function (child, returnFiber) {};\n\n{\n didWarnAboutMaps = false;\n didWarnAboutGenerators = false;\n didWarnAboutStringRefs = {};\n /**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n ownerHasKeyUseWarning = {};\n ownerHasFunctionTypeWarning = {};\n\n warnForMissingKey = function (child, returnFiber) {\n if (child === null || typeof child !== 'object') {\n return;\n }\n\n if (!child._store || child._store.validated || child.key != null) {\n return;\n }\n\n if (typeof child._store !== 'object') {\n throw new Error('React Component in warnForMissingKey should have a _store. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n }\n\n child._store.validated = true;\n var componentName = getComponentNameFromFiber(returnFiber) || 'Component';\n\n if (ownerHasKeyUseWarning[componentName]) {\n return;\n }\n\n ownerHasKeyUseWarning[componentName] = true;\n\n error('Each child in a list should have a unique ' + '\"key\" prop. See https://reactjs.org/link/warning-keys for ' + 'more information.');\n };\n}\n\nfunction coerceRef(returnFiber, current, element) {\n var mixedRef = element.ref;\n\n if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {\n {\n // TODO: Clean this up once we turn on the string ref warning for\n // everyone, because the strict mode case will no longer be relevant\n if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs\n // because these cannot be automatically converted to an arrow function\n // using a codemod. Therefore, we don't have to warn about string refs again.\n !(element._owner && element._self && element._owner.stateNode !== element._self)) {\n var componentName = getComponentNameFromFiber(returnFiber) || 'Component';\n\n if (!didWarnAboutStringRefs[componentName]) {\n {\n error('A string ref, \"%s\", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', mixedRef);\n }\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n\n if (element._owner) {\n var owner = element._owner;\n var inst;\n\n if (owner) {\n var ownerFiber = owner;\n\n if (ownerFiber.tag !== ClassComponent) {\n throw new Error('Function components cannot have string refs. ' + 'We recommend using useRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref');\n }\n\n inst = ownerFiber.stateNode;\n }\n\n if (!inst) {\n throw new Error(\"Missing owner for string ref \" + mixedRef + \". This error is likely caused by a \" + 'bug in React. Please file an issue.');\n } // Assigning this to a const so Flow knows it won't change in the closure\n\n\n var resolvedInst = inst;\n\n {\n checkPropStringCoercion(mixedRef, 'ref');\n }\n\n var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref\n\n if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {\n return current.ref;\n }\n\n var ref = function (value) {\n var refs = resolvedInst.refs;\n\n if (refs === emptyRefsObject) {\n // This is a lazy pooled frozen object, so we need to initialize.\n refs = resolvedInst.refs = {};\n }\n\n if (value === null) {\n delete refs[stringRef];\n } else {\n refs[stringRef] = value;\n }\n };\n\n ref._stringRef = stringRef;\n return ref;\n } else {\n if (typeof mixedRef !== 'string') {\n throw new Error('Expected ref to be a function, a string, an object returned by React.createRef(), or null.');\n }\n\n if (!element._owner) {\n throw new Error(\"Element ref was specified as a string (\" + mixedRef + \") but no owner was set. This could happen for one of\" + ' the following reasons:\\n' + '1. You may be adding a ref to a function component\\n' + \"2. You may be adding a ref to a component that was not created inside a component's render method\\n\" + '3. You have multiple copies of React loaded\\n' + 'See https://reactjs.org/link/refs-must-have-owner for more information.');\n }\n }\n }\n\n return mixedRef;\n}\n\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n var childString = Object.prototype.toString.call(newChild);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childString === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : childString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n}\n\nfunction warnOnFunctionType(returnFiber) {\n {\n var componentName = getComponentNameFromFiber(returnFiber) || 'Component';\n\n if (ownerHasFunctionTypeWarning[componentName]) {\n return;\n }\n\n ownerHasFunctionTypeWarning[componentName] = true;\n\n error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');\n }\n}\n\nfunction resolveLazy(lazyType) {\n var payload = lazyType._payload;\n var init = lazyType._init;\n return init(payload);\n} // This wrapper function exists because I expect to clone the code in each path\n// to be able to optimize each path individually by branching early. This needs\n// a compiler or we can do it manually. Helpers that don't need this branching\n// live outside of this function.\n\n\nfunction ChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (!shouldTrackSideEffects) {\n // Noop.\n return;\n }\n\n var deletions = returnFiber.deletions;\n\n if (deletions === null) {\n returnFiber.deletions = [childToDelete];\n returnFiber.flags |= ChildDeletion;\n } else {\n deletions.push(childToDelete);\n }\n }\n\n function deleteRemainingChildren(returnFiber, currentFirstChild) {\n if (!shouldTrackSideEffects) {\n // Noop.\n return null;\n } // TODO: For the shouldClone case, this could be micro-optimized a bit by\n // assuming that after the first child we've already added everything.\n\n\n var childToDelete = currentFirstChild;\n\n while (childToDelete !== null) {\n deleteChild(returnFiber, childToDelete);\n childToDelete = childToDelete.sibling;\n }\n\n return null;\n }\n\n function mapRemainingChildren(returnFiber, currentFirstChild) {\n // Add the remaining children to a temporary map so that we can find them by\n // keys quickly. Implicit (null) keys get added to this set with their index\n // instead.\n var existingChildren = new Map();\n var existingChild = currentFirstChild;\n\n while (existingChild !== null) {\n if (existingChild.key !== null) {\n existingChildren.set(existingChild.key, existingChild);\n } else {\n existingChildren.set(existingChild.index, existingChild);\n }\n\n existingChild = existingChild.sibling;\n }\n\n return existingChildren;\n }\n\n function useFiber(fiber, pendingProps) {\n // We currently set sibling to null and index to 0 here because it is easy\n // to forget to do before returning it. E.g. for the single child case.\n var clone = createWorkInProgress(fiber, pendingProps);\n clone.index = 0;\n clone.sibling = null;\n return clone;\n }\n\n function placeChild(newFiber, lastPlacedIndex, newIndex) {\n newFiber.index = newIndex;\n\n if (!shouldTrackSideEffects) {\n // During hydration, the useId algorithm needs to know which fibers are\n // part of a list of children (arrays, iterators).\n newFiber.flags |= Forked;\n return lastPlacedIndex;\n }\n\n var current = newFiber.alternate;\n\n if (current !== null) {\n var oldIndex = current.index;\n\n if (oldIndex < lastPlacedIndex) {\n // This is a move.\n newFiber.flags |= Placement;\n return lastPlacedIndex;\n } else {\n // This item can stay in place.\n return oldIndex;\n }\n } else {\n // This is an insertion.\n newFiber.flags |= Placement;\n return lastPlacedIndex;\n }\n }\n\n function placeSingleChild(newFiber) {\n // This is simpler for the single child case. We only need to do a\n // placement for inserting new children.\n if (shouldTrackSideEffects && newFiber.alternate === null) {\n newFiber.flags |= Placement;\n }\n\n return newFiber;\n }\n\n function updateTextNode(returnFiber, current, textContent, lanes) {\n if (current === null || current.tag !== HostText) {\n // Insert\n var created = createFiberFromText(textContent, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, textContent);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateElement(returnFiber, current, element, lanes) {\n var elementType = element.type;\n\n if (elementType === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, current, element.props.children, lanes, element.key);\n }\n\n if (current !== null) {\n if (current.elementType === elementType || ( // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(current, element) ) || // Lazy types should reconcile their resolved type.\n // We need to do this after the Hot Reloading check above,\n // because hot reloading has different semantics than prod because\n // it doesn't resuspend. So we can't let the call below suspend.\n typeof elementType === 'object' && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type) {\n // Move based on index\n var existing = useFiber(current, element.props);\n existing.ref = coerceRef(returnFiber, current, element);\n existing.return = returnFiber;\n\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n\n return existing;\n }\n } // Insert\n\n\n var created = createFiberFromElement(element, returnFiber.mode, lanes);\n created.ref = coerceRef(returnFiber, current, element);\n created.return = returnFiber;\n return created;\n }\n\n function updatePortal(returnFiber, current, portal, lanes) {\n if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {\n // Insert\n var created = createFiberFromPortal(portal, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, portal.children || []);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateFragment(returnFiber, current, fragment, lanes, key) {\n if (current === null || current.tag !== Fragment) {\n // Insert\n var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);\n created.return = returnFiber;\n return created;\n } else {\n // Update\n var existing = useFiber(current, fragment);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function createChild(returnFiber, newChild, lanes) {\n if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n var created = createFiberFromText('' + newChild, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);\n\n _created.ref = coerceRef(returnFiber, null, newChild);\n _created.return = returnFiber;\n return _created;\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);\n\n _created2.return = returnFiber;\n return _created2;\n }\n\n case REACT_LAZY_TYPE:\n {\n var payload = newChild._payload;\n var init = newChild._init;\n return createChild(returnFiber, init(payload), lanes);\n }\n }\n\n if (isArray(newChild) || getIteratorFn(newChild)) {\n var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);\n\n _created3.return = returnFiber;\n return _created3;\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType(returnFiber);\n }\n }\n\n return null;\n }\n\n function updateSlot(returnFiber, oldFiber, newChild, lanes) {\n // Update the fiber if the keys match, otherwise return null.\n var key = oldFiber !== null ? oldFiber.key : null;\n\n if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n if (key !== null) {\n return null;\n }\n\n return updateTextNode(returnFiber, oldFiber, '' + newChild, lanes);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n if (newChild.key === key) {\n return updateElement(returnFiber, oldFiber, newChild, lanes);\n } else {\n return null;\n }\n }\n\n case REACT_PORTAL_TYPE:\n {\n if (newChild.key === key) {\n return updatePortal(returnFiber, oldFiber, newChild, lanes);\n } else {\n return null;\n }\n }\n\n case REACT_LAZY_TYPE:\n {\n var payload = newChild._payload;\n var init = newChild._init;\n return updateSlot(returnFiber, oldFiber, init(payload), lanes);\n }\n }\n\n if (isArray(newChild) || getIteratorFn(newChild)) {\n if (key !== null) {\n return null;\n }\n\n return updateFragment(returnFiber, oldFiber, newChild, lanes, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType(returnFiber);\n }\n }\n\n return null;\n }\n\n function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {\n if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') {\n // Text nodes don't have keys, so we neither have to check the old nor\n // new node for the key. If both are text nodes, they match.\n var matchedFiber = existingChildren.get(newIdx) || null;\n return updateTextNode(returnFiber, matchedFiber, '' + newChild, lanes);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n return updateElement(returnFiber, _matchedFiber, newChild, lanes);\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);\n }\n\n case REACT_LAZY_TYPE:\n var payload = newChild._payload;\n var init = newChild._init;\n return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);\n }\n\n if (isArray(newChild) || getIteratorFn(newChild)) {\n var _matchedFiber3 = existingChildren.get(newIdx) || null;\n\n return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType(returnFiber);\n }\n }\n\n return null;\n }\n /**\n * Warns if there is a duplicate or missing key\n */\n\n\n function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n\n case REACT_LAZY_TYPE:\n var payload = child._payload;\n var init = child._init;\n warnOnInvalidKey(init(payload), knownKeys, returnFiber);\n break;\n }\n }\n\n return knownKeys;\n }\n\n function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {\n // This algorithm can't optimize by searching from both ends since we\n // don't have backpointers on fibers. I'm trying to see how far we can get\n // with that model. If it ends up not being worth the tradeoffs, we can\n // add it later.\n // Even with a two ended optimization, we'd want to optimize for the case\n // where there are few changes and brute force the comparison instead of\n // going for the Map. It'd like to explore hitting that path first in\n // forward-only mode and only go for the Map once we notice that we need\n // lots of look ahead. This doesn't handle reversal as well as two ended\n // search but that's unusual. Besides, for the two ended optimization to\n // work on Iterables, we'd need to copy the whole set.\n // In this first iteration, we'll just live with hitting the bad case\n // (adding everything to a Map) in for every insert/move.\n // If you change this code, also update reconcileChildrenIterator() which\n // uses the same algorithm.\n {\n // First, validate keys.\n var knownKeys = null;\n\n for (var i = 0; i < newChildren.length; i++) {\n var child = newChildren[i];\n knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);\n }\n }\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n\n for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {\n if (oldFiber.index > newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);\n\n if (newFiber === null) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (newIdx === newChildren.length) {\n // We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n\n if (getIsHydrating()) {\n var numberOfForks = newIdx;\n pushTreeFork(returnFiber, numberOfForks);\n }\n\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (; newIdx < newChildren.length; newIdx++) {\n var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);\n\n if (_newFiber === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber;\n } else {\n previousNewFiber.sibling = _newFiber;\n }\n\n previousNewFiber = _newFiber;\n }\n\n if (getIsHydrating()) {\n var _numberOfForks = newIdx;\n pushTreeFork(returnFiber, _numberOfForks);\n }\n\n return resultingFirstChild;\n } // Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n\n for (; newIdx < newChildren.length; newIdx++) {\n var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);\n\n if (_newFiber2 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber2.alternate !== null) {\n // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber2;\n } else {\n previousNewFiber.sibling = _newFiber2;\n }\n\n previousNewFiber = _newFiber2;\n }\n }\n\n if (shouldTrackSideEffects) {\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n if (getIsHydrating()) {\n var _numberOfForks2 = newIdx;\n pushTreeFork(returnFiber, _numberOfForks2);\n }\n\n return resultingFirstChild;\n }\n\n function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {\n // This is the same implementation as reconcileChildrenArray(),\n // but using the iterator instead.\n var iteratorFn = getIteratorFn(newChildrenIterable);\n\n if (typeof iteratorFn !== 'function') {\n throw new Error('An object is not an iterable. This error is likely caused by a bug in ' + 'React. Please file an issue.');\n }\n\n {\n // We don't support rendering Generators because it's a mutation.\n // See https://github.com/facebook/react/issues/12995\n if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag\n newChildrenIterable[Symbol.toStringTag] === 'Generator') {\n if (!didWarnAboutGenerators) {\n error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');\n }\n\n didWarnAboutGenerators = true;\n } // Warn about using Maps as children\n\n\n if (newChildrenIterable.entries === iteratorFn) {\n if (!didWarnAboutMaps) {\n error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n } // First, validate keys.\n // We'll get a different iterator later for the main pass.\n\n\n var _newChildren = iteratorFn.call(newChildrenIterable);\n\n if (_newChildren) {\n var knownKeys = null;\n\n var _step = _newChildren.next();\n\n for (; !_step.done; _step = _newChildren.next()) {\n var child = _step.value;\n knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);\n }\n }\n }\n\n var newChildren = iteratorFn.call(newChildrenIterable);\n\n if (newChildren == null) {\n throw new Error('An iterable object provided no iterator.');\n }\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n var step = newChildren.next();\n\n for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {\n if (oldFiber.index > newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);\n\n if (newFiber === null) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (step.done) {\n // We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n\n if (getIsHydrating()) {\n var numberOfForks = newIdx;\n pushTreeFork(returnFiber, numberOfForks);\n }\n\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber3 = createChild(returnFiber, step.value, lanes);\n\n if (_newFiber3 === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber3;\n } else {\n previousNewFiber.sibling = _newFiber3;\n }\n\n previousNewFiber = _newFiber3;\n }\n\n if (getIsHydrating()) {\n var _numberOfForks3 = newIdx;\n pushTreeFork(returnFiber, _numberOfForks3);\n }\n\n return resultingFirstChild;\n } // Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);\n\n if (_newFiber4 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber4.alternate !== null) {\n // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber4;\n } else {\n previousNewFiber.sibling = _newFiber4;\n }\n\n previousNewFiber = _newFiber4;\n }\n }\n\n if (shouldTrackSideEffects) {\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n if (getIsHydrating()) {\n var _numberOfForks4 = newIdx;\n pushTreeFork(returnFiber, _numberOfForks4);\n }\n\n return resultingFirstChild;\n }\n\n function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {\n // There's no need to check for keys on text nodes since we don't have a\n // way to define them.\n if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n // We already have an existing node so let's just update it and delete\n // the rest.\n deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n var existing = useFiber(currentFirstChild, textContent);\n existing.return = returnFiber;\n return existing;\n } // The existing first child is not a text node so we need to create one\n // and delete the existing ones.\n\n\n deleteRemainingChildren(returnFiber, currentFirstChild);\n var created = createFiberFromText(textContent, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n }\n\n function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {\n var key = element.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n var elementType = element.type;\n\n if (elementType === REACT_FRAGMENT_TYPE) {\n if (child.tag === Fragment) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, element.props.children);\n existing.return = returnFiber;\n\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n\n return existing;\n }\n } else {\n if (child.elementType === elementType || ( // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(child, element) ) || // Lazy types should reconcile their resolved type.\n // We need to do this after the Hot Reloading check above,\n // because hot reloading has different semantics than prod because\n // it doesn't resuspend. So we can't let the call below suspend.\n typeof elementType === 'object' && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {\n deleteRemainingChildren(returnFiber, child.sibling);\n\n var _existing = useFiber(child, element.props);\n\n _existing.ref = coerceRef(returnFiber, child, element);\n _existing.return = returnFiber;\n\n {\n _existing._debugSource = element._source;\n _existing._debugOwner = element._owner;\n }\n\n return _existing;\n }\n } // Didn't match.\n\n\n deleteRemainingChildren(returnFiber, child);\n break;\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n if (element.type === REACT_FRAGMENT_TYPE) {\n var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);\n created.return = returnFiber;\n return created;\n } else {\n var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);\n\n _created4.ref = coerceRef(returnFiber, currentFirstChild, element);\n _created4.return = returnFiber;\n return _created4;\n }\n }\n\n function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {\n var key = portal.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, portal.children || []);\n existing.return = returnFiber;\n return existing;\n } else {\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n var created = createFiberFromPortal(portal, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n } // This API will tag the children with the side-effect of the reconciliation\n // itself. They will be added to the side-effect list as we pass through the\n // children and the parent.\n\n\n function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));\n\n case REACT_LAZY_TYPE:\n var payload = newChild._payload;\n var init = newChild._init; // TODO: This function is supposed to be non-recursive.\n\n return reconcileChildFibers(returnFiber, currentFirstChild, init(payload), lanes);\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, lanes));\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType(returnFiber);\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }\n\n return reconcileChildFibers;\n}\n\nvar reconcileChildFibers = ChildReconciler(true);\nvar mountChildFibers = ChildReconciler(false);\nfunction cloneChildFibers(current, workInProgress) {\n if (current !== null && workInProgress.child !== current.child) {\n throw new Error('Resuming work not yet implemented.');\n }\n\n if (workInProgress.child === null) {\n return;\n }\n\n var currentChild = workInProgress.child;\n var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);\n workInProgress.child = newChild;\n newChild.return = workInProgress;\n\n while (currentChild.sibling !== null) {\n currentChild = currentChild.sibling;\n newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);\n newChild.return = workInProgress;\n }\n\n newChild.sibling = null;\n} // Reset a workInProgress child set to prepare it for a second pass.\n\nfunction resetChildFibers(workInProgress, lanes) {\n var child = workInProgress.child;\n\n while (child !== null) {\n resetWorkInProgress(child, lanes);\n child = child.sibling;\n }\n}\n\nvar NO_CONTEXT = {};\nvar contextStackCursor$1 = createCursor(NO_CONTEXT);\nvar contextFiberStackCursor = createCursor(NO_CONTEXT);\nvar rootInstanceStackCursor = createCursor(NO_CONTEXT);\n\nfunction requiredContext(c) {\n if (c === NO_CONTEXT) {\n throw new Error('Expected host context to exist. This error is likely caused by a bug ' + 'in React. Please file an issue.');\n }\n\n return c;\n}\n\nfunction getRootHostContainer() {\n var rootInstance = requiredContext(rootInstanceStackCursor.current);\n return rootInstance;\n}\n\nfunction pushHostContainer(fiber, nextRootInstance) {\n // Push current root instance onto the stack;\n // This allows us to reset root when portals are popped.\n push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.\n // This enables us to pop only Fibers that provide unique contexts.\n\n push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.\n // However, we can't just call getRootHostContext() and push it because\n // we'd have a different number of entries on the stack depending on\n // whether getRootHostContext() throws somewhere in renderer code or not.\n // So we push an empty value first. This lets us safely unwind on errors.\n\n push(contextStackCursor$1, NO_CONTEXT, fiber);\n var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.\n\n pop(contextStackCursor$1, fiber);\n push(contextStackCursor$1, nextRootContext, fiber);\n}\n\nfunction popHostContainer(fiber) {\n pop(contextStackCursor$1, fiber);\n pop(contextFiberStackCursor, fiber);\n pop(rootInstanceStackCursor, fiber);\n}\n\nfunction getHostContext() {\n var context = requiredContext(contextStackCursor$1.current);\n return context;\n}\n\nfunction pushHostContext(fiber) {\n var rootInstance = requiredContext(rootInstanceStackCursor.current);\n var context = requiredContext(contextStackCursor$1.current);\n var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.\n\n if (context === nextContext) {\n return;\n } // Track the context and the Fiber that provided it.\n // This enables us to pop only Fibers that provide unique contexts.\n\n\n push(contextFiberStackCursor, fiber, fiber);\n push(contextStackCursor$1, nextContext, fiber);\n}\n\nfunction popHostContext(fiber) {\n // Do not pop unless this Fiber provided the current context.\n // pushHostContext() only pushes Fibers that provide unique contexts.\n if (contextFiberStackCursor.current !== fiber) {\n return;\n }\n\n pop(contextStackCursor$1, fiber);\n pop(contextFiberStackCursor, fiber);\n}\n\nvar DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is\n// inherited deeply down the subtree. The upper bits only affect\n// this immediate suspense boundary and gets reset each new\n// boundary or suspense list.\n\nvar SubtreeSuspenseContextMask = 1; // Subtree Flags:\n// InvisibleParentSuspenseContext indicates that one of our parent Suspense\n// boundaries is not currently showing visible main content.\n// Either because it is already showing a fallback or is not mounted at all.\n// We can use this to determine if it is desirable to trigger a fallback at\n// the parent. If not, then we might need to trigger undesirable boundaries\n// and/or suspend the commit to avoid hiding the parent content.\n\nvar InvisibleParentSuspenseContext = 1; // Shallow Flags:\n// ForceSuspenseFallback can be used by SuspenseList to force newly added\n// items into their fallback state during one of the render passes.\n\nvar ForceSuspenseFallback = 2;\nvar suspenseStackCursor = createCursor(DefaultSuspenseContext);\nfunction hasSuspenseContext(parentContext, flag) {\n return (parentContext & flag) !== 0;\n}\nfunction setDefaultShallowSuspenseContext(parentContext) {\n return parentContext & SubtreeSuspenseContextMask;\n}\nfunction setShallowSuspenseContext(parentContext, shallowContext) {\n return parentContext & SubtreeSuspenseContextMask | shallowContext;\n}\nfunction addSubtreeSuspenseContext(parentContext, subtreeContext) {\n return parentContext | subtreeContext;\n}\nfunction pushSuspenseContext(fiber, newContext) {\n push(suspenseStackCursor, newContext, fiber);\n}\nfunction popSuspenseContext(fiber) {\n pop(suspenseStackCursor, fiber);\n}\n\nfunction shouldCaptureSuspense(workInProgress, hasInvisibleParent) {\n // If it was the primary children that just suspended, capture and render the\n // fallback. Otherwise, don't capture and bubble to the next boundary.\n var nextState = workInProgress.memoizedState;\n\n if (nextState !== null) {\n if (nextState.dehydrated !== null) {\n // A dehydrated boundary always captures.\n return true;\n }\n\n return false;\n }\n\n var props = workInProgress.memoizedProps; // Regular boundaries always capture.\n\n {\n return true;\n } // If it's a boundary we should avoid, then we prefer to bubble up to the\n}\nfunction findFirstSuspended(row) {\n var node = row;\n\n while (node !== null) {\n if (node.tag === SuspenseComponent) {\n var state = node.memoizedState;\n\n if (state !== null) {\n var dehydrated = state.dehydrated;\n\n if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {\n return node;\n }\n }\n } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't\n // keep track of whether it suspended or not.\n node.memoizedProps.revealOrder !== undefined) {\n var didSuspend = (node.flags & DidCapture) !== NoFlags;\n\n if (didSuspend) {\n return node;\n }\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === row) {\n return null;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === row) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n\n return null;\n}\n\nvar NoFlags$1 =\n/* */\n0; // Represents whether effect should fire.\n\nvar HasEffect =\n/* */\n1; // Represents the phase in which the effect (not the clean-up) fires.\n\nvar Insertion =\n/* */\n2;\nvar Layout =\n/* */\n4;\nvar Passive$1 =\n/* */\n8;\n\n// and should be reset before starting a new render.\n// This tracks which mutable sources need to be reset after a render.\n\nvar workInProgressSources = [];\nfunction resetWorkInProgressVersions() {\n for (var i = 0; i < workInProgressSources.length; i++) {\n var mutableSource = workInProgressSources[i];\n\n {\n mutableSource._workInProgressVersionPrimary = null;\n }\n }\n\n workInProgressSources.length = 0;\n}\n// This ensures that the version used for server rendering matches the one\n// that is eventually read during hydration.\n// If they don't match there's a potential tear and a full deopt render is required.\n\nfunction registerMutableSourceForHydration(root, mutableSource) {\n var getVersion = mutableSource._getVersion;\n var version = getVersion(mutableSource._source); // TODO Clear this data once all pending hydration work is finished.\n // Retaining it forever may interfere with GC.\n\n if (root.mutableSourceEagerHydrationData == null) {\n root.mutableSourceEagerHydrationData = [mutableSource, version];\n } else {\n root.mutableSourceEagerHydrationData.push(mutableSource, version);\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,\n ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;\nvar didWarnAboutMismatchedHooksForComponent;\nvar didWarnUncachedGetSnapshot;\n\n{\n didWarnAboutMismatchedHooksForComponent = new Set();\n}\n\n// These are set right before calling the component.\nvar renderLanes = NoLanes; // The work-in-progress fiber. I've named it differently to distinguish it from\n// the work-in-progress hook.\n\nvar currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The\n// current hook list is the list that belongs to the current fiber. The\n// work-in-progress hook list is a new list that will be added to the\n// work-in-progress fiber.\n\nvar currentHook = null;\nvar workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This\n// does not get reset if we do another render pass; only when we're completely\n// finished evaluating this component. This is an optimization so we know\n// whether we need to clear render phase updates after a throw.\n\nvar didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only during the current render pass. This\n// gets reset after each attempt.\n// TODO: Maybe there's some way to consolidate this with\n// `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`.\n\nvar didScheduleRenderPhaseUpdateDuringThisPass = false; // Counts the number of useId hooks in this component.\n\nvar localIdCounter = 0; // Used for ids that are generated completely client-side (i.e. not during\n// hydration). This counter is global, so client ids are not stable across\n// render attempts.\n\nvar globalClientIdCounter = 0;\nvar RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook\n\nvar currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.\n// The list stores the order of hooks used during the initial render (mount).\n// Subsequent renders (updates) reference this list.\n\nvar hookTypesDev = null;\nvar hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore\n// the dependencies for Hooks that need them (e.g. useEffect or useMemo).\n// When true, such Hooks will always be \"remounted\". Only used during hot reload.\n\nvar ignorePreviousDependencies = false;\n\nfunction mountHookTypesDev() {\n {\n var hookName = currentHookNameInDev;\n\n if (hookTypesDev === null) {\n hookTypesDev = [hookName];\n } else {\n hookTypesDev.push(hookName);\n }\n }\n}\n\nfunction updateHookTypesDev() {\n {\n var hookName = currentHookNameInDev;\n\n if (hookTypesDev !== null) {\n hookTypesUpdateIndexDev++;\n\n if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {\n warnOnHookMismatchInDev(hookName);\n }\n }\n }\n}\n\nfunction checkDepsAreArrayDev(deps) {\n {\n if (deps !== undefined && deps !== null && !isArray(deps)) {\n // Verify deps, but only on mount to avoid extra checks.\n // It's unlikely their type would change as usually you define them inline.\n error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);\n }\n }\n}\n\nfunction warnOnHookMismatchInDev(currentHookName) {\n {\n var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1);\n\n if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {\n didWarnAboutMismatchedHooksForComponent.add(componentName);\n\n if (hookTypesDev !== null) {\n var table = '';\n var secondColumnStart = 30;\n\n for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {\n var oldHookName = hookTypesDev[i];\n var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;\n var row = i + 1 + \". \" + oldHookName; // Extra space so second column lines up\n // lol @ IE not supporting String#repeat\n\n while (row.length < secondColumnStart) {\n row += ' ';\n }\n\n row += newHookName + '\\n';\n table += row;\n }\n\n error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\\n\\n' + ' Previous render Next render\\n' + ' ------------------------------------------------------\\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', componentName, table);\n }\n }\n }\n}\n\nfunction throwInvalidHookError() {\n throw new Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n}\n\nfunction areHookInputsEqual(nextDeps, prevDeps) {\n {\n if (ignorePreviousDependencies) {\n // Only true when this component is being hot reloaded.\n return false;\n }\n }\n\n if (prevDeps === null) {\n {\n error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);\n }\n\n return false;\n }\n\n {\n // Don't bother comparing lengths in prod because these arrays should be\n // passed inline.\n if (nextDeps.length !== prevDeps.length) {\n error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\\n\\n' + 'Previous: %s\\n' + 'Incoming: %s', currentHookNameInDev, \"[\" + prevDeps.join(', ') + \"]\", \"[\" + nextDeps.join(', ') + \"]\");\n }\n }\n\n for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {\n if (objectIs(nextDeps[i], prevDeps[i])) {\n continue;\n }\n\n return false;\n }\n\n return true;\n}\n\nfunction renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) {\n renderLanes = nextRenderLanes;\n currentlyRenderingFiber$1 = workInProgress;\n\n {\n hookTypesDev = current !== null ? current._debugHookTypes : null;\n hookTypesUpdateIndexDev = -1; // Used for hot reloading:\n\n ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;\n }\n\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.lanes = NoLanes; // The following should have already been reset\n // currentHook = null;\n // workInProgressHook = null;\n // didScheduleRenderPhaseUpdate = false;\n // localIdCounter = 0;\n // TODO Warn if no hooks are used at all during mount, then some are used during update.\n // Currently we will identify the update render as a mount because memoizedState === null.\n // This is tricky because it's valid for certain types of components (e.g. React.lazy)\n // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used.\n // Non-stateful hooks (e.g. context) don't get added to memoizedState,\n // so memoizedState would be null during updates and mounts.\n\n {\n if (current !== null && current.memoizedState !== null) {\n ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;\n } else if (hookTypesDev !== null) {\n // This dispatcher handles an edge case where a component is updating,\n // but no stateful hooks have been used.\n // We want to match the production code behavior (which will use HooksDispatcherOnMount),\n // but with the extra DEV validation to ensure hooks ordering hasn't changed.\n // This dispatcher does that.\n ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;\n } else {\n ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;\n }\n }\n\n var children = Component(props, secondArg); // Check if there was a render phase update\n\n if (didScheduleRenderPhaseUpdateDuringThisPass) {\n // Keep rendering in a loop for as long as render phase updates continue to\n // be scheduled. Use a counter to prevent infinite loops.\n var numberOfReRenders = 0;\n\n do {\n didScheduleRenderPhaseUpdateDuringThisPass = false;\n localIdCounter = 0;\n\n if (numberOfReRenders >= RE_RENDER_LIMIT) {\n throw new Error('Too many re-renders. React limits the number of renders to prevent ' + 'an infinite loop.');\n }\n\n numberOfReRenders += 1;\n\n {\n // Even when hot reloading, allow dependencies to stabilize\n // after first render to prevent infinite render phase updates.\n ignorePreviousDependencies = false;\n } // Start over from the beginning of the list\n\n\n currentHook = null;\n workInProgressHook = null;\n workInProgress.updateQueue = null;\n\n {\n // Also validate hook order for cascading updates.\n hookTypesUpdateIndexDev = -1;\n }\n\n ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV ;\n children = Component(props, secondArg);\n } while (didScheduleRenderPhaseUpdateDuringThisPass);\n } // We can assume the previous dispatcher is always this one, since we set it\n // at the beginning of the render phase and there's no re-entrance.\n\n\n ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n\n {\n workInProgress._debugHookTypes = hookTypesDev;\n } // This check uses currentHook so that it works the same in DEV and prod bundles.\n // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.\n\n\n var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;\n renderLanes = NoLanes;\n currentlyRenderingFiber$1 = null;\n currentHook = null;\n workInProgressHook = null;\n\n {\n currentHookNameInDev = null;\n hookTypesDev = null;\n hookTypesUpdateIndexDev = -1; // Confirm that a static flag was not added or removed since the last\n // render. If this fires, it suggests that we incorrectly reset the static\n // flags in some other part of the codebase. This has happened before, for\n // example, in the SuspenseList implementation.\n\n if (current !== null && (current.flags & StaticMask) !== (workInProgress.flags & StaticMask) && // Disable this warning in legacy mode, because legacy Suspense is weird\n // and creates false positives. To make this work in legacy mode, we'd\n // need to mark fibers that commit in an incomplete state, somehow. For\n // now I'll disable the warning that most of the bugs that would trigger\n // it are either exclusive to concurrent mode or exist in both.\n (current.mode & ConcurrentMode) !== NoMode) {\n error('Internal React error: Expected static flag was missing. Please ' + 'notify the React team.');\n }\n }\n\n didScheduleRenderPhaseUpdate = false; // This is reset by checkDidRenderIdHook\n // localIdCounter = 0;\n\n if (didRenderTooFewHooks) {\n throw new Error('Rendered fewer hooks than expected. This may be caused by an accidental ' + 'early return statement.');\n }\n\n return children;\n}\nfunction checkDidRenderIdHook() {\n // This should be called immediately after every renderWithHooks call.\n // Conceptually, it's part of the return value of renderWithHooks; it's only a\n // separate function to avoid using an array tuple.\n var didRenderIdHook = localIdCounter !== 0;\n localIdCounter = 0;\n return didRenderIdHook;\n}\nfunction bailoutHooks(current, workInProgress, lanes) {\n workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the\n // complete phase (bubbleProperties).\n\n if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {\n workInProgress.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update);\n } else {\n workInProgress.flags &= ~(Passive | Update);\n }\n\n current.lanes = removeLanes(current.lanes, lanes);\n}\nfunction resetHooksAfterThrow() {\n // We can assume the previous dispatcher is always this one, since we set it\n // at the beginning of the render phase and there's no re-entrance.\n ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n\n if (didScheduleRenderPhaseUpdate) {\n // There were render phase updates. These are only valid for this render\n // phase, which we are now aborting. Remove the updates from the queues so\n // they do not persist to the next render. Do not remove updates from hooks\n // that weren't processed.\n //\n // Only reset the updates from the queue if it has a clone. If it does\n // not have a clone, that means it wasn't processed, and the updates were\n // scheduled before we entered the render phase.\n var hook = currentlyRenderingFiber$1.memoizedState;\n\n while (hook !== null) {\n var queue = hook.queue;\n\n if (queue !== null) {\n queue.pending = null;\n }\n\n hook = hook.next;\n }\n\n didScheduleRenderPhaseUpdate = false;\n }\n\n renderLanes = NoLanes;\n currentlyRenderingFiber$1 = null;\n currentHook = null;\n workInProgressHook = null;\n\n {\n hookTypesDev = null;\n hookTypesUpdateIndexDev = -1;\n currentHookNameInDev = null;\n isUpdatingOpaqueValueInRenderPhase = false;\n }\n\n didScheduleRenderPhaseUpdateDuringThisPass = false;\n localIdCounter = 0;\n}\n\nfunction mountWorkInProgressHook() {\n var hook = {\n memoizedState: null,\n baseState: null,\n baseQueue: null,\n queue: null,\n next: null\n };\n\n if (workInProgressHook === null) {\n // This is the first hook in the list\n currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;\n } else {\n // Append to the end of the list\n workInProgressHook = workInProgressHook.next = hook;\n }\n\n return workInProgressHook;\n}\n\nfunction updateWorkInProgressHook() {\n // This function is used both for updates and for re-renders triggered by a\n // render phase update. It assumes there is either a current hook we can\n // clone, or a work-in-progress hook from a previous render pass that we can\n // use as a base. When we reach the end of the base list, we must switch to\n // the dispatcher used for mounts.\n var nextCurrentHook;\n\n if (currentHook === null) {\n var current = currentlyRenderingFiber$1.alternate;\n\n if (current !== null) {\n nextCurrentHook = current.memoizedState;\n } else {\n nextCurrentHook = null;\n }\n } else {\n nextCurrentHook = currentHook.next;\n }\n\n var nextWorkInProgressHook;\n\n if (workInProgressHook === null) {\n nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;\n } else {\n nextWorkInProgressHook = workInProgressHook.next;\n }\n\n if (nextWorkInProgressHook !== null) {\n // There's already a work-in-progress. Reuse it.\n workInProgressHook = nextWorkInProgressHook;\n nextWorkInProgressHook = workInProgressHook.next;\n currentHook = nextCurrentHook;\n } else {\n // Clone from the current hook.\n if (nextCurrentHook === null) {\n throw new Error('Rendered more hooks than during the previous render.');\n }\n\n currentHook = nextCurrentHook;\n var newHook = {\n memoizedState: currentHook.memoizedState,\n baseState: currentHook.baseState,\n baseQueue: currentHook.baseQueue,\n queue: currentHook.queue,\n next: null\n };\n\n if (workInProgressHook === null) {\n // This is the first hook in the list.\n currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;\n } else {\n // Append to the end of the list.\n workInProgressHook = workInProgressHook.next = newHook;\n }\n }\n\n return workInProgressHook;\n}\n\nfunction createFunctionComponentUpdateQueue() {\n return {\n lastEffect: null,\n stores: null\n };\n}\n\nfunction basicStateReducer(state, action) {\n // $FlowFixMe: Flow doesn't like mixed types\n return typeof action === 'function' ? action(state) : action;\n}\n\nfunction mountReducer(reducer, initialArg, init) {\n var hook = mountWorkInProgressHook();\n var initialState;\n\n if (init !== undefined) {\n initialState = init(initialArg);\n } else {\n initialState = initialArg;\n }\n\n hook.memoizedState = hook.baseState = initialState;\n var queue = {\n pending: null,\n interleaved: null,\n lanes: NoLanes,\n dispatch: null,\n lastRenderedReducer: reducer,\n lastRenderedState: initialState\n };\n hook.queue = queue;\n var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue);\n return [hook.memoizedState, dispatch];\n}\n\nfunction updateReducer(reducer, initialArg, init) {\n var hook = updateWorkInProgressHook();\n var queue = hook.queue;\n\n if (queue === null) {\n throw new Error('Should have a queue. This is likely a bug in React. Please file an issue.');\n }\n\n queue.lastRenderedReducer = reducer;\n var current = currentHook; // The last rebase update that is NOT part of the base state.\n\n var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet.\n\n var pendingQueue = queue.pending;\n\n if (pendingQueue !== null) {\n // We have new updates that haven't been processed yet.\n // We'll add them to the base queue.\n if (baseQueue !== null) {\n // Merge the pending queue and the base queue.\n var baseFirst = baseQueue.next;\n var pendingFirst = pendingQueue.next;\n baseQueue.next = pendingFirst;\n pendingQueue.next = baseFirst;\n }\n\n {\n if (current.baseQueue !== baseQueue) {\n // Internal invariant that should never happen, but feasibly could in\n // the future if we implement resuming, or some form of that.\n error('Internal error: Expected work-in-progress queue to be a clone. ' + 'This is a bug in React.');\n }\n }\n\n current.baseQueue = baseQueue = pendingQueue;\n queue.pending = null;\n }\n\n if (baseQueue !== null) {\n // We have a queue to process.\n var first = baseQueue.next;\n var newState = current.baseState;\n var newBaseState = null;\n var newBaseQueueFirst = null;\n var newBaseQueueLast = null;\n var update = first;\n\n do {\n var updateLane = update.lane;\n\n if (!isSubsetOfLanes(renderLanes, updateLane)) {\n // Priority is insufficient. Skip this update. If this is the first\n // skipped update, the previous update/state is the new base\n // update/state.\n var clone = {\n lane: updateLane,\n action: update.action,\n hasEagerState: update.hasEagerState,\n eagerState: update.eagerState,\n next: null\n };\n\n if (newBaseQueueLast === null) {\n newBaseQueueFirst = newBaseQueueLast = clone;\n newBaseState = newState;\n } else {\n newBaseQueueLast = newBaseQueueLast.next = clone;\n } // Update the remaining priority in the queue.\n // TODO: Don't need to accumulate this. Instead, we can remove\n // renderLanes from the original lanes.\n\n\n currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);\n markSkippedUpdateLanes(updateLane);\n } else {\n // This update does have sufficient priority.\n if (newBaseQueueLast !== null) {\n var _clone = {\n // This update is going to be committed so we never want uncommit\n // it. Using NoLane works because 0 is a subset of all bitmasks, so\n // this will never be skipped by the check above.\n lane: NoLane,\n action: update.action,\n hasEagerState: update.hasEagerState,\n eagerState: update.eagerState,\n next: null\n };\n newBaseQueueLast = newBaseQueueLast.next = _clone;\n } // Process this update.\n\n\n if (update.hasEagerState) {\n // If this update is a state update (not a reducer) and was processed eagerly,\n // we can use the eagerly computed state\n newState = update.eagerState;\n } else {\n var action = update.action;\n newState = reducer(newState, action);\n }\n }\n\n update = update.next;\n } while (update !== null && update !== first);\n\n if (newBaseQueueLast === null) {\n newBaseState = newState;\n } else {\n newBaseQueueLast.next = newBaseQueueFirst;\n } // Mark that the fiber performed work, but only if the new state is\n // different from the current state.\n\n\n if (!objectIs(newState, hook.memoizedState)) {\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = newState;\n hook.baseState = newBaseState;\n hook.baseQueue = newBaseQueueLast;\n queue.lastRenderedState = newState;\n } // Interleaved updates are stored on a separate queue. We aren't going to\n // process them during this render, but we do need to track which lanes\n // are remaining.\n\n\n var lastInterleaved = queue.interleaved;\n\n if (lastInterleaved !== null) {\n var interleaved = lastInterleaved;\n\n do {\n var interleavedLane = interleaved.lane;\n currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane);\n markSkippedUpdateLanes(interleavedLane);\n interleaved = interleaved.next;\n } while (interleaved !== lastInterleaved);\n } else if (baseQueue === null) {\n // `queue.lanes` is used for entangling transitions. We can set it back to\n // zero once the queue is empty.\n queue.lanes = NoLanes;\n }\n\n var dispatch = queue.dispatch;\n return [hook.memoizedState, dispatch];\n}\n\nfunction rerenderReducer(reducer, initialArg, init) {\n var hook = updateWorkInProgressHook();\n var queue = hook.queue;\n\n if (queue === null) {\n throw new Error('Should have a queue. This is likely a bug in React. Please file an issue.');\n }\n\n queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous\n // work-in-progress hook.\n\n var dispatch = queue.dispatch;\n var lastRenderPhaseUpdate = queue.pending;\n var newState = hook.memoizedState;\n\n if (lastRenderPhaseUpdate !== null) {\n // The queue doesn't persist past this render pass.\n queue.pending = null;\n var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;\n var update = firstRenderPhaseUpdate;\n\n do {\n // Process this render phase update. We don't have to check the\n // priority because it will always be the same as the current\n // render's.\n var action = update.action;\n newState = reducer(newState, action);\n update = update.next;\n } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is\n // different from the current state.\n\n\n if (!objectIs(newState, hook.memoizedState)) {\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to\n // the base state unless the queue is empty.\n // TODO: Not sure if this is the desired semantics, but it's what we\n // do for gDSFP. I can't remember why.\n\n if (hook.baseQueue === null) {\n hook.baseState = newState;\n }\n\n queue.lastRenderedState = newState;\n }\n\n return [newState, dispatch];\n}\n\nfunction mountMutableSource(source, getSnapshot, subscribe) {\n {\n return undefined;\n }\n}\n\nfunction updateMutableSource(source, getSnapshot, subscribe) {\n {\n return undefined;\n }\n}\n\nfunction mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var fiber = currentlyRenderingFiber$1;\n var hook = mountWorkInProgressHook();\n var nextSnapshot;\n var isHydrating = getIsHydrating();\n\n if (isHydrating) {\n if (getServerSnapshot === undefined) {\n throw new Error('Missing getServerSnapshot, which is required for ' + 'server-rendered content. Will revert to client rendering.');\n }\n\n nextSnapshot = getServerSnapshot();\n\n {\n if (!didWarnUncachedGetSnapshot) {\n if (nextSnapshot !== getServerSnapshot()) {\n error('The result of getServerSnapshot should be cached to avoid an infinite loop');\n\n didWarnUncachedGetSnapshot = true;\n }\n }\n }\n } else {\n nextSnapshot = getSnapshot();\n\n {\n if (!didWarnUncachedGetSnapshot) {\n var cachedSnapshot = getSnapshot();\n\n if (!objectIs(nextSnapshot, cachedSnapshot)) {\n error('The result of getSnapshot should be cached to avoid an infinite loop');\n\n didWarnUncachedGetSnapshot = true;\n }\n }\n } // Unless we're rendering a blocking lane, schedule a consistency check.\n // Right before committing, we will walk the tree and check if any of the\n // stores were mutated.\n //\n // We won't do this if we're hydrating server-rendered content, because if\n // the content is stale, it's already visible anyway. Instead we'll patch\n // it up in a passive effect.\n\n\n var root = getWorkInProgressRoot();\n\n if (root === null) {\n throw new Error('Expected a work-in-progress root. This is a bug in React. Please file an issue.');\n }\n\n if (!includesBlockingLane(root, renderLanes)) {\n pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);\n }\n } // Read the current snapshot from the store on every render. This breaks the\n // normal rules of React, and only works because store updates are\n // always synchronous.\n\n\n hook.memoizedState = nextSnapshot;\n var inst = {\n value: nextSnapshot,\n getSnapshot: getSnapshot\n };\n hook.queue = inst; // Schedule an effect to subscribe to the store.\n\n mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Schedule an effect to update the mutable instance fields. We will update\n // this whenever subscribe, getSnapshot, or value changes. Because there's no\n // clean-up function, and we track the deps correctly, we can call pushEffect\n // directly, without storing any additional state. For the same reason, we\n // don't need to set a static flag, either.\n // TODO: We can move this to the passive phase once we add a pre-commit\n // consistency check. See the next comment.\n\n fiber.flags |= Passive;\n pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null);\n return nextSnapshot;\n}\n\nfunction updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var fiber = currentlyRenderingFiber$1;\n var hook = updateWorkInProgressHook(); // Read the current snapshot from the store on every render. This breaks the\n // normal rules of React, and only works because store updates are\n // always synchronous.\n\n var nextSnapshot = getSnapshot();\n\n {\n if (!didWarnUncachedGetSnapshot) {\n var cachedSnapshot = getSnapshot();\n\n if (!objectIs(nextSnapshot, cachedSnapshot)) {\n error('The result of getSnapshot should be cached to avoid an infinite loop');\n\n didWarnUncachedGetSnapshot = true;\n }\n }\n }\n\n var prevSnapshot = hook.memoizedState;\n var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);\n\n if (snapshotChanged) {\n hook.memoizedState = nextSnapshot;\n markWorkInProgressReceivedUpdate();\n }\n\n var inst = hook.queue;\n updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Whenever getSnapshot or subscribe changes, we need to check in the\n // commit phase if there was an interleaved mutation. In concurrent mode\n // this can happen all the time, but even in synchronous mode, an earlier\n // effect may have mutated the store.\n\n if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by\n // checking whether we scheduled a subscription effect above.\n workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {\n fiber.flags |= Passive;\n pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); // Unless we're rendering a blocking lane, schedule a consistency check.\n // Right before committing, we will walk the tree and check if any of the\n // stores were mutated.\n\n var root = getWorkInProgressRoot();\n\n if (root === null) {\n throw new Error('Expected a work-in-progress root. This is a bug in React. Please file an issue.');\n }\n\n if (!includesBlockingLane(root, renderLanes)) {\n pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);\n }\n }\n\n return nextSnapshot;\n}\n\nfunction pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {\n fiber.flags |= StoreConsistency;\n var check = {\n getSnapshot: getSnapshot,\n value: renderedSnapshot\n };\n var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;\n\n if (componentUpdateQueue === null) {\n componentUpdateQueue = createFunctionComponentUpdateQueue();\n currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;\n componentUpdateQueue.stores = [check];\n } else {\n var stores = componentUpdateQueue.stores;\n\n if (stores === null) {\n componentUpdateQueue.stores = [check];\n } else {\n stores.push(check);\n }\n }\n}\n\nfunction updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {\n // These are updated in the passive phase\n inst.value = nextSnapshot;\n inst.getSnapshot = getSnapshot; // Something may have been mutated in between render and commit. This could\n // have been in an event that fired before the passive effects, or it could\n // have been in a layout effect. In that case, we would have used the old\n // snapsho and getSnapshot values to bail out. We need to check one more time.\n\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceStoreRerender(fiber);\n }\n}\n\nfunction subscribeToStore(fiber, inst, subscribe) {\n var handleStoreChange = function () {\n // The store changed. Check if the snapshot changed since the last time we\n // read from the store.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceStoreRerender(fiber);\n }\n }; // Subscribe to the store and return a clean-up function.\n\n\n return subscribe(handleStoreChange);\n}\n\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n var prevValue = inst.value;\n\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(prevValue, nextValue);\n } catch (error) {\n return true;\n }\n}\n\nfunction forceStoreRerender(fiber) {\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);\n }\n}\n\nfunction mountState(initialState) {\n var hook = mountWorkInProgressHook();\n\n if (typeof initialState === 'function') {\n // $FlowFixMe: Flow doesn't like mixed types\n initialState = initialState();\n }\n\n hook.memoizedState = hook.baseState = initialState;\n var queue = {\n pending: null,\n interleaved: null,\n lanes: NoLanes,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: initialState\n };\n hook.queue = queue;\n var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);\n return [hook.memoizedState, dispatch];\n}\n\nfunction updateState(initialState) {\n return updateReducer(basicStateReducer);\n}\n\nfunction rerenderState(initialState) {\n return rerenderReducer(basicStateReducer);\n}\n\nfunction pushEffect(tag, create, destroy, deps) {\n var effect = {\n tag: tag,\n create: create,\n destroy: destroy,\n deps: deps,\n // Circular\n next: null\n };\n var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;\n\n if (componentUpdateQueue === null) {\n componentUpdateQueue = createFunctionComponentUpdateQueue();\n currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;\n componentUpdateQueue.lastEffect = effect.next = effect;\n } else {\n var lastEffect = componentUpdateQueue.lastEffect;\n\n if (lastEffect === null) {\n componentUpdateQueue.lastEffect = effect.next = effect;\n } else {\n var firstEffect = lastEffect.next;\n lastEffect.next = effect;\n effect.next = firstEffect;\n componentUpdateQueue.lastEffect = effect;\n }\n }\n\n return effect;\n}\n\nfunction mountRef(initialValue) {\n var hook = mountWorkInProgressHook();\n\n {\n var _ref2 = {\n current: initialValue\n };\n hook.memoizedState = _ref2;\n return _ref2;\n }\n}\n\nfunction updateRef(initialValue) {\n var hook = updateWorkInProgressHook();\n return hook.memoizedState;\n}\n\nfunction mountEffectImpl(fiberFlags, hookFlags, create, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n currentlyRenderingFiber$1.flags |= fiberFlags;\n hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps);\n}\n\nfunction updateEffectImpl(fiberFlags, hookFlags, create, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var destroy = undefined;\n\n if (currentHook !== null) {\n var prevEffect = currentHook.memoizedState;\n destroy = prevEffect.destroy;\n\n if (nextDeps !== null) {\n var prevDeps = prevEffect.deps;\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps);\n return;\n }\n }\n }\n\n currentlyRenderingFiber$1.flags |= fiberFlags;\n hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);\n}\n\nfunction mountEffect(create, deps) {\n if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {\n return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps);\n } else {\n return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps);\n }\n}\n\nfunction updateEffect(create, deps) {\n return updateEffectImpl(Passive, Passive$1, create, deps);\n}\n\nfunction mountInsertionEffect(create, deps) {\n return mountEffectImpl(Update, Insertion, create, deps);\n}\n\nfunction updateInsertionEffect(create, deps) {\n return updateEffectImpl(Update, Insertion, create, deps);\n}\n\nfunction mountLayoutEffect(create, deps) {\n var fiberFlags = Update;\n\n {\n fiberFlags |= LayoutStatic;\n }\n\n if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {\n fiberFlags |= MountLayoutDev;\n }\n\n return mountEffectImpl(fiberFlags, Layout, create, deps);\n}\n\nfunction updateLayoutEffect(create, deps) {\n return updateEffectImpl(Update, Layout, create, deps);\n}\n\nfunction imperativeHandleEffect(create, ref) {\n if (typeof ref === 'function') {\n var refCallback = ref;\n\n var _inst = create();\n\n refCallback(_inst);\n return function () {\n refCallback(null);\n };\n } else if (ref !== null && ref !== undefined) {\n var refObject = ref;\n\n {\n if (!refObject.hasOwnProperty('current')) {\n error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');\n }\n }\n\n var _inst2 = create();\n\n refObject.current = _inst2;\n return function () {\n refObject.current = null;\n };\n }\n}\n\nfunction mountImperativeHandle(ref, create, deps) {\n {\n if (typeof create !== 'function') {\n error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n }\n } // TODO: If deps are provided, should we skip comparing the ref itself?\n\n\n var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n var fiberFlags = Update;\n\n {\n fiberFlags |= LayoutStatic;\n }\n\n if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {\n fiberFlags |= MountLayoutDev;\n }\n\n return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\n\nfunction updateImperativeHandle(ref, create, deps) {\n {\n if (typeof create !== 'function') {\n error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n }\n } // TODO: If deps are provided, should we skip comparing the ref itself?\n\n\n var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\n\nfunction mountDebugValue(value, formatterFn) {// This hook is normally a no-op.\n // The react-debug-hooks package injects its own implementation\n // so that e.g. DevTools can display custom hook values.\n}\n\nvar updateDebugValue = mountDebugValue;\n\nfunction mountCallback(callback, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n hook.memoizedState = [callback, nextDeps];\n return callback;\n}\n\nfunction updateCallback(callback, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var prevState = hook.memoizedState;\n\n if (prevState !== null) {\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n\n hook.memoizedState = [callback, nextDeps];\n return callback;\n}\n\nfunction mountMemo(nextCreate, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var nextValue = nextCreate();\n hook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n}\n\nfunction updateMemo(nextCreate, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var prevState = hook.memoizedState;\n\n if (prevState !== null) {\n // Assume these are defined. If they're not, areHookInputsEqual will warn.\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n\n var nextValue = nextCreate();\n hook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n}\n\nfunction mountDeferredValue(value) {\n var hook = mountWorkInProgressHook();\n hook.memoizedState = value;\n return value;\n}\n\nfunction updateDeferredValue(value) {\n var hook = updateWorkInProgressHook();\n var resolvedCurrentHook = currentHook;\n var prevValue = resolvedCurrentHook.memoizedState;\n return updateDeferredValueImpl(hook, prevValue, value);\n}\n\nfunction rerenderDeferredValue(value) {\n var hook = updateWorkInProgressHook();\n\n if (currentHook === null) {\n // This is a rerender during a mount.\n hook.memoizedState = value;\n return value;\n } else {\n // This is a rerender during an update.\n var prevValue = currentHook.memoizedState;\n return updateDeferredValueImpl(hook, prevValue, value);\n }\n}\n\nfunction updateDeferredValueImpl(hook, prevValue, value) {\n var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes);\n\n if (shouldDeferValue) {\n // This is an urgent update. If the value has changed, keep using the\n // previous value and spawn a deferred render to update it later.\n if (!objectIs(value, prevValue)) {\n // Schedule a deferred render\n var deferredLane = claimNextTransitionLane();\n currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane);\n markSkippedUpdateLanes(deferredLane); // Set this to true to indicate that the rendered value is inconsistent\n // from the latest value. The name \"baseState\" doesn't really match how we\n // use it because we're reusing a state hook field instead of creating a\n // new one.\n\n hook.baseState = true;\n } // Reuse the previous value\n\n\n return prevValue;\n } else {\n // This is not an urgent update, so we can use the latest value regardless\n // of what it is. No need to defer it.\n // However, if we're currently inside a spawned render, then we need to mark\n // this as an update to prevent the fiber from bailing out.\n //\n // `baseState` is true when the current value is different from the rendered\n // value. The name doesn't really match how we use it because we're reusing\n // a state hook field instead of creating a new one.\n if (hook.baseState) {\n // Flip this back to false.\n hook.baseState = false;\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = value;\n return value;\n }\n}\n\nfunction startTransition(setPending, callback, options) {\n var previousPriority = getCurrentUpdatePriority();\n setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority));\n setPending(true);\n var prevTransition = ReactCurrentBatchConfig$2.transition;\n ReactCurrentBatchConfig$2.transition = {};\n var currentTransition = ReactCurrentBatchConfig$2.transition;\n\n {\n ReactCurrentBatchConfig$2.transition._updatedFibers = new Set();\n }\n\n try {\n setPending(false);\n callback();\n } finally {\n setCurrentUpdatePriority(previousPriority);\n ReactCurrentBatchConfig$2.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nfunction mountTransition() {\n var _mountState = mountState(false),\n isPending = _mountState[0],\n setPending = _mountState[1]; // The `start` method never changes.\n\n\n var start = startTransition.bind(null, setPending);\n var hook = mountWorkInProgressHook();\n hook.memoizedState = start;\n return [isPending, start];\n}\n\nfunction updateTransition() {\n var _updateState = updateState(),\n isPending = _updateState[0];\n\n var hook = updateWorkInProgressHook();\n var start = hook.memoizedState;\n return [isPending, start];\n}\n\nfunction rerenderTransition() {\n var _rerenderState = rerenderState(),\n isPending = _rerenderState[0];\n\n var hook = updateWorkInProgressHook();\n var start = hook.memoizedState;\n return [isPending, start];\n}\n\nvar isUpdatingOpaqueValueInRenderPhase = false;\nfunction getIsUpdatingOpaqueValueInRenderPhaseInDEV() {\n {\n return isUpdatingOpaqueValueInRenderPhase;\n }\n}\n\nfunction mountId() {\n var hook = mountWorkInProgressHook();\n var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we\n // should do this in Fiber, too? Deferring this decision for now because\n // there's no other place to store the prefix except for an internal field on\n // the public createRoot object, which the fiber tree does not currently have\n // a reference to.\n\n var identifierPrefix = root.identifierPrefix;\n var id;\n\n if (getIsHydrating()) {\n var treeId = getTreeId(); // Use a captial R prefix for server-generated ids.\n\n id = ':' + identifierPrefix + 'R' + treeId; // Unless this is the first id at this level, append a number at the end\n // that represents the position of this useId hook among all the useId\n // hooks for this fiber.\n\n var localId = localIdCounter++;\n\n if (localId > 0) {\n id += 'H' + localId.toString(32);\n }\n\n id += ':';\n } else {\n // Use a lowercase r prefix for client-generated ids.\n var globalClientId = globalClientIdCounter++;\n id = ':' + identifierPrefix + 'r' + globalClientId.toString(32) + ':';\n }\n\n hook.memoizedState = id;\n return id;\n}\n\nfunction updateId() {\n var hook = updateWorkInProgressHook();\n var id = hook.memoizedState;\n return id;\n}\n\nfunction dispatchReducerAction(fiber, queue, action) {\n {\n if (typeof arguments[3] === 'function') {\n error(\"State updates from the useState() and useReducer() Hooks don't support the \" + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');\n }\n }\n\n var lane = requestUpdateLane(fiber);\n var update = {\n lane: lane,\n action: action,\n hasEagerState: false,\n eagerState: null,\n next: null\n };\n\n if (isRenderPhaseUpdate(fiber)) {\n enqueueRenderPhaseUpdate(queue, update);\n } else {\n var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane);\n\n if (root !== null) {\n var eventTime = requestEventTime();\n scheduleUpdateOnFiber(root, fiber, lane, eventTime);\n entangleTransitionUpdate(root, queue, lane);\n }\n }\n\n markUpdateInDevTools(fiber, lane);\n}\n\nfunction dispatchSetState(fiber, queue, action) {\n {\n if (typeof arguments[3] === 'function') {\n error(\"State updates from the useState() and useReducer() Hooks don't support the \" + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');\n }\n }\n\n var lane = requestUpdateLane(fiber);\n var update = {\n lane: lane,\n action: action,\n hasEagerState: false,\n eagerState: null,\n next: null\n };\n\n if (isRenderPhaseUpdate(fiber)) {\n enqueueRenderPhaseUpdate(queue, update);\n } else {\n var alternate = fiber.alternate;\n\n if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {\n // The queue is currently empty, which means we can eagerly compute the\n // next state before entering the render phase. If the new state is the\n // same as the current state, we may be able to bail out entirely.\n var lastRenderedReducer = queue.lastRenderedReducer;\n\n if (lastRenderedReducer !== null) {\n var prevDispatcher;\n\n {\n prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n }\n\n try {\n var currentState = queue.lastRenderedState;\n var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute\n // it, on the update object. If the reducer hasn't changed by the\n // time we enter the render phase, then the eager state can be used\n // without calling the reducer again.\n\n update.hasEagerState = true;\n update.eagerState = eagerState;\n\n if (objectIs(eagerState, currentState)) {\n // Fast path. We can bail out without scheduling React to re-render.\n // It's still possible that we'll need to rebase this update later,\n // if the component re-renders for a different reason and by that\n // time the reducer has changed.\n // TODO: Do we still need to entangle transitions in this case?\n enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane);\n return;\n }\n } catch (error) {// Suppress the error. It will throw again in the render phase.\n } finally {\n {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n }\n }\n }\n\n var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane);\n\n if (root !== null) {\n var eventTime = requestEventTime();\n scheduleUpdateOnFiber(root, fiber, lane, eventTime);\n entangleTransitionUpdate(root, queue, lane);\n }\n }\n\n markUpdateInDevTools(fiber, lane);\n}\n\nfunction isRenderPhaseUpdate(fiber) {\n var alternate = fiber.alternate;\n return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;\n}\n\nfunction enqueueRenderPhaseUpdate(queue, update) {\n // This is a render phase update. Stash it in a lazily-created map of\n // queue -> linked list of updates. After this render pass, we'll restart\n // and apply the stashed updates on top of the work-in-progress hook.\n didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;\n var pending = queue.pending;\n\n if (pending === null) {\n // This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n queue.pending = update;\n} // TODO: Move to ReactFiberConcurrentUpdates?\n\n\nfunction entangleTransitionUpdate(root, queue, lane) {\n if (isTransitionLane(lane)) {\n var queueLanes = queue.lanes; // If any entangled lanes are no longer pending on the root, then they\n // must have finished. We can remove them from the shared queue, which\n // represents a superset of the actually pending lanes. In some cases we\n // may entangle more than we need to, but that's OK. In fact it's worse if\n // we *don't* entangle when we should.\n\n queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes.\n\n var newQueueLanes = mergeLanes(queueLanes, lane);\n queue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if\n // the lane finished since the last time we entangled it. So we need to\n // entangle it again, just to be sure.\n\n markRootEntangled(root, newQueueLanes);\n }\n}\n\nfunction markUpdateInDevTools(fiber, lane, action) {\n\n {\n markStateUpdateScheduled(fiber, lane);\n }\n}\n\nvar ContextOnlyDispatcher = {\n readContext: readContext,\n useCallback: throwInvalidHookError,\n useContext: throwInvalidHookError,\n useEffect: throwInvalidHookError,\n useImperativeHandle: throwInvalidHookError,\n useInsertionEffect: throwInvalidHookError,\n useLayoutEffect: throwInvalidHookError,\n useMemo: throwInvalidHookError,\n useReducer: throwInvalidHookError,\n useRef: throwInvalidHookError,\n useState: throwInvalidHookError,\n useDebugValue: throwInvalidHookError,\n useDeferredValue: throwInvalidHookError,\n useTransition: throwInvalidHookError,\n useMutableSource: throwInvalidHookError,\n useSyncExternalStore: throwInvalidHookError,\n useId: throwInvalidHookError,\n unstable_isNewReconciler: enableNewReconciler\n};\n\nvar HooksDispatcherOnMountInDEV = null;\nvar HooksDispatcherOnMountWithHookTypesInDEV = null;\nvar HooksDispatcherOnUpdateInDEV = null;\nvar HooksDispatcherOnRerenderInDEV = null;\nvar InvalidNestedHooksDispatcherOnMountInDEV = null;\nvar InvalidNestedHooksDispatcherOnUpdateInDEV = null;\nvar InvalidNestedHooksDispatcherOnRerenderInDEV = null;\n\n{\n var warnInvalidContextAccess = function () {\n error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n };\n\n var warnInvalidHookAccess = function () {\n error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks');\n };\n\n HooksDispatcherOnMountInDEV = {\n readContext: function (context) {\n return readContext(context);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountCallback(callback, deps);\n },\n useContext: function (context) {\n currentHookNameInDev = 'useContext';\n mountHookTypesDev();\n return readContext(context);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountImperativeHandle(ref, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n currentHookNameInDev = 'useInsertionEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountInsertionEffect(create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n mountHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n mountHookTypesDev();\n return mountDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n mountHookTypesDev();\n return mountDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n mountHookTypesDev();\n return mountTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n mountHookTypesDev();\n return mountMutableSource();\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n currentHookNameInDev = 'useSyncExternalStore';\n mountHookTypesDev();\n return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n },\n useId: function () {\n currentHookNameInDev = 'useId';\n mountHookTypesDev();\n return mountId();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n\n HooksDispatcherOnMountWithHookTypesInDEV = {\n readContext: function (context) {\n return readContext(context);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return mountCallback(callback, deps);\n },\n useContext: function (context) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return mountImperativeHandle(ref, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n currentHookNameInDev = 'useInsertionEffect';\n updateHookTypesDev();\n return mountInsertionEffect(create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return mountDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return mountDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return mountTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n updateHookTypesDev();\n return mountMutableSource();\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n currentHookNameInDev = 'useSyncExternalStore';\n updateHookTypesDev();\n return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n },\n useId: function () {\n currentHookNameInDev = 'useId';\n updateHookTypesDev();\n return mountId();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n\n HooksDispatcherOnUpdateInDEV = {\n readContext: function (context) {\n return readContext(context);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n currentHookNameInDev = 'useInsertionEffect';\n updateHookTypesDev();\n return updateInsertionEffect(create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return updateDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return updateDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return updateTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n updateHookTypesDev();\n return updateMutableSource();\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n currentHookNameInDev = 'useSyncExternalStore';\n updateHookTypesDev();\n return updateSyncExternalStore(subscribe, getSnapshot);\n },\n useId: function () {\n currentHookNameInDev = 'useId';\n updateHookTypesDev();\n return updateId();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n\n HooksDispatcherOnRerenderInDEV = {\n readContext: function (context) {\n return readContext(context);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n currentHookNameInDev = 'useInsertionEffect';\n updateHookTypesDev();\n return updateInsertionEffect(create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return rerenderReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return rerenderState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return updateDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return rerenderDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return rerenderTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n updateHookTypesDev();\n return updateMutableSource();\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n currentHookNameInDev = 'useSyncExternalStore';\n updateHookTypesDev();\n return updateSyncExternalStore(subscribe, getSnapshot);\n },\n useId: function () {\n currentHookNameInDev = 'useId';\n updateHookTypesDev();\n return updateId();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n\n InvalidNestedHooksDispatcherOnMountInDEV = {\n readContext: function (context) {\n warnInvalidContextAccess();\n return readContext(context);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountCallback(callback, deps);\n },\n useContext: function (context) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return readContext(context);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountImperativeHandle(ref, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n currentHookNameInDev = 'useInsertionEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountInsertionEffect(create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountMutableSource();\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n currentHookNameInDev = 'useSyncExternalStore';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n },\n useId: function () {\n currentHookNameInDev = 'useId';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountId();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n\n InvalidNestedHooksDispatcherOnUpdateInDEV = {\n readContext: function (context) {\n warnInvalidContextAccess();\n return readContext(context);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return readContext(context);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n currentHookNameInDev = 'useInsertionEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateInsertionEffect(create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateMutableSource();\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n currentHookNameInDev = 'useSyncExternalStore';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateSyncExternalStore(subscribe, getSnapshot);\n },\n useId: function () {\n currentHookNameInDev = 'useId';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateId();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n\n InvalidNestedHooksDispatcherOnRerenderInDEV = {\n readContext: function (context) {\n warnInvalidContextAccess();\n return readContext(context);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return readContext(context);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n currentHookNameInDev = 'useInsertionEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateInsertionEffect(create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return rerenderReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return rerenderState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateMutableSource();\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n currentHookNameInDev = 'useSyncExternalStore';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateSyncExternalStore(subscribe, getSnapshot);\n },\n useId: function () {\n currentHookNameInDev = 'useId';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateId();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n}\n\nvar now$1 = Scheduler.unstable_now;\nvar commitTime = 0;\nvar layoutEffectStartTime = -1;\nvar profilerStartTime = -1;\nvar passiveEffectStartTime = -1;\n/**\n * Tracks whether the current update was a nested/cascading update (scheduled from a layout effect).\n *\n * The overall sequence is:\n * 1. render\n * 2. commit (and call `onRender`, `onCommit`)\n * 3. check for nested updates\n * 4. flush passive effects (and call `onPostCommit`)\n *\n * Nested updates are identified in step 3 above,\n * but step 4 still applies to the work that was just committed.\n * We use two flags to track nested updates then:\n * one tracks whether the upcoming update is a nested update,\n * and the other tracks whether the current update was a nested update.\n * The first value gets synced to the second at the start of the render phase.\n */\n\nvar currentUpdateIsNested = false;\nvar nestedUpdateScheduled = false;\n\nfunction isCurrentUpdateNested() {\n return currentUpdateIsNested;\n}\n\nfunction markNestedUpdateScheduled() {\n {\n nestedUpdateScheduled = true;\n }\n}\n\nfunction resetNestedUpdateFlag() {\n {\n currentUpdateIsNested = false;\n nestedUpdateScheduled = false;\n }\n}\n\nfunction syncNestedUpdateFlag() {\n {\n currentUpdateIsNested = nestedUpdateScheduled;\n nestedUpdateScheduled = false;\n }\n}\n\nfunction getCommitTime() {\n return commitTime;\n}\n\nfunction recordCommitTime() {\n\n commitTime = now$1();\n}\n\nfunction startProfilerTimer(fiber) {\n\n profilerStartTime = now$1();\n\n if (fiber.actualStartTime < 0) {\n fiber.actualStartTime = now$1();\n }\n}\n\nfunction stopProfilerTimerIfRunning(fiber) {\n\n profilerStartTime = -1;\n}\n\nfunction stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {\n\n if (profilerStartTime >= 0) {\n var elapsedTime = now$1() - profilerStartTime;\n fiber.actualDuration += elapsedTime;\n\n if (overrideBaseTime) {\n fiber.selfBaseDuration = elapsedTime;\n }\n\n profilerStartTime = -1;\n }\n}\n\nfunction recordLayoutEffectDuration(fiber) {\n\n if (layoutEffectStartTime >= 0) {\n var elapsedTime = now$1() - layoutEffectStartTime;\n layoutEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor\n // Or the root (for the DevTools Profiler to read)\n\n var parentFiber = fiber.return;\n\n while (parentFiber !== null) {\n switch (parentFiber.tag) {\n case HostRoot:\n var root = parentFiber.stateNode;\n root.effectDuration += elapsedTime;\n return;\n\n case Profiler:\n var parentStateNode = parentFiber.stateNode;\n parentStateNode.effectDuration += elapsedTime;\n return;\n }\n\n parentFiber = parentFiber.return;\n }\n }\n}\n\nfunction recordPassiveEffectDuration(fiber) {\n\n if (passiveEffectStartTime >= 0) {\n var elapsedTime = now$1() - passiveEffectStartTime;\n passiveEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor\n // Or the root (for the DevTools Profiler to read)\n\n var parentFiber = fiber.return;\n\n while (parentFiber !== null) {\n switch (parentFiber.tag) {\n case HostRoot:\n var root = parentFiber.stateNode;\n\n if (root !== null) {\n root.passiveEffectDuration += elapsedTime;\n }\n\n return;\n\n case Profiler:\n var parentStateNode = parentFiber.stateNode;\n\n if (parentStateNode !== null) {\n // Detached fibers have their state node cleared out.\n // In this case, the return pointer is also cleared out,\n // so we won't be able to report the time spent in this Profiler's subtree.\n parentStateNode.passiveEffectDuration += elapsedTime;\n }\n\n return;\n }\n\n parentFiber = parentFiber.return;\n }\n }\n}\n\nfunction startLayoutEffectTimer() {\n\n layoutEffectStartTime = now$1();\n}\n\nfunction startPassiveEffectTimer() {\n\n passiveEffectStartTime = now$1();\n}\n\nfunction transferActualDuration(fiber) {\n // Transfer time spent rendering these children so we don't lose it\n // after we rerender. This is used as a helper in special cases\n // where we should count the work of multiple passes.\n var child = fiber.child;\n\n while (child) {\n fiber.actualDuration += child.actualDuration;\n child = child.sibling;\n }\n}\n\nfunction createCapturedValueAtFiber(value, source) {\n // If the value is an error, call this function immediately after it is thrown\n // so the stack is accurate.\n return {\n value: value,\n source: source,\n stack: getStackByFiberInDevAndProd(source),\n digest: null\n };\n}\nfunction createCapturedValue(value, digest, stack) {\n return {\n value: value,\n source: null,\n stack: stack != null ? stack : null,\n digest: digest != null ? digest : null\n };\n}\n\n// This module is forked in different environments.\n// By default, return `true` to log errors to the console.\n// Forks can return `false` if this isn't desirable.\nfunction showErrorDialog(boundary, errorInfo) {\n return true;\n}\n\nfunction logCapturedError(boundary, errorInfo) {\n try {\n var logError = showErrorDialog(boundary, errorInfo); // Allow injected showErrorDialog() to prevent default console.error logging.\n // This enables renderers like ReactNative to better manage redbox behavior.\n\n if (logError === false) {\n return;\n }\n\n var error = errorInfo.value;\n\n if (true) {\n var source = errorInfo.source;\n var stack = errorInfo.stack;\n var componentStack = stack !== null ? stack : ''; // Browsers support silencing uncaught errors by calling\n // `preventDefault()` in window `error` handler.\n // We record this information as an expando on the error.\n\n if (error != null && error._suppressLogging) {\n if (boundary.tag === ClassComponent) {\n // The error is recoverable and was silenced.\n // Ignore it and don't print the stack addendum.\n // This is handy for testing error boundaries without noise.\n return;\n } // The error is fatal. Since the silencing might have\n // been accidental, we'll surface it anyway.\n // However, the browser would have silenced the original error\n // so we'll print it first, and then print the stack addendum.\n\n\n console['error'](error); // Don't transform to our wrapper\n // For a more detailed description of this block, see:\n // https://github.com/facebook/react/pull/13384\n }\n\n var componentName = source ? getComponentNameFromFiber(source) : null;\n var componentNameMessage = componentName ? \"The above error occurred in the <\" + componentName + \"> component:\" : 'The above error occurred in one of your React components:';\n var errorBoundaryMessage;\n\n if (boundary.tag === HostRoot) {\n errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\\n' + 'Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.';\n } else {\n var errorBoundaryName = getComponentNameFromFiber(boundary) || 'Anonymous';\n errorBoundaryMessage = \"React will try to recreate this component tree from scratch \" + (\"using the error boundary you provided, \" + errorBoundaryName + \".\");\n }\n\n var combinedMessage = componentNameMessage + \"\\n\" + componentStack + \"\\n\\n\" + (\"\" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.\n // We don't include the original error message and JS stack because the browser\n // has already printed it. Even if the application swallows the error, it is still\n // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.\n\n console['error'](combinedMessage); // Don't transform to our wrapper\n } else {}\n } catch (e) {\n // This method must not throw, or React internal state will get messed up.\n // If console.error is overridden, or logCapturedError() shows a dialog that throws,\n // we want to report this error outside of the normal stack as a last resort.\n // https://github.com/facebook/react/issues/13188\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nvar PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;\n\nfunction createRootErrorUpdate(fiber, errorInfo, lane) {\n var update = createUpdate(NoTimestamp, lane); // Unmount the root by rendering null.\n\n update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property\n // being called \"element\".\n\n update.payload = {\n element: null\n };\n var error = errorInfo.value;\n\n update.callback = function () {\n onUncaughtError(error);\n logCapturedError(fiber, errorInfo);\n };\n\n return update;\n}\n\nfunction createClassErrorUpdate(fiber, errorInfo, lane) {\n var update = createUpdate(NoTimestamp, lane);\n update.tag = CaptureUpdate;\n var getDerivedStateFromError = fiber.type.getDerivedStateFromError;\n\n if (typeof getDerivedStateFromError === 'function') {\n var error$1 = errorInfo.value;\n\n update.payload = function () {\n return getDerivedStateFromError(error$1);\n };\n\n update.callback = function () {\n {\n markFailedErrorBoundaryForHotReloading(fiber);\n }\n\n logCapturedError(fiber, errorInfo);\n };\n }\n\n var inst = fiber.stateNode;\n\n if (inst !== null && typeof inst.componentDidCatch === 'function') {\n update.callback = function callback() {\n {\n markFailedErrorBoundaryForHotReloading(fiber);\n }\n\n logCapturedError(fiber, errorInfo);\n\n if (typeof getDerivedStateFromError !== 'function') {\n // To preserve the preexisting retry behavior of error boundaries,\n // we keep track of which ones already failed during this batch.\n // This gets reset before we yield back to the browser.\n // TODO: Warn in strict mode if getDerivedStateFromError is\n // not defined.\n markLegacyErrorBoundaryAsFailed(this);\n }\n\n var error$1 = errorInfo.value;\n var stack = errorInfo.stack;\n this.componentDidCatch(error$1, {\n componentStack: stack !== null ? stack : ''\n });\n\n {\n if (typeof getDerivedStateFromError !== 'function') {\n // If componentDidCatch is the only error boundary method defined,\n // then it needs to call setState to recover from errors.\n // If no state update is scheduled then the boundary will swallow the error.\n if (!includesSomeLane(fiber.lanes, SyncLane)) {\n error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentNameFromFiber(fiber) || 'Unknown');\n }\n }\n }\n };\n }\n\n return update;\n}\n\nfunction attachPingListener(root, wakeable, lanes) {\n // Attach a ping listener\n //\n // The data might resolve before we have a chance to commit the fallback. Or,\n // in the case of a refresh, we'll never commit a fallback. So we need to\n // attach a listener now. When it resolves (\"pings\"), we can decide whether to\n // try rendering the tree again.\n //\n // Only attach a listener if one does not already exist for the lanes\n // we're currently rendering (which acts like a \"thread ID\" here).\n //\n // We only need to do this in concurrent mode. Legacy Suspense always\n // commits fallbacks synchronously, so there are no pings.\n var pingCache = root.pingCache;\n var threadIDs;\n\n if (pingCache === null) {\n pingCache = root.pingCache = new PossiblyWeakMap$1();\n threadIDs = new Set();\n pingCache.set(wakeable, threadIDs);\n } else {\n threadIDs = pingCache.get(wakeable);\n\n if (threadIDs === undefined) {\n threadIDs = new Set();\n pingCache.set(wakeable, threadIDs);\n }\n }\n\n if (!threadIDs.has(lanes)) {\n // Memoize using the thread ID to prevent redundant listeners.\n threadIDs.add(lanes);\n var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes);\n\n {\n if (isDevToolsPresent) {\n // If we have pending work still, restore the original updaters\n restorePendingUpdaters(root, lanes);\n }\n }\n\n wakeable.then(ping, ping);\n }\n}\n\nfunction attachRetryListener(suspenseBoundary, root, wakeable, lanes) {\n // Retry listener\n //\n // If the fallback does commit, we need to attach a different type of\n // listener. This one schedules an update on the Suspense boundary to turn\n // the fallback state off.\n //\n // Stash the wakeable on the boundary fiber so we can access it in the\n // commit phase.\n //\n // When the wakeable resolves, we'll attempt to render the boundary\n // again (\"retry\").\n var wakeables = suspenseBoundary.updateQueue;\n\n if (wakeables === null) {\n var updateQueue = new Set();\n updateQueue.add(wakeable);\n suspenseBoundary.updateQueue = updateQueue;\n } else {\n wakeables.add(wakeable);\n }\n}\n\nfunction resetSuspendedComponent(sourceFiber, rootRenderLanes) {\n // A legacy mode Suspense quirk, only relevant to hook components.\n\n\n var tag = sourceFiber.tag;\n\n if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) {\n var currentSource = sourceFiber.alternate;\n\n if (currentSource) {\n sourceFiber.updateQueue = currentSource.updateQueue;\n sourceFiber.memoizedState = currentSource.memoizedState;\n sourceFiber.lanes = currentSource.lanes;\n } else {\n sourceFiber.updateQueue = null;\n sourceFiber.memoizedState = null;\n }\n }\n}\n\nfunction getNearestSuspenseBoundaryToCapture(returnFiber) {\n var node = returnFiber;\n\n do {\n if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {\n return node;\n } // This boundary already captured during this render. Continue to the next\n // boundary.\n\n\n node = node.return;\n } while (node !== null);\n\n return null;\n}\n\nfunction markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes) {\n // This marks a Suspense boundary so that when we're unwinding the stack,\n // it captures the suspended \"exception\" and does a second (fallback) pass.\n if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {\n // Legacy Mode Suspense\n //\n // If the boundary is in legacy mode, we should *not*\n // suspend the commit. Pretend as if the suspended component rendered\n // null and keep rendering. When the Suspense boundary completes,\n // we'll do a second pass to render the fallback.\n if (suspenseBoundary === returnFiber) {\n // Special case where we suspended while reconciling the children of\n // a Suspense boundary's inner Offscreen wrapper fiber. This happens\n // when a React.lazy component is a direct child of a\n // Suspense boundary.\n //\n // Suspense boundaries are implemented as multiple fibers, but they\n // are a single conceptual unit. The legacy mode behavior where we\n // pretend the suspended fiber committed as `null` won't work,\n // because in this case the \"suspended\" fiber is the inner\n // Offscreen wrapper.\n //\n // Because the contents of the boundary haven't started rendering\n // yet (i.e. nothing in the tree has partially rendered) we can\n // switch to the regular, concurrent mode behavior: mark the\n // boundary with ShouldCapture and enter the unwind phase.\n suspenseBoundary.flags |= ShouldCapture;\n } else {\n suspenseBoundary.flags |= DidCapture;\n sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.\n // But we shouldn't call any lifecycle methods or callbacks. Remove\n // all lifecycle effect tags.\n\n sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);\n\n if (sourceFiber.tag === ClassComponent) {\n var currentSourceFiber = sourceFiber.alternate;\n\n if (currentSourceFiber === null) {\n // This is a new mount. Change the tag so it's not mistaken for a\n // completed class component. For example, we should not call\n // componentWillUnmount if it is deleted.\n sourceFiber.tag = IncompleteClassComponent;\n } else {\n // When we try rendering again, we should not reuse the current fiber,\n // since it's known to be in an inconsistent state. Use a force update to\n // prevent a bail out.\n var update = createUpdate(NoTimestamp, SyncLane);\n update.tag = ForceUpdate;\n enqueueUpdate(sourceFiber, update, SyncLane);\n }\n } // The source fiber did not complete. Mark it with Sync priority to\n // indicate that it still has pending work.\n\n\n sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);\n }\n\n return suspenseBoundary;\n } // Confirmed that the boundary is in a concurrent mode tree. Continue\n // with the normal suspend path.\n //\n // After this we'll use a set of heuristics to determine whether this\n // render pass will run to completion or restart or \"suspend\" the commit.\n // The actual logic for this is spread out in different places.\n //\n // This first principle is that if we're going to suspend when we complete\n // a root, then we should also restart if we get an update or ping that\n // might unsuspend it, and vice versa. The only reason to suspend is\n // because you think you might want to restart before committing. However,\n // it doesn't make sense to restart only while in the period we're suspended.\n //\n // Restarting too aggressively is also not good because it starves out any\n // intermediate loading state. So we use heuristics to determine when.\n // Suspense Heuristics\n //\n // If nothing threw a Promise or all the same fallbacks are already showing,\n // then don't suspend/restart.\n //\n // If this is an initial render of a new tree of Suspense boundaries and\n // those trigger a fallback, then don't suspend/restart. We want to ensure\n // that we can show the initial loading state as quickly as possible.\n //\n // If we hit a \"Delayed\" case, such as when we'd switch from content back into\n // a fallback, then we should always suspend/restart. Transitions apply\n // to this case. If none is defined, JND is used instead.\n //\n // If we're already showing a fallback and it gets \"retried\", allowing us to show\n // another level, but there's still an inner boundary that would show a fallback,\n // then we suspend/restart for 500ms since the last time we showed a fallback\n // anywhere in the tree. This effectively throttles progressive loading into a\n // consistent train of commits. This also gives us an opportunity to restart to\n // get to the completed state slightly earlier.\n //\n // If there's ambiguity due to batching it's resolved in preference of:\n // 1) \"delayed\", 2) \"initial render\", 3) \"retry\".\n //\n // We want to ensure that a \"busy\" state doesn't get force committed. We want to\n // ensure that new initial loading states can commit as soon as possible.\n\n\n suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in\n // the begin phase to prevent an early bailout.\n\n suspenseBoundary.lanes = rootRenderLanes;\n return suspenseBoundary;\n}\n\nfunction throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) {\n // The source fiber did not complete.\n sourceFiber.flags |= Incomplete;\n\n {\n if (isDevToolsPresent) {\n // If we have pending work still, restore the original updaters\n restorePendingUpdaters(root, rootRenderLanes);\n }\n }\n\n if (value !== null && typeof value === 'object' && typeof value.then === 'function') {\n // This is a wakeable. The component suspended.\n var wakeable = value;\n resetSuspendedComponent(sourceFiber);\n\n {\n if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {\n markDidThrowWhileHydratingDEV();\n }\n }\n\n\n var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);\n\n if (suspenseBoundary !== null) {\n suspenseBoundary.flags &= ~ForceClientRender;\n markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); // We only attach ping listeners in concurrent mode. Legacy Suspense always\n // commits fallbacks synchronously, so there are no pings.\n\n if (suspenseBoundary.mode & ConcurrentMode) {\n attachPingListener(root, wakeable, rootRenderLanes);\n }\n\n attachRetryListener(suspenseBoundary, root, wakeable);\n return;\n } else {\n // No boundary was found. Unless this is a sync update, this is OK.\n // We can suspend and wait for more data to arrive.\n if (!includesSyncLane(rootRenderLanes)) {\n // This is not a sync update. Suspend. Since we're not activating a\n // Suspense boundary, this will unwind all the way to the root without\n // performing a second pass to render a fallback. (This is arguably how\n // refresh transitions should work, too, since we're not going to commit\n // the fallbacks anyway.)\n //\n // This case also applies to initial hydration.\n attachPingListener(root, wakeable, rootRenderLanes);\n renderDidSuspendDelayIfPossible();\n return;\n } // This is a sync/discrete update. We treat this case like an error\n // because discrete renders are expected to produce a complete tree\n // synchronously to maintain consistency with external state.\n\n\n var uncaughtSuspenseError = new Error('A component suspended while responding to synchronous input. This ' + 'will cause the UI to be replaced with a loading indicator. To ' + 'fix, updates that suspend should be wrapped ' + 'with startTransition.'); // If we're outside a transition, fall through to the regular error path.\n // The error will be caught by the nearest suspense boundary.\n\n value = uncaughtSuspenseError;\n }\n } else {\n // This is a regular error, not a Suspense wakeable.\n if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {\n markDidThrowWhileHydratingDEV();\n\n var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); // If the error was thrown during hydration, we may be able to recover by\n // discarding the dehydrated content and switching to a client render.\n // Instead of surfacing the error, find the nearest Suspense boundary\n // and render it again without hydration.\n\n\n if (_suspenseBoundary !== null) {\n if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) {\n // Set a flag to indicate that we should try rendering the normal\n // children again, not the fallback.\n _suspenseBoundary.flags |= ForceClientRender;\n }\n\n markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); // Even though the user may not be affected by this error, we should\n // still log it so it can be fixed.\n\n queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));\n return;\n }\n }\n }\n\n value = createCapturedValueAtFiber(value, sourceFiber);\n renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start\n // over and traverse parent path again, this time treating the exception\n // as an error.\n\n var workInProgress = returnFiber;\n\n do {\n switch (workInProgress.tag) {\n case HostRoot:\n {\n var _errorInfo = value;\n workInProgress.flags |= ShouldCapture;\n var lane = pickArbitraryLane(rootRenderLanes);\n workInProgress.lanes = mergeLanes(workInProgress.lanes, lane);\n var update = createRootErrorUpdate(workInProgress, _errorInfo, lane);\n enqueueCapturedUpdate(workInProgress, update);\n return;\n }\n\n case ClassComponent:\n // Capture and retry\n var errorInfo = value;\n var ctor = workInProgress.type;\n var instance = workInProgress.stateNode;\n\n if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {\n workInProgress.flags |= ShouldCapture;\n\n var _lane = pickArbitraryLane(rootRenderLanes);\n\n workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state\n\n var _update = createClassErrorUpdate(workInProgress, errorInfo, _lane);\n\n enqueueCapturedUpdate(workInProgress, _update);\n return;\n }\n\n break;\n }\n\n workInProgress = workInProgress.return;\n } while (workInProgress !== null);\n}\n\nfunction getSuspendedCache() {\n {\n return null;\n } // This function is called when a Suspense boundary suspends. It returns the\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar didReceiveUpdate = false;\nvar didWarnAboutBadClass;\nvar didWarnAboutModulePatternComponent;\nvar didWarnAboutContextTypeOnFunctionComponent;\nvar didWarnAboutGetDerivedStateOnFunctionComponent;\nvar didWarnAboutFunctionRefs;\nvar didWarnAboutReassigningProps;\nvar didWarnAboutRevealOrder;\nvar didWarnAboutTailOptions;\n\n{\n didWarnAboutBadClass = {};\n didWarnAboutModulePatternComponent = {};\n didWarnAboutContextTypeOnFunctionComponent = {};\n didWarnAboutGetDerivedStateOnFunctionComponent = {};\n didWarnAboutFunctionRefs = {};\n didWarnAboutReassigningProps = false;\n didWarnAboutRevealOrder = {};\n didWarnAboutTailOptions = {};\n}\n\nfunction reconcileChildren(current, workInProgress, nextChildren, renderLanes) {\n if (current === null) {\n // If this is a fresh new component that hasn't been rendered yet, we\n // won't update its child set by applying minimal side-effects. Instead,\n // we will add them all to the child before it gets rendered. That means\n // we can optimize this reconciliation pass by not tracking side-effects.\n workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);\n } else {\n // If the current child is the same as the work in progress, it means that\n // we haven't yet started any work on these children. Therefore, we use\n // the clone algorithm to create a copy of all the current children.\n // If we had any progressed work already, that is invalid at this point so\n // let's throw it out.\n workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes);\n }\n}\n\nfunction forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) {\n // This function is fork of reconcileChildren. It's used in cases where we\n // want to reconcile without matching against the existing set. This has the\n // effect of all current children being unmounted; even if the type and key\n // are the same, the old child is unmounted and a new child is created.\n //\n // To do this, we're going to go through the reconcile algorithm twice. In\n // the first pass, we schedule a deletion for all the current children by\n // passing null.\n workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); // In the second pass, we mount the new children. The trick here is that we\n // pass null in place of where we usually pass the current child set. This has\n // the effect of remounting all children regardless of whether their\n // identities match.\n\n workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);\n}\n\nfunction updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) {\n // TODO: current can be non-null here even if the component\n // hasn't yet mounted. This happens after the first render suspends.\n // We'll need to figure out if this is fine or can cause issues.\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentNameFromType(Component));\n }\n }\n }\n\n var render = Component.render;\n var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent\n\n var nextChildren;\n var hasId;\n prepareToReadContext(workInProgress, renderLanes);\n\n {\n markComponentRenderStarted(workInProgress);\n }\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);\n hasId = checkDidRenderIdHook();\n\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);\n hasId = checkDidRenderIdHook();\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n\n setIsRendering(false);\n }\n\n {\n markComponentRenderStopped();\n }\n\n if (current !== null && !didReceiveUpdate) {\n bailoutHooks(current, workInProgress, renderLanes);\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n\n if (getIsHydrating() && hasId) {\n pushMaterializedTreeId(workInProgress);\n } // React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateMemoComponent(current, workInProgress, Component, nextProps, renderLanes) {\n if (current === null) {\n var type = Component.type;\n\n if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.\n Component.defaultProps === undefined) {\n var resolvedType = type;\n\n {\n resolvedType = resolveFunctionForHotReloading(type);\n } // If this is a plain function component without default props,\n // and with only the default shallow comparison, we upgrade it\n // to a SimpleMemoComponent to allow fast path updates.\n\n\n workInProgress.tag = SimpleMemoComponent;\n workInProgress.type = resolvedType;\n\n {\n validateFunctionComponentInDev(workInProgress, type);\n }\n\n return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, renderLanes);\n }\n\n {\n var innerPropTypes = type.propTypes;\n\n if (innerPropTypes) {\n // Inner memo component props aren't currently validated in createElement.\n // We could move it there, but we'd still need this for lazy code path.\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentNameFromType(type));\n }\n }\n\n var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes);\n child.ref = workInProgress.ref;\n child.return = workInProgress;\n workInProgress.child = child;\n return child;\n }\n\n {\n var _type = Component.type;\n var _innerPropTypes = _type.propTypes;\n\n if (_innerPropTypes) {\n // Inner memo component props aren't currently validated in createElement.\n // We could move it there, but we'd still need this for lazy code path.\n checkPropTypes(_innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentNameFromType(_type));\n }\n }\n\n var currentChild = current.child; // This is always exactly one child\n\n var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes);\n\n if (!hasScheduledUpdateOrContext) {\n // This will be the props with resolved defaultProps,\n // unlike current.memoizedProps which will be the unresolved ones.\n var prevProps = currentChild.memoizedProps; // Default to shallow comparison\n\n var compare = Component.compare;\n compare = compare !== null ? compare : shallowEqual;\n\n if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n } // React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n var newChild = createWorkInProgress(currentChild, nextProps);\n newChild.ref = workInProgress.ref;\n newChild.return = workInProgress;\n workInProgress.child = newChild;\n return newChild;\n}\n\nfunction updateSimpleMemoComponent(current, workInProgress, Component, nextProps, renderLanes) {\n // TODO: current can be non-null here even if the component\n // hasn't yet mounted. This happens when the inner render suspends.\n // We'll need to figure out if this is fine or can cause issues.\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var outerMemoType = workInProgress.elementType;\n\n if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {\n // We warn when you define propTypes on lazy()\n // so let's just skip over it to find memo() outer wrapper.\n // Inner props for memo are validated later.\n var lazyComponent = outerMemoType;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n outerMemoType = init(payload);\n } catch (x) {\n outerMemoType = null;\n } // Inner propTypes will be validated in the function component path.\n\n\n var outerPropTypes = outerMemoType && outerMemoType.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)\n 'prop', getComponentNameFromType(outerMemoType));\n }\n }\n }\n }\n\n if (current !== null) {\n var prevProps = current.memoizedProps;\n\n if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload.\n workInProgress.type === current.type )) {\n didReceiveUpdate = false; // The props are shallowly equal. Reuse the previous props object, like we\n // would during a normal fiber bailout.\n //\n // We don't have strong guarantees that the props object is referentially\n // equal during updates where we can't bail out anyway — like if the props\n // are shallowly equal, but there's a local state or context update in the\n // same batch.\n //\n // However, as a principle, we should aim to make the behavior consistent\n // across different ways of memoizing a component. For example, React.memo\n // has a different internal Fiber layout if you pass a normal function\n // component (SimpleMemoComponent) versus if you pass a different type\n // like forwardRef (MemoComponent). But this is an implementation detail.\n // Wrapping a component in forwardRef (or React.lazy, etc) shouldn't\n // affect whether the props object is reused during a bailout.\n\n workInProgress.pendingProps = nextProps = prevProps;\n\n if (!checkScheduledUpdateOrContext(current, renderLanes)) {\n // The pending lanes were cleared at the beginning of beginWork. We're\n // about to bail out, but there might be other lanes that weren't\n // included in the current render. Usually, the priority level of the\n // remaining updates is accumulated during the evaluation of the\n // component (i.e. when processing the update queue). But since since\n // we're bailing out early *without* evaluating the component, we need\n // to account for it here, too. Reset to the value of the current fiber.\n // NOTE: This only applies to SimpleMemoComponent, not MemoComponent,\n // because a MemoComponent fiber does not have hooks or an update queue;\n // rather, it wraps around an inner component, which may or may not\n // contains hooks.\n // TODO: Move the reset at in beginWork out of the common path so that\n // this is no longer necessary.\n workInProgress.lanes = current.lanes;\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {\n // This is a special case that only exists for legacy mode.\n // See https://github.com/facebook/react/pull/19216.\n didReceiveUpdate = true;\n }\n }\n }\n\n return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes);\n}\n\nfunction updateOffscreenComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps;\n var nextChildren = nextProps.children;\n var prevState = current !== null ? current.memoizedState : null;\n\n if (nextProps.mode === 'hidden' || enableLegacyHidden ) {\n // Rendering a hidden tree.\n if ((workInProgress.mode & ConcurrentMode) === NoMode) {\n // In legacy sync mode, don't defer the subtree. Render it now.\n // TODO: Consider how Offscreen should work with transitions in the future\n var nextState = {\n baseLanes: NoLanes,\n cachePool: null,\n transitions: null\n };\n workInProgress.memoizedState = nextState;\n\n pushRenderLanes(workInProgress, renderLanes);\n } else if (!includesSomeLane(renderLanes, OffscreenLane)) {\n var spawnedCachePool = null; // We're hidden, and we're not rendering at Offscreen. We will bail out\n // and resume this tree later.\n\n var nextBaseLanes;\n\n if (prevState !== null) {\n var prevBaseLanes = prevState.baseLanes;\n nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes);\n } else {\n nextBaseLanes = renderLanes;\n } // Schedule this fiber to re-render at offscreen priority. Then bailout.\n\n\n workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane);\n var _nextState = {\n baseLanes: nextBaseLanes,\n cachePool: spawnedCachePool,\n transitions: null\n };\n workInProgress.memoizedState = _nextState;\n workInProgress.updateQueue = null;\n // to avoid a push/pop misalignment.\n\n\n pushRenderLanes(workInProgress, nextBaseLanes);\n\n return null;\n } else {\n // This is the second render. The surrounding visible content has already\n // committed. Now we resume rendering the hidden tree.\n // Rendering at offscreen, so we can clear the base lanes.\n var _nextState2 = {\n baseLanes: NoLanes,\n cachePool: null,\n transitions: null\n };\n workInProgress.memoizedState = _nextState2; // Push the lanes that were skipped when we bailed out.\n\n var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes;\n\n pushRenderLanes(workInProgress, subtreeRenderLanes);\n }\n } else {\n // Rendering a visible tree.\n var _subtreeRenderLanes;\n\n if (prevState !== null) {\n // We're going from hidden -> visible.\n _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes);\n\n workInProgress.memoizedState = null;\n } else {\n // We weren't previously hidden, and we still aren't, so there's nothing\n // special to do. Need to push to the stack regardless, though, to avoid\n // a push/pop misalignment.\n _subtreeRenderLanes = renderLanes;\n }\n\n pushRenderLanes(workInProgress, _subtreeRenderLanes);\n }\n\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n} // Note: These happen to have identical begin phases, for now. We shouldn't hold\n\nfunction updateFragment(current, workInProgress, renderLanes) {\n var nextChildren = workInProgress.pendingProps;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateMode(current, workInProgress, renderLanes) {\n var nextChildren = workInProgress.pendingProps.children;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateProfiler(current, workInProgress, renderLanes) {\n {\n workInProgress.flags |= Update;\n\n {\n // Reset effect durations for the next eventual effect phase.\n // These are reset during render to allow the DevTools commit hook a chance to read them,\n var stateNode = workInProgress.stateNode;\n stateNode.effectDuration = 0;\n stateNode.passiveEffectDuration = 0;\n }\n }\n\n var nextProps = workInProgress.pendingProps;\n var nextChildren = nextProps.children;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction markRef(current, workInProgress) {\n var ref = workInProgress.ref;\n\n if (current === null && ref !== null || current !== null && current.ref !== ref) {\n // Schedule a Ref effect\n workInProgress.flags |= Ref;\n\n {\n workInProgress.flags |= RefStatic;\n }\n }\n}\n\nfunction updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentNameFromType(Component));\n }\n }\n }\n\n var context;\n\n {\n var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);\n context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n var nextChildren;\n var hasId;\n prepareToReadContext(workInProgress, renderLanes);\n\n {\n markComponentRenderStarted(workInProgress);\n }\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);\n hasId = checkDidRenderIdHook();\n\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);\n hasId = checkDidRenderIdHook();\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n\n setIsRendering(false);\n }\n\n {\n markComponentRenderStopped();\n }\n\n if (current !== null && !didReceiveUpdate) {\n bailoutHooks(current, workInProgress, renderLanes);\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n\n if (getIsHydrating() && hasId) {\n pushMaterializedTreeId(workInProgress);\n } // React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) {\n {\n // This is used by DevTools to force a boundary to error.\n switch (shouldError(workInProgress)) {\n case false:\n {\n var _instance = workInProgress.stateNode;\n var ctor = workInProgress.type; // TODO This way of resetting the error boundary state is a hack.\n // Is there a better way to do this?\n\n var tempInstance = new ctor(workInProgress.memoizedProps, _instance.context);\n var state = tempInstance.state;\n\n _instance.updater.enqueueSetState(_instance, state, null);\n\n break;\n }\n\n case true:\n {\n workInProgress.flags |= DidCapture;\n workInProgress.flags |= ShouldCapture; // eslint-disable-next-line react-internal/prod-error-codes\n\n var error$1 = new Error('Simulated error coming from DevTools');\n var lane = pickArbitraryLane(renderLanes);\n workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); // Schedule the error boundary to re-render using updated state\n\n var update = createClassErrorUpdate(workInProgress, createCapturedValueAtFiber(error$1, workInProgress), lane);\n enqueueCapturedUpdate(workInProgress, update);\n break;\n }\n }\n\n if (workInProgress.type !== workInProgress.elementType) {\n // Lazy component props can't be validated in createElement\n // because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, // Resolved props\n 'prop', getComponentNameFromType(Component));\n }\n }\n } // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n\n var hasContext;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n prepareToReadContext(workInProgress, renderLanes);\n var instance = workInProgress.stateNode;\n var shouldUpdate;\n\n if (instance === null) {\n resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); // In the initial pass we might need to construct the instance.\n\n constructClassInstance(workInProgress, Component, nextProps);\n mountClassInstance(workInProgress, Component, nextProps, renderLanes);\n shouldUpdate = true;\n } else if (current === null) {\n // In a resume, we'll already have an instance we can reuse.\n shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes);\n } else {\n shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes);\n }\n\n var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes);\n\n {\n var inst = workInProgress.stateNode;\n\n if (shouldUpdate && inst.props !== nextProps) {\n if (!didWarnAboutReassigningProps) {\n error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentNameFromFiber(workInProgress) || 'a component');\n }\n\n didWarnAboutReassigningProps = true;\n }\n }\n\n return nextUnitOfWork;\n}\n\nfunction finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) {\n // Refs should update even if shouldComponentUpdate returns false\n markRef(current, workInProgress);\n var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags;\n\n if (!shouldUpdate && !didCaptureError) {\n // Context providers should defer to sCU for rendering\n if (hasContext) {\n invalidateContextProvider(workInProgress, Component, false);\n }\n\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n\n var instance = workInProgress.stateNode; // Rerender\n\n ReactCurrentOwner$1.current = workInProgress;\n var nextChildren;\n\n if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {\n // If we captured an error, but getDerivedStateFromError is not defined,\n // unmount all the children. componentDidCatch will schedule an update to\n // re-render a fallback. This is temporary until we migrate everyone to\n // the new API.\n // TODO: Warn in a future release.\n nextChildren = null;\n\n {\n stopProfilerTimerIfRunning();\n }\n } else {\n {\n markComponentRenderStarted(workInProgress);\n }\n\n {\n setIsRendering(true);\n nextChildren = instance.render();\n\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n instance.render();\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n\n setIsRendering(false);\n }\n\n {\n markComponentRenderStopped();\n }\n } // React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n\n if (current !== null && didCaptureError) {\n // If we're recovering from an error, reconcile without reusing any of\n // the existing children. Conceptually, the normal children and the children\n // that are shown on error are two different sets, so we shouldn't reuse\n // normal children even if their identities match.\n forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes);\n } else {\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n } // Memoize state using the values we just used to render.\n // TODO: Restructure so we never read values from the instance.\n\n\n workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.\n\n if (hasContext) {\n invalidateContextProvider(workInProgress, Component, true);\n }\n\n return workInProgress.child;\n}\n\nfunction pushHostRootContext(workInProgress) {\n var root = workInProgress.stateNode;\n\n if (root.pendingContext) {\n pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);\n } else if (root.context) {\n // Should always be set\n pushTopLevelContextObject(workInProgress, root.context, false);\n }\n\n pushHostContainer(workInProgress, root.containerInfo);\n}\n\nfunction updateHostRoot(current, workInProgress, renderLanes) {\n pushHostRootContext(workInProgress);\n\n if (current === null) {\n throw new Error('Should have a current fiber. This is a bug in React.');\n }\n\n var nextProps = workInProgress.pendingProps;\n var prevState = workInProgress.memoizedState;\n var prevChildren = prevState.element;\n cloneUpdateQueue(current, workInProgress);\n processUpdateQueue(workInProgress, nextProps, null, renderLanes);\n var nextState = workInProgress.memoizedState;\n var root = workInProgress.stateNode;\n // being called \"element\".\n\n\n var nextChildren = nextState.element;\n\n if ( prevState.isDehydrated) {\n // This is a hydration root whose shell has not yet hydrated. We should\n // attempt to hydrate.\n // Flip isDehydrated to false to indicate that when this render\n // finishes, the root will no longer be dehydrated.\n var overrideState = {\n element: nextChildren,\n isDehydrated: false,\n cache: nextState.cache,\n pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries,\n transitions: nextState.transitions\n };\n var updateQueue = workInProgress.updateQueue; // `baseState` can always be the last state because the root doesn't\n // have reducer functions so it doesn't need rebasing.\n\n updateQueue.baseState = overrideState;\n workInProgress.memoizedState = overrideState;\n\n if (workInProgress.flags & ForceClientRender) {\n // Something errored during a previous attempt to hydrate the shell, so we\n // forced a client render.\n var recoverableError = createCapturedValueAtFiber(new Error('There was an error while hydrating. Because the error happened outside ' + 'of a Suspense boundary, the entire root will switch to ' + 'client rendering.'), workInProgress);\n return mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, recoverableError);\n } else if (nextChildren !== prevChildren) {\n var _recoverableError = createCapturedValueAtFiber(new Error('This root received an early update, before anything was able ' + 'hydrate. Switched the entire root to client rendering.'), workInProgress);\n\n return mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, _recoverableError);\n } else {\n // The outermost shell has not hydrated yet. Start hydrating.\n enterHydrationState(workInProgress);\n\n var child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);\n workInProgress.child = child;\n var node = child;\n\n while (node) {\n // Mark each child as hydrating. This is a fast path to know whether this\n // tree is part of a hydrating tree. This is used to determine if a child\n // node has fully mounted yet, and for scheduling event replaying.\n // Conceptually this is similar to Placement in that a new subtree is\n // inserted into the React tree here. It just happens to not need DOM\n // mutations because it already exists.\n node.flags = node.flags & ~Placement | Hydrating;\n node = node.sibling;\n }\n }\n } else {\n // Root is not dehydrated. Either this is a client-only root, or it\n // already hydrated.\n resetHydrationState();\n\n if (nextChildren === prevChildren) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n }\n\n return workInProgress.child;\n}\n\nfunction mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, recoverableError) {\n // Revert to client rendering.\n resetHydrationState();\n queueHydrationError(recoverableError);\n workInProgress.flags |= ForceClientRender;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateHostComponent(current, workInProgress, renderLanes) {\n pushHostContext(workInProgress);\n\n if (current === null) {\n tryToClaimNextHydratableInstance(workInProgress);\n }\n\n var type = workInProgress.type;\n var nextProps = workInProgress.pendingProps;\n var prevProps = current !== null ? current.memoizedProps : null;\n var nextChildren = nextProps.children;\n var isDirectTextChild = shouldSetTextContent(type, nextProps);\n\n if (isDirectTextChild) {\n // We special case a direct text child of a host node. This is a common\n // case. We won't handle it as a reified child. We will instead handle\n // this in the host environment that also has access to this prop. That\n // avoids allocating another HostText fiber and traversing it.\n nextChildren = null;\n } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {\n // If we're switching from a direct text child to a normal child, or to\n // empty, we need to schedule the text content to be reset.\n workInProgress.flags |= ContentReset;\n }\n\n markRef(current, workInProgress);\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateHostText(current, workInProgress) {\n if (current === null) {\n tryToClaimNextHydratableInstance(workInProgress);\n } // Nothing to do here. This is terminal. We'll do the completion step\n // immediately after.\n\n\n return null;\n}\n\nfunction mountLazyComponent(_current, workInProgress, elementType, renderLanes) {\n resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);\n var props = workInProgress.pendingProps;\n var lazyComponent = elementType;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n var Component = init(payload); // Store the unwrapped component in the type.\n\n workInProgress.type = Component;\n var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);\n var resolvedProps = resolveDefaultProps(Component, props);\n var child;\n\n switch (resolvedTag) {\n case FunctionComponent:\n {\n {\n validateFunctionComponentInDev(workInProgress, Component);\n workInProgress.type = Component = resolveFunctionForHotReloading(Component);\n }\n\n child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes);\n return child;\n }\n\n case ClassComponent:\n {\n {\n workInProgress.type = Component = resolveClassForHotReloading(Component);\n }\n\n child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes);\n return child;\n }\n\n case ForwardRef:\n {\n {\n workInProgress.type = Component = resolveForwardRefForHotReloading(Component);\n }\n\n child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes);\n return child;\n }\n\n case MemoComponent:\n {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n var outerPropTypes = Component.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only\n 'prop', getComponentNameFromType(Component));\n }\n }\n }\n\n child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too\n renderLanes);\n return child;\n }\n }\n\n var hint = '';\n\n {\n if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {\n hint = ' Did you wrap a component in React.lazy() more than once?';\n }\n } // This message intentionally doesn't mention ForwardRef or MemoComponent\n // because the fact that it's a separate type of work is an\n // implementation detail.\n\n\n throw new Error(\"Element type is invalid. Received a promise that resolves to: \" + Component + \". \" + (\"Lazy element type must resolve to a class or function.\" + hint));\n}\n\nfunction mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) {\n resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); // Promote the fiber to a class and try rendering again.\n\n workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent`\n // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n var hasContext;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n prepareToReadContext(workInProgress, renderLanes);\n constructClassInstance(workInProgress, Component, nextProps);\n mountClassInstance(workInProgress, Component, nextProps, renderLanes);\n return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);\n}\n\nfunction mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) {\n resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);\n var props = workInProgress.pendingProps;\n var context;\n\n {\n var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);\n context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n prepareToReadContext(workInProgress, renderLanes);\n var value;\n var hasId;\n\n {\n markComponentRenderStarted(workInProgress);\n }\n\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var componentName = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[componentName]) {\n error(\"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);\n\n didWarnAboutBadClass[componentName] = true;\n }\n }\n\n if (workInProgress.mode & StrictLegacyMode) {\n ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);\n }\n\n setIsRendering(true);\n ReactCurrentOwner$1.current = workInProgress;\n value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);\n hasId = checkDidRenderIdHook();\n setIsRendering(false);\n }\n\n {\n markComponentRenderStopped();\n } // React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n\n {\n // Support for module components is deprecated and is removed behind a flag.\n // Whether or not it would crash later, we want to show a good message in DEV first.\n if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n var _componentName = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutModulePatternComponent[_componentName]) {\n error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \"If you can't use a class try assigning the prototype on the function as a workaround. \" + \"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it \" + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);\n\n didWarnAboutModulePatternComponent[_componentName] = true;\n }\n }\n }\n\n if ( // Run these checks in production only if the flag is off.\n // Eventually we'll delete this branch altogether.\n typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n {\n var _componentName2 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutModulePatternComponent[_componentName2]) {\n error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \"If you can't use a class try assigning the prototype on the function as a workaround. \" + \"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it \" + 'cannot be called with `new` by React.', _componentName2, _componentName2, _componentName2);\n\n didWarnAboutModulePatternComponent[_componentName2] = true;\n }\n } // Proceed under the assumption that this is a class instance\n\n\n workInProgress.tag = ClassComponent; // Throw out any hooks that were used.\n\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.\n // During mounting we don't know the child context yet as the instance doesn't exist.\n // We will invalidate the child context in finishClassComponent() right after rendering.\n\n var hasContext = false;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;\n initializeUpdateQueue(workInProgress);\n adoptClassInstance(workInProgress, value);\n mountClassInstance(workInProgress, Component, props, renderLanes);\n return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);\n } else {\n // Proceed under the assumption that this is a function component\n workInProgress.tag = FunctionComponent;\n\n {\n\n if ( workInProgress.mode & StrictLegacyMode) {\n setIsStrictModeForDevtools(true);\n\n try {\n value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);\n hasId = checkDidRenderIdHook();\n } finally {\n setIsStrictModeForDevtools(false);\n }\n }\n }\n\n if (getIsHydrating() && hasId) {\n pushMaterializedTreeId(workInProgress);\n }\n\n reconcileChildren(null, workInProgress, value, renderLanes);\n\n {\n validateFunctionComponentInDev(workInProgress, Component);\n }\n\n return workInProgress.child;\n }\n}\n\nfunction validateFunctionComponentInDev(workInProgress, Component) {\n {\n if (Component) {\n if (Component.childContextTypes) {\n error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');\n }\n }\n\n if (workInProgress.ref !== null) {\n var info = '';\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n var warningKey = ownerName || '';\n var debugSource = workInProgress._debugSource;\n\n if (debugSource) {\n warningKey = debugSource.fileName + ':' + debugSource.lineNumber;\n }\n\n if (!didWarnAboutFunctionRefs[warningKey]) {\n didWarnAboutFunctionRefs[warningKey] = true;\n\n error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);\n }\n }\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n var _componentName3 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {\n error('%s: Function components do not support getDerivedStateFromProps.', _componentName3);\n\n didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;\n }\n }\n\n if (typeof Component.contextType === 'object' && Component.contextType !== null) {\n var _componentName4 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {\n error('%s: Function components do not support contextType.', _componentName4);\n\n didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;\n }\n }\n }\n}\n\nvar SUSPENDED_MARKER = {\n dehydrated: null,\n treeContext: null,\n retryLane: NoLane\n};\n\nfunction mountSuspenseOffscreenState(renderLanes) {\n return {\n baseLanes: renderLanes,\n cachePool: getSuspendedCache(),\n transitions: null\n };\n}\n\nfunction updateSuspenseOffscreenState(prevOffscreenState, renderLanes) {\n var cachePool = null;\n\n return {\n baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes),\n cachePool: cachePool,\n transitions: prevOffscreenState.transitions\n };\n} // TODO: Probably should inline this back\n\n\nfunction shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) {\n // If we're already showing a fallback, there are cases where we need to\n // remain on that fallback regardless of whether the content has resolved.\n // For example, SuspenseList coordinates when nested content appears.\n if (current !== null) {\n var suspenseState = current.memoizedState;\n\n if (suspenseState === null) {\n // Currently showing content. Don't hide it, even if ForceSuspenseFallback\n // is true. More precise name might be \"ForceRemainSuspenseFallback\".\n // Note: This is a factoring smell. Can't remain on a fallback if there's\n // no fallback to remain on.\n return false;\n }\n } // Not currently showing content. Consult the Suspense context.\n\n\n return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n}\n\nfunction getRemainingWorkInPrimaryTree(current, renderLanes) {\n // TODO: Should not remove render lanes that were pinged during this render\n return removeLanes(current.childLanes, renderLanes);\n}\n\nfunction updateSuspenseComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.\n\n {\n if (shouldSuspend(workInProgress)) {\n workInProgress.flags |= DidCapture;\n }\n }\n\n var suspenseContext = suspenseStackCursor.current;\n var showFallback = false;\n var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags;\n\n if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {\n // Something in this boundary's subtree already suspended. Switch to\n // rendering the fallback children.\n showFallback = true;\n workInProgress.flags &= ~DidCapture;\n } else {\n // Attempting the main content\n if (current === null || current.memoizedState !== null) {\n // This is a new mount or this boundary is already showing a fallback state.\n // Mark this subtree context as having at least one invisible parent that could\n // handle the fallback state.\n // Avoided boundaries are not considered since they cannot handle preferred fallback states.\n {\n suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);\n }\n }\n }\n\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n pushSuspenseContext(workInProgress, suspenseContext); // OK, the next part is confusing. We're about to reconcile the Suspense\n // boundary's children. This involves some custom reconciliation logic. Two\n // main reasons this is so complicated.\n //\n // First, Legacy Mode has different semantics for backwards compatibility. The\n // primary tree will commit in an inconsistent state, so when we do the\n // second pass to render the fallback, we do some exceedingly, uh, clever\n // hacks to make that not totally break. Like transferring effects and\n // deletions from hidden tree. In Concurrent Mode, it's much simpler,\n // because we bailout on the primary tree completely and leave it in its old\n // state, no effects. Same as what we do for Offscreen (except that\n // Offscreen doesn't have the first render pass).\n //\n // Second is hydration. During hydration, the Suspense fiber has a slightly\n // different layout, where the child points to a dehydrated fragment, which\n // contains the DOM rendered by the server.\n //\n // Third, even if you set all that aside, Suspense is like error boundaries in\n // that we first we try to render one tree, and if that fails, we render again\n // and switch to a different tree. Like a try/catch block. So we have to track\n // which branch we're currently rendering. Ideally we would model this using\n // a stack.\n\n if (current === null) {\n // Initial mount\n // Special path for hydration\n // If we're currently hydrating, try to hydrate this boundary.\n tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.\n\n var suspenseState = workInProgress.memoizedState;\n\n if (suspenseState !== null) {\n var dehydrated = suspenseState.dehydrated;\n\n if (dehydrated !== null) {\n return mountDehydratedSuspenseComponent(workInProgress, dehydrated);\n }\n }\n\n var nextPrimaryChildren = nextProps.children;\n var nextFallbackChildren = nextProps.fallback;\n\n if (showFallback) {\n var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);\n var primaryChildFragment = workInProgress.child;\n primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);\n workInProgress.memoizedState = SUSPENDED_MARKER;\n\n return fallbackFragment;\n } else {\n return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren);\n }\n } else {\n // This is an update.\n // Special path for hydration\n var prevState = current.memoizedState;\n\n if (prevState !== null) {\n var _dehydrated = prevState.dehydrated;\n\n if (_dehydrated !== null) {\n return updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, _dehydrated, prevState, renderLanes);\n }\n }\n\n if (showFallback) {\n var _nextFallbackChildren = nextProps.fallback;\n var _nextPrimaryChildren = nextProps.children;\n var fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren, _nextFallbackChildren, renderLanes);\n var _primaryChildFragment2 = workInProgress.child;\n var prevOffscreenState = current.child.memoizedState;\n _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes);\n\n _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes);\n workInProgress.memoizedState = SUSPENDED_MARKER;\n return fallbackChildFragment;\n } else {\n var _nextPrimaryChildren2 = nextProps.children;\n\n var _primaryChildFragment3 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren2, renderLanes);\n\n workInProgress.memoizedState = null;\n return _primaryChildFragment3;\n }\n }\n}\n\nfunction mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) {\n var mode = workInProgress.mode;\n var primaryChildProps = {\n mode: 'visible',\n children: primaryChildren\n };\n var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);\n primaryChildFragment.return = workInProgress;\n workInProgress.child = primaryChildFragment;\n return primaryChildFragment;\n}\n\nfunction mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) {\n var mode = workInProgress.mode;\n var progressedPrimaryFragment = workInProgress.child;\n var primaryChildProps = {\n mode: 'hidden',\n children: primaryChildren\n };\n var primaryChildFragment;\n var fallbackChildFragment;\n\n if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) {\n // In legacy mode, we commit the primary tree as if it successfully\n // completed, even though it's in an inconsistent state.\n primaryChildFragment = progressedPrimaryFragment;\n primaryChildFragment.childLanes = NoLanes;\n primaryChildFragment.pendingProps = primaryChildProps;\n\n if ( workInProgress.mode & ProfileMode) {\n // Reset the durations from the first pass so they aren't included in the\n // final amounts. This seems counterintuitive, since we're intentionally\n // not measuring part of the render phase, but this makes it match what we\n // do in Concurrent Mode.\n primaryChildFragment.actualDuration = 0;\n primaryChildFragment.actualStartTime = -1;\n primaryChildFragment.selfBaseDuration = 0;\n primaryChildFragment.treeBaseDuration = 0;\n }\n\n fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);\n } else {\n primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);\n fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);\n }\n\n primaryChildFragment.return = workInProgress;\n fallbackChildFragment.return = workInProgress;\n primaryChildFragment.sibling = fallbackChildFragment;\n workInProgress.child = primaryChildFragment;\n return fallbackChildFragment;\n}\n\nfunction mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes) {\n // The props argument to `createFiberFromOffscreen` is `any` typed, so we use\n // this wrapper function to constrain it.\n return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null);\n}\n\nfunction updateWorkInProgressOffscreenFiber(current, offscreenProps) {\n // The props argument to `createWorkInProgress` is `any` typed, so we use this\n // wrapper function to constrain it.\n return createWorkInProgress(current, offscreenProps);\n}\n\nfunction updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) {\n var currentPrimaryChildFragment = current.child;\n var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {\n mode: 'visible',\n children: primaryChildren\n });\n\n if ((workInProgress.mode & ConcurrentMode) === NoMode) {\n primaryChildFragment.lanes = renderLanes;\n }\n\n primaryChildFragment.return = workInProgress;\n primaryChildFragment.sibling = null;\n\n if (currentFallbackChildFragment !== null) {\n // Delete the fallback child fragment\n var deletions = workInProgress.deletions;\n\n if (deletions === null) {\n workInProgress.deletions = [currentFallbackChildFragment];\n workInProgress.flags |= ChildDeletion;\n } else {\n deletions.push(currentFallbackChildFragment);\n }\n }\n\n workInProgress.child = primaryChildFragment;\n return primaryChildFragment;\n}\n\nfunction updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) {\n var mode = workInProgress.mode;\n var currentPrimaryChildFragment = current.child;\n var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n var primaryChildProps = {\n mode: 'hidden',\n children: primaryChildren\n };\n var primaryChildFragment;\n\n if ( // In legacy mode, we commit the primary tree as if it successfully\n // completed, even though it's in an inconsistent state.\n (mode & ConcurrentMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was\n // already cloned. In legacy mode, the only case where this isn't true is\n // when DevTools forces us to display a fallback; we skip the first render\n // pass entirely and go straight to rendering the fallback. (In Concurrent\n // Mode, SuspenseList can also trigger this scenario, but this is a legacy-\n // only codepath.)\n workInProgress.child !== currentPrimaryChildFragment) {\n var progressedPrimaryFragment = workInProgress.child;\n primaryChildFragment = progressedPrimaryFragment;\n primaryChildFragment.childLanes = NoLanes;\n primaryChildFragment.pendingProps = primaryChildProps;\n\n if ( workInProgress.mode & ProfileMode) {\n // Reset the durations from the first pass so they aren't included in the\n // final amounts. This seems counterintuitive, since we're intentionally\n // not measuring part of the render phase, but this makes it match what we\n // do in Concurrent Mode.\n primaryChildFragment.actualDuration = 0;\n primaryChildFragment.actualStartTime = -1;\n primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;\n primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;\n } // The fallback fiber was added as a deletion during the first pass.\n // However, since we're going to remain on the fallback, we no longer want\n // to delete it.\n\n\n workInProgress.deletions = null;\n } else {\n primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps); // Since we're reusing a current tree, we need to reuse the flags, too.\n // (We don't do this in legacy mode, because in legacy mode we don't re-use\n // the current tree; see previous branch.)\n\n primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask;\n }\n\n var fallbackChildFragment;\n\n if (currentFallbackChildFragment !== null) {\n fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);\n } else {\n fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already\n // mounted but this is a new fiber.\n\n fallbackChildFragment.flags |= Placement;\n }\n\n fallbackChildFragment.return = workInProgress;\n primaryChildFragment.return = workInProgress;\n primaryChildFragment.sibling = fallbackChildFragment;\n workInProgress.child = primaryChildFragment;\n return fallbackChildFragment;\n}\n\nfunction retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, recoverableError) {\n // Falling back to client rendering. Because this has performance\n // implications, it's considered a recoverable error, even though the user\n // likely won't observe anything wrong with the UI.\n //\n // The error is passed in as an argument to enforce that every caller provide\n // a custom message, or explicitly opt out (currently the only path that opts\n // out is legacy mode; every concurrent path provides an error).\n if (recoverableError !== null) {\n queueHydrationError(recoverableError);\n } // This will add the old fiber to the deletion list\n\n\n reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated.\n\n var nextProps = workInProgress.pendingProps;\n var primaryChildren = nextProps.children;\n var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Needs a placement effect because the parent (the Suspense boundary) already\n // mounted but this is a new fiber.\n\n primaryChildFragment.flags |= Placement;\n workInProgress.memoizedState = null;\n return primaryChildFragment;\n}\n\nfunction mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) {\n var fiberMode = workInProgress.mode;\n var primaryChildProps = {\n mode: 'visible',\n children: primaryChildren\n };\n var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode);\n var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes, null); // Needs a placement effect because the parent (the Suspense\n // boundary) already mounted but this is a new fiber.\n\n fallbackChildFragment.flags |= Placement;\n primaryChildFragment.return = workInProgress;\n fallbackChildFragment.return = workInProgress;\n primaryChildFragment.sibling = fallbackChildFragment;\n workInProgress.child = primaryChildFragment;\n\n if ((workInProgress.mode & ConcurrentMode) !== NoMode) {\n // We will have dropped the effect list which contains the\n // deletion. We need to reconcile to delete the current child.\n reconcileChildFibers(workInProgress, current.child, null, renderLanes);\n }\n\n return fallbackChildFragment;\n}\n\nfunction mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderLanes) {\n // During the first pass, we'll bail out and not drill into the children.\n // Instead, we'll leave the content in place and try to hydrate it later.\n if ((workInProgress.mode & ConcurrentMode) === NoMode) {\n {\n error('Cannot hydrate Suspense in legacy mode. Switch from ' + 'ReactDOM.hydrate(element, container) to ' + 'ReactDOMClient.hydrateRoot(container, <App />)' + '.render(element) or remove the Suspense components from ' + 'the server rendered components.');\n }\n\n workInProgress.lanes = laneToLanes(SyncLane);\n } else if (isSuspenseInstanceFallback(suspenseInstance)) {\n // This is a client-only boundary. Since we won't get any content from the server\n // for this, we need to schedule that at a higher priority based on when it would\n // have timed out. In theory we could render it in this pass but it would have the\n // wrong priority associated with it and will prevent hydration of parent path.\n // Instead, we'll leave work left on it to render it in a separate commit.\n // TODO This time should be the time at which the server rendered response that is\n // a parent to this boundary was displayed. However, since we currently don't have\n // a protocol to transfer that time, we'll just estimate it by using the current\n // time. This will mean that Suspense timeouts are slightly shifted to later than\n // they should be.\n // Schedule a normal pri update to render this content.\n workInProgress.lanes = laneToLanes(DefaultHydrationLane);\n } else {\n // We'll continue hydrating the rest at offscreen priority since we'll already\n // be showing the right content coming from the server, it is no rush.\n workInProgress.lanes = laneToLanes(OffscreenLane);\n }\n\n return null;\n}\n\nfunction updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes) {\n if (!didSuspend) {\n // This is the first render pass. Attempt to hydrate.\n // We should never be hydrating at this point because it is the first pass,\n // but after we've already committed once.\n warnIfHydrating();\n\n if ((workInProgress.mode & ConcurrentMode) === NoMode) {\n return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, // TODO: When we delete legacy mode, we should make this error argument\n // required — every concurrent mode path that causes hydration to\n // de-opt to client rendering should have an error message.\n null);\n }\n\n if (isSuspenseInstanceFallback(suspenseInstance)) {\n // This boundary is in a permanent fallback state. In this case, we'll never\n // get an update and we'll never be able to hydrate the final content. Let's just try the\n // client side render instead.\n var digest, message, stack;\n\n {\n var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance);\n\n digest = _getSuspenseInstanceF.digest;\n message = _getSuspenseInstanceF.message;\n stack = _getSuspenseInstanceF.stack;\n }\n\n var error;\n\n if (message) {\n // eslint-disable-next-line react-internal/prod-error-codes\n error = new Error(message);\n } else {\n error = new Error('The server could not finish this Suspense boundary, likely ' + 'due to an error during server rendering. Switched to ' + 'client rendering.');\n }\n\n var capturedValue = createCapturedValue(error, digest, stack);\n return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, capturedValue);\n }\n // any context has changed, we need to treat is as if the input might have changed.\n\n\n var hasContextChanged = includesSomeLane(renderLanes, current.childLanes);\n\n if (didReceiveUpdate || hasContextChanged) {\n // This boundary has changed since the first render. This means that we are now unable to\n // hydrate it. We might still be able to hydrate it using a higher priority lane.\n var root = getWorkInProgressRoot();\n\n if (root !== null) {\n var attemptHydrationAtLane = getBumpedLaneForHydration(root, renderLanes);\n\n if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) {\n // Intentionally mutating since this render will get interrupted. This\n // is one of the very rare times where we mutate the current tree\n // during the render phase.\n suspenseState.retryLane = attemptHydrationAtLane; // TODO: Ideally this would inherit the event time of the current render\n\n var eventTime = NoTimestamp;\n enqueueConcurrentRenderForLane(current, attemptHydrationAtLane);\n scheduleUpdateOnFiber(root, current, attemptHydrationAtLane, eventTime);\n }\n } // If we have scheduled higher pri work above, this will probably just abort the render\n // since we now have higher priority work, but in case it doesn't, we need to prepare to\n // render something, if we time out. Even if that requires us to delete everything and\n // skip hydration.\n // Delay having to do this as long as the suspense timeout allows us.\n\n\n renderDidSuspendDelayIfPossible();\n\n var _capturedValue = createCapturedValue(new Error('This Suspense boundary received an update before it finished ' + 'hydrating. This caused the boundary to switch to client rendering. ' + 'The usual way to fix this is to wrap the original update ' + 'in startTransition.'));\n\n return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue);\n } else if (isSuspenseInstancePending(suspenseInstance)) {\n // This component is still pending more data from the server, so we can't hydrate its\n // content. We treat it as if this component suspended itself. It might seem as if\n // we could just try to render it client-side instead. However, this will perform a\n // lot of unnecessary work and is unlikely to complete since it often will suspend\n // on missing data anyway. Additionally, the server might be able to render more\n // than we can on the client yet. In that case we'd end up with more fallback states\n // on the client than if we just leave it alone. If the server times out or errors\n // these should update this boundary to the permanent Fallback state instead.\n // Mark it as having captured (i.e. suspended).\n workInProgress.flags |= DidCapture; // Leave the child in place. I.e. the dehydrated fragment.\n\n workInProgress.child = current.child; // Register a callback to retry this boundary once the server has sent the result.\n\n var retry = retryDehydratedSuspenseBoundary.bind(null, current);\n registerSuspenseInstanceRetry(suspenseInstance, retry);\n return null;\n } else {\n // This is the first attempt.\n reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress, suspenseInstance, suspenseState.treeContext);\n var primaryChildren = nextProps.children;\n var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Mark the children as hydrating. This is a fast path to know whether this\n // tree is part of a hydrating tree. This is used to determine if a child\n // node has fully mounted yet, and for scheduling event replaying.\n // Conceptually this is similar to Placement in that a new subtree is\n // inserted into the React tree here. It just happens to not need DOM\n // mutations because it already exists.\n\n primaryChildFragment.flags |= Hydrating;\n return primaryChildFragment;\n }\n } else {\n // This is the second render pass. We already attempted to hydrated, but\n // something either suspended or errored.\n if (workInProgress.flags & ForceClientRender) {\n // Something errored during hydration. Try again without hydrating.\n workInProgress.flags &= ~ForceClientRender;\n\n var _capturedValue2 = createCapturedValue(new Error('There was an error while hydrating this Suspense boundary. ' + 'Switched to client rendering.'));\n\n return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue2);\n } else if (workInProgress.memoizedState !== null) {\n // Something suspended and we should still be in dehydrated mode.\n // Leave the existing child in place.\n workInProgress.child = current.child; // The dehydrated completion pass expects this flag to be there\n // but the normal suspense pass doesn't.\n\n workInProgress.flags |= DidCapture;\n return null;\n } else {\n // Suspended but we should no longer be in dehydrated mode.\n // Therefore we now have to render the fallback.\n var nextPrimaryChildren = nextProps.children;\n var nextFallbackChildren = nextProps.fallback;\n var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);\n var _primaryChildFragment4 = workInProgress.child;\n _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes);\n workInProgress.memoizedState = SUSPENDED_MARKER;\n return fallbackChildFragment;\n }\n }\n}\n\nfunction scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {\n fiber.lanes = mergeLanes(fiber.lanes, renderLanes);\n var alternate = fiber.alternate;\n\n if (alternate !== null) {\n alternate.lanes = mergeLanes(alternate.lanes, renderLanes);\n }\n\n scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);\n}\n\nfunction propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) {\n // Mark any Suspense boundaries with fallbacks as having work to do.\n // If they were previously forced into fallbacks, they may now be able\n // to unblock.\n var node = firstChild;\n\n while (node !== null) {\n if (node.tag === SuspenseComponent) {\n var state = node.memoizedState;\n\n if (state !== null) {\n scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress);\n }\n } else if (node.tag === SuspenseListComponent) {\n // If the tail is hidden there might not be an Suspense boundaries\n // to schedule work on. In this case we have to schedule it on the\n // list itself.\n // We don't have to traverse to the children of the list since\n // the list will propagate the change when it rerenders.\n scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress);\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === workInProgress) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === workInProgress) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction findLastContentRow(firstChild) {\n // This is going to find the last row among these children that is already\n // showing content on the screen, as opposed to being in fallback state or\n // new. If a row has multiple Suspense boundaries, any of them being in the\n // fallback state, counts as the whole row being in a fallback state.\n // Note that the \"rows\" will be workInProgress, but any nested children\n // will still be current since we haven't rendered them yet. The mounted\n // order may not be the same as the new order. We use the new order.\n var row = firstChild;\n var lastContentRow = null;\n\n while (row !== null) {\n var currentRow = row.alternate; // New rows can't be content rows.\n\n if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n lastContentRow = row;\n }\n\n row = row.sibling;\n }\n\n return lastContentRow;\n}\n\nfunction validateRevealOrder(revealOrder) {\n {\n if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {\n didWarnAboutRevealOrder[revealOrder] = true;\n\n if (typeof revealOrder === 'string') {\n switch (revealOrder.toLowerCase()) {\n case 'together':\n case 'forwards':\n case 'backwards':\n {\n error('\"%s\" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase \"%s\" instead.', revealOrder, revealOrder.toLowerCase());\n\n break;\n }\n\n case 'forward':\n case 'backward':\n {\n error('\"%s\" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use \"%ss\" instead.', revealOrder, revealOrder.toLowerCase());\n\n break;\n }\n\n default:\n error('\"%s\" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean \"together\", \"forwards\" or \"backwards\"?', revealOrder);\n\n break;\n }\n } else {\n error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean \"together\", \"forwards\" or \"backwards\"?', revealOrder);\n }\n }\n }\n}\n\nfunction validateTailOptions(tailMode, revealOrder) {\n {\n if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {\n if (tailMode !== 'collapsed' && tailMode !== 'hidden') {\n didWarnAboutTailOptions[tailMode] = true;\n\n error('\"%s\" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean \"collapsed\" or \"hidden\"?', tailMode);\n } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {\n didWarnAboutTailOptions[tailMode] = true;\n\n error('<SuspenseList tail=\"%s\" /> is only valid if revealOrder is ' + '\"forwards\" or \"backwards\". ' + 'Did you mean to specify revealOrder=\"forwards\"?', tailMode);\n }\n }\n }\n}\n\nfunction validateSuspenseListNestedChild(childSlot, index) {\n {\n var isAnArray = isArray(childSlot);\n var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === 'function';\n\n if (isAnArray || isIterable) {\n var type = isAnArray ? 'array' : 'iterable';\n\n error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);\n\n return false;\n }\n }\n\n return true;\n}\n\nfunction validateSuspenseListChildren(children, revealOrder) {\n {\n if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n if (!validateSuspenseListNestedChild(children[i], i)) {\n return;\n }\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var childrenIterator = iteratorFn.call(children);\n\n if (childrenIterator) {\n var step = childrenIterator.next();\n var _i = 0;\n\n for (; !step.done; step = childrenIterator.next()) {\n if (!validateSuspenseListNestedChild(step.value, _i)) {\n return;\n }\n\n _i++;\n }\n }\n } else {\n error('A single row was passed to a <SuspenseList revealOrder=\"%s\" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);\n }\n }\n }\n }\n}\n\nfunction initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) {\n var renderState = workInProgress.memoizedState;\n\n if (renderState === null) {\n workInProgress.memoizedState = {\n isBackwards: isBackwards,\n rendering: null,\n renderingStartTime: 0,\n last: lastContentRow,\n tail: tail,\n tailMode: tailMode\n };\n } else {\n // We can reuse the existing object from previous renders.\n renderState.isBackwards = isBackwards;\n renderState.rendering = null;\n renderState.renderingStartTime = 0;\n renderState.last = lastContentRow;\n renderState.tail = tail;\n renderState.tailMode = tailMode;\n }\n} // This can end up rendering this component multiple passes.\n// The first pass splits the children fibers into two sets. A head and tail.\n// We first render the head. If anything is in fallback state, we do another\n// pass through beginWork to rerender all children (including the tail) with\n// the force suspend context. If the first render didn't have anything in\n// in fallback state. Then we render each row in the tail one-by-one.\n// That happens in the completeWork phase without going back to beginWork.\n\n\nfunction updateSuspenseListComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps;\n var revealOrder = nextProps.revealOrder;\n var tailMode = nextProps.tail;\n var newChildren = nextProps.children;\n validateRevealOrder(revealOrder);\n validateTailOptions(tailMode, revealOrder);\n validateSuspenseListChildren(newChildren, revealOrder);\n reconcileChildren(current, workInProgress, newChildren, renderLanes);\n var suspenseContext = suspenseStackCursor.current;\n var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n\n if (shouldForceFallback) {\n suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n workInProgress.flags |= DidCapture;\n } else {\n var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags;\n\n if (didSuspendBefore) {\n // If we previously forced a fallback, we need to schedule work\n // on any nested boundaries to let them know to try to render\n // again. This is the same as context updating.\n propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes);\n }\n\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n }\n\n pushSuspenseContext(workInProgress, suspenseContext);\n\n if ((workInProgress.mode & ConcurrentMode) === NoMode) {\n // In legacy mode, SuspenseList doesn't work so we just\n // use make it a noop by treating it as the default revealOrder.\n workInProgress.memoizedState = null;\n } else {\n switch (revealOrder) {\n case 'forwards':\n {\n var lastContentRow = findLastContentRow(workInProgress.child);\n var tail;\n\n if (lastContentRow === null) {\n // The whole list is part of the tail.\n // TODO: We could fast path by just rendering the tail now.\n tail = workInProgress.child;\n workInProgress.child = null;\n } else {\n // Disconnect the tail rows after the content row.\n // We're going to render them separately later.\n tail = lastContentRow.sibling;\n lastContentRow.sibling = null;\n }\n\n initSuspenseListRenderState(workInProgress, false, // isBackwards\n tail, lastContentRow, tailMode);\n break;\n }\n\n case 'backwards':\n {\n // We're going to find the first row that has existing content.\n // At the same time we're going to reverse the list of everything\n // we pass in the meantime. That's going to be our tail in reverse\n // order.\n var _tail = null;\n var row = workInProgress.child;\n workInProgress.child = null;\n\n while (row !== null) {\n var currentRow = row.alternate; // New rows can't be content rows.\n\n if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n // This is the beginning of the main content.\n workInProgress.child = row;\n break;\n }\n\n var nextRow = row.sibling;\n row.sibling = _tail;\n _tail = row;\n row = nextRow;\n } // TODO: If workInProgress.child is null, we can continue on the tail immediately.\n\n\n initSuspenseListRenderState(workInProgress, true, // isBackwards\n _tail, null, // last\n tailMode);\n break;\n }\n\n case 'together':\n {\n initSuspenseListRenderState(workInProgress, false, // isBackwards\n null, // tail\n null, // last\n undefined);\n break;\n }\n\n default:\n {\n // The default reveal order is the same as not having\n // a boundary.\n workInProgress.memoizedState = null;\n }\n }\n }\n\n return workInProgress.child;\n}\n\nfunction updatePortalComponent(current, workInProgress, renderLanes) {\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n var nextChildren = workInProgress.pendingProps;\n\n if (current === null) {\n // Portals are special because we don't append the children during mount\n // but at commit. Therefore we need to track insertions which the normal\n // flow doesn't do during mount. This doesn't happen at the root because\n // the root always starts with a \"current\" with a null child.\n // TODO: Consider unifying this with how the root works.\n workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);\n } else {\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n }\n\n return workInProgress.child;\n}\n\nvar hasWarnedAboutUsingNoValuePropOnContextProvider = false;\n\nfunction updateContextProvider(current, workInProgress, renderLanes) {\n var providerType = workInProgress.type;\n var context = providerType._context;\n var newProps = workInProgress.pendingProps;\n var oldProps = workInProgress.memoizedProps;\n var newValue = newProps.value;\n\n {\n if (!('value' in newProps)) {\n if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {\n hasWarnedAboutUsingNoValuePropOnContextProvider = true;\n\n error('The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?');\n }\n }\n\n var providerPropTypes = workInProgress.type.propTypes;\n\n if (providerPropTypes) {\n checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider');\n }\n }\n\n pushProvider(workInProgress, context, newValue);\n\n {\n if (oldProps !== null) {\n var oldValue = oldProps.value;\n\n if (objectIs(oldValue, newValue)) {\n // No change. Bailout early if children are the same.\n if (oldProps.children === newProps.children && !hasContextChanged()) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n } else {\n // The context value changed. Search for matching consumers and schedule\n // them to update.\n propagateContextChange(workInProgress, context, renderLanes);\n }\n }\n }\n\n var newChildren = newProps.children;\n reconcileChildren(current, workInProgress, newChildren, renderLanes);\n return workInProgress.child;\n}\n\nvar hasWarnedAboutUsingContextAsConsumer = false;\n\nfunction updateContextConsumer(current, workInProgress, renderLanes) {\n var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In\n // DEV mode, we create a separate object for Context.Consumer that acts\n // like a proxy to Context. This proxy object adds unnecessary code in PROD\n // so we use the old behaviour (Context.Consumer references Context) to\n // reduce size and overhead. The separate object references context via\n // a property called \"_context\", which also gives us the ability to check\n // in DEV mode if this property exists or not and warn if it does not.\n\n {\n if (context._context === undefined) {\n // This may be because it's a Context (rather than a Consumer).\n // Or it may be because it's older React where they're the same thing.\n // We only want to warn if we're sure it's a new React.\n if (context !== context.Consumer) {\n if (!hasWarnedAboutUsingContextAsConsumer) {\n hasWarnedAboutUsingContextAsConsumer = true;\n\n error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n }\n } else {\n context = context._context;\n }\n }\n\n var newProps = workInProgress.pendingProps;\n var render = newProps.children;\n\n {\n if (typeof render !== 'function') {\n error('A context consumer was rendered with multiple children, or a child ' + \"that isn't a function. A context consumer expects a single child \" + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');\n }\n }\n\n prepareToReadContext(workInProgress, renderLanes);\n var newValue = readContext(context);\n\n {\n markComponentRenderStarted(workInProgress);\n }\n\n var newChildren;\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n newChildren = render(newValue);\n setIsRendering(false);\n }\n\n {\n markComponentRenderStopped();\n } // React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n reconcileChildren(current, workInProgress, newChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction markWorkInProgressReceivedUpdate() {\n didReceiveUpdate = true;\n}\n\nfunction resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) {\n if ((workInProgress.mode & ConcurrentMode) === NoMode) {\n if (current !== null) {\n // A lazy component only mounts if it suspended inside a non-\n // concurrent tree, in an inconsistent state. We want to treat it like\n // a new mount, even though an empty version of it already committed.\n // Disconnect the alternate pointers.\n current.alternate = null;\n workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.flags |= Placement;\n }\n }\n}\n\nfunction bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {\n if (current !== null) {\n // Reuse previous dependencies\n workInProgress.dependencies = current.dependencies;\n }\n\n {\n // Don't update \"base\" render times for bailouts.\n stopProfilerTimerIfRunning();\n }\n\n markSkippedUpdateLanes(workInProgress.lanes); // Check if the children have any pending work.\n\n if (!includesSomeLane(renderLanes, workInProgress.childLanes)) {\n // The children don't have any work either. We can skip them.\n // TODO: Once we add back resuming, we should check if the children are\n // a work-in-progress set. If so, we need to transfer their effects.\n {\n return null;\n }\n } // This fiber doesn't have work, but its subtree does. Clone the child\n // fibers and continue.\n\n\n cloneChildFibers(current, workInProgress);\n return workInProgress.child;\n}\n\nfunction remountFiber(current, oldWorkInProgress, newWorkInProgress) {\n {\n var returnFiber = oldWorkInProgress.return;\n\n if (returnFiber === null) {\n // eslint-disable-next-line react-internal/prod-error-codes\n throw new Error('Cannot swap the root fiber.');\n } // Disconnect from the old current.\n // It will get deleted.\n\n\n current.alternate = null;\n oldWorkInProgress.alternate = null; // Connect to the new tree.\n\n newWorkInProgress.index = oldWorkInProgress.index;\n newWorkInProgress.sibling = oldWorkInProgress.sibling;\n newWorkInProgress.return = oldWorkInProgress.return;\n newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.\n\n if (oldWorkInProgress === returnFiber.child) {\n returnFiber.child = newWorkInProgress;\n } else {\n var prevSibling = returnFiber.child;\n\n if (prevSibling === null) {\n // eslint-disable-next-line react-internal/prod-error-codes\n throw new Error('Expected parent to have a child.');\n }\n\n while (prevSibling.sibling !== oldWorkInProgress) {\n prevSibling = prevSibling.sibling;\n\n if (prevSibling === null) {\n // eslint-disable-next-line react-internal/prod-error-codes\n throw new Error('Expected to find the previous sibling.');\n }\n }\n\n prevSibling.sibling = newWorkInProgress;\n } // Delete the old fiber and place the new one.\n // Since the old fiber is disconnected, we have to schedule it manually.\n\n\n var deletions = returnFiber.deletions;\n\n if (deletions === null) {\n returnFiber.deletions = [current];\n returnFiber.flags |= ChildDeletion;\n } else {\n deletions.push(current);\n }\n\n newWorkInProgress.flags |= Placement; // Restart work from the new fiber.\n\n return newWorkInProgress;\n }\n}\n\nfunction checkScheduledUpdateOrContext(current, renderLanes) {\n // Before performing an early bailout, we must check if there are pending\n // updates or context.\n var updateLanes = current.lanes;\n\n if (includesSomeLane(updateLanes, renderLanes)) {\n return true;\n } // No pending update, but because context is propagated lazily, we need\n\n return false;\n}\n\nfunction attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes) {\n // This fiber does not have any pending work. Bailout without entering\n // the begin phase. There's still some bookkeeping we that needs to be done\n // in this optimized path, mostly pushing stuff onto the stack.\n switch (workInProgress.tag) {\n case HostRoot:\n pushHostRootContext(workInProgress);\n var root = workInProgress.stateNode;\n\n resetHydrationState();\n break;\n\n case HostComponent:\n pushHostContext(workInProgress);\n break;\n\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n pushContextProvider(workInProgress);\n }\n\n break;\n }\n\n case HostPortal:\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n break;\n\n case ContextProvider:\n {\n var newValue = workInProgress.memoizedProps.value;\n var context = workInProgress.type._context;\n pushProvider(workInProgress, context, newValue);\n break;\n }\n\n case Profiler:\n {\n // Profiler should only call onRender when one of its descendants actually rendered.\n var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);\n\n if (hasChildWork) {\n workInProgress.flags |= Update;\n }\n\n {\n // Reset effect durations for the next eventual effect phase.\n // These are reset during render to allow the DevTools commit hook a chance to read them,\n var stateNode = workInProgress.stateNode;\n stateNode.effectDuration = 0;\n stateNode.passiveEffectDuration = 0;\n }\n }\n\n break;\n\n case SuspenseComponent:\n {\n var state = workInProgress.memoizedState;\n\n if (state !== null) {\n if (state.dehydrated !== null) {\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // We know that this component will suspend again because if it has\n // been unsuspended it has committed as a resolved Suspense component.\n // If it needs to be retried, it should have work scheduled on it.\n\n workInProgress.flags |= DidCapture; // We should never render the children of a dehydrated boundary until we\n // upgrade it. We return null instead of bailoutOnAlreadyFinishedWork.\n\n return null;\n } // If this boundary is currently timed out, we need to decide\n // whether to retry the primary children, or to skip over it and\n // go straight to the fallback. Check the priority of the primary\n // child fragment.\n\n\n var primaryChildFragment = workInProgress.child;\n var primaryChildLanes = primaryChildFragment.childLanes;\n\n if (includesSomeLane(renderLanes, primaryChildLanes)) {\n // The primary children have pending work. Use the normal path\n // to attempt to render the primary children again.\n return updateSuspenseComponent(current, workInProgress, renderLanes);\n } else {\n // The primary child fragment does not have pending work marked\n // on it\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient\n // priority. Bailout.\n\n var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n\n if (child !== null) {\n // The fallback children have pending work. Skip over the\n // primary children and work on the fallback.\n return child.sibling;\n } else {\n // Note: We can return `null` here because we already checked\n // whether there were nested context consumers, via the call to\n // `bailoutOnAlreadyFinishedWork` above.\n return null;\n }\n }\n } else {\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));\n }\n\n break;\n }\n\n case SuspenseListComponent:\n {\n var didSuspendBefore = (current.flags & DidCapture) !== NoFlags;\n\n var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);\n\n if (didSuspendBefore) {\n if (_hasChildWork) {\n // If something was in fallback state last time, and we have all the\n // same children then we're still in progressive loading state.\n // Something might get unblocked by state updates or retries in the\n // tree which will affect the tail. So we need to use the normal\n // path to compute the correct tail.\n return updateSuspenseListComponent(current, workInProgress, renderLanes);\n } // If none of the children had any work, that means that none of\n // them got retried so they'll still be blocked in the same way\n // as before. We can fast bail out.\n\n\n workInProgress.flags |= DidCapture;\n } // If nothing suspended before and we're rendering the same children,\n // then the tail doesn't matter. Anything new that suspends will work\n // in the \"together\" mode, so we can continue from the state we had.\n\n\n var renderState = workInProgress.memoizedState;\n\n if (renderState !== null) {\n // Reset to the \"together\" mode in case we've started a different\n // update in the past but didn't complete it.\n renderState.rendering = null;\n renderState.tail = null;\n renderState.lastEffect = null;\n }\n\n pushSuspenseContext(workInProgress, suspenseStackCursor.current);\n\n if (_hasChildWork) {\n break;\n } else {\n // If none of the children had any work, that means that none of\n // them got retried so they'll still be blocked in the same way\n // as before. We can fast bail out.\n return null;\n }\n }\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n {\n // Need to check if the tree still needs to be deferred. This is\n // almost identical to the logic used in the normal update path,\n // so we'll just enter that. The only difference is we'll bail out\n // at the next level instead of this one, because the child props\n // have not changed. Which is fine.\n // TODO: Probably should refactor `beginWork` to split the bailout\n // path from the normal path. I'm tempted to do a labeled break here\n // but I won't :)\n workInProgress.lanes = NoLanes;\n return updateOffscreenComponent(current, workInProgress, renderLanes);\n }\n }\n\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n}\n\nfunction beginWork(current, workInProgress, renderLanes) {\n {\n if (workInProgress._debugNeedsRemount && current !== null) {\n // This will restart the begin phase with a new fiber.\n return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes));\n }\n }\n\n if (current !== null) {\n var oldProps = current.memoizedProps;\n var newProps = workInProgress.pendingProps;\n\n if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:\n workInProgress.type !== current.type )) {\n // If props or context changed, mark the fiber as having performed work.\n // This may be unset if the props are determined to be equal later (memo).\n didReceiveUpdate = true;\n } else {\n // Neither props nor legacy context changes. Check if there's a pending\n // update or context change.\n var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes);\n\n if (!hasScheduledUpdateOrContext && // If this is the second pass of an error or suspense boundary, there\n // may not be work scheduled on `current`, so we check for this flag.\n (workInProgress.flags & DidCapture) === NoFlags) {\n // No pending updates or context. Bail out now.\n didReceiveUpdate = false;\n return attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes);\n }\n\n if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {\n // This is a special case that only exists for legacy mode.\n // See https://github.com/facebook/react/pull/19216.\n didReceiveUpdate = true;\n } else {\n // An update was scheduled on this fiber, but there are no new props\n // nor legacy context. Set this to false. If an update queue or context\n // consumer produces a changed value, it will set this to true. Otherwise,\n // the component will assume the children have not changed and bail out.\n didReceiveUpdate = false;\n }\n }\n } else {\n didReceiveUpdate = false;\n\n if (getIsHydrating() && isForkedChild(workInProgress)) {\n // Check if this child belongs to a list of muliple children in\n // its parent.\n //\n // In a true multi-threaded implementation, we would render children on\n // parallel threads. This would represent the beginning of a new render\n // thread for this subtree.\n //\n // We only use this for id generation during hydration, which is why the\n // logic is located in this special branch.\n var slotIndex = workInProgress.index;\n var numberOfForks = getForksAtLevel();\n pushTreeId(workInProgress, numberOfForks, slotIndex);\n }\n } // Before entering the begin phase, clear pending update priority.\n // TODO: This assumes that we're about to evaluate the component and process\n // the update queue. However, there's an exception: SimpleMemoComponent\n // sometimes bails out later in the begin phase. This indicates that we should\n // move this assignment out of the common path and into each branch.\n\n\n workInProgress.lanes = NoLanes;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n {\n return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes);\n }\n\n case LazyComponent:\n {\n var elementType = workInProgress.elementType;\n return mountLazyComponent(current, workInProgress, elementType, renderLanes);\n }\n\n case FunctionComponent:\n {\n var Component = workInProgress.type;\n var unresolvedProps = workInProgress.pendingProps;\n var resolvedProps = workInProgress.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps);\n return updateFunctionComponent(current, workInProgress, Component, resolvedProps, renderLanes);\n }\n\n case ClassComponent:\n {\n var _Component = workInProgress.type;\n var _unresolvedProps = workInProgress.pendingProps;\n\n var _resolvedProps = workInProgress.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps);\n\n return updateClassComponent(current, workInProgress, _Component, _resolvedProps, renderLanes);\n }\n\n case HostRoot:\n return updateHostRoot(current, workInProgress, renderLanes);\n\n case HostComponent:\n return updateHostComponent(current, workInProgress, renderLanes);\n\n case HostText:\n return updateHostText(current, workInProgress);\n\n case SuspenseComponent:\n return updateSuspenseComponent(current, workInProgress, renderLanes);\n\n case HostPortal:\n return updatePortalComponent(current, workInProgress, renderLanes);\n\n case ForwardRef:\n {\n var type = workInProgress.type;\n var _unresolvedProps2 = workInProgress.pendingProps;\n\n var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);\n\n return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes);\n }\n\n case Fragment:\n return updateFragment(current, workInProgress, renderLanes);\n\n case Mode:\n return updateMode(current, workInProgress, renderLanes);\n\n case Profiler:\n return updateProfiler(current, workInProgress, renderLanes);\n\n case ContextProvider:\n return updateContextProvider(current, workInProgress, renderLanes);\n\n case ContextConsumer:\n return updateContextConsumer(current, workInProgress, renderLanes);\n\n case MemoComponent:\n {\n var _type2 = workInProgress.type;\n var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.\n\n var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);\n\n {\n if (workInProgress.type !== workInProgress.elementType) {\n var outerPropTypes = _type2.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only\n 'prop', getComponentNameFromType(_type2));\n }\n }\n }\n\n _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);\n return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, renderLanes);\n }\n\n case SimpleMemoComponent:\n {\n return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, renderLanes);\n }\n\n case IncompleteClassComponent:\n {\n var _Component2 = workInProgress.type;\n var _unresolvedProps4 = workInProgress.pendingProps;\n\n var _resolvedProps4 = workInProgress.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4);\n\n return mountIncompleteClassComponent(current, workInProgress, _Component2, _resolvedProps4, renderLanes);\n }\n\n case SuspenseListComponent:\n {\n return updateSuspenseListComponent(current, workInProgress, renderLanes);\n }\n\n case ScopeComponent:\n {\n\n break;\n }\n\n case OffscreenComponent:\n {\n return updateOffscreenComponent(current, workInProgress, renderLanes);\n }\n }\n\n throw new Error(\"Unknown unit of work tag (\" + workInProgress.tag + \"). This error is likely caused by a bug in \" + 'React. Please file an issue.');\n}\n\nfunction markUpdate(workInProgress) {\n // Tag the fiber with an update effect. This turns a Placement into\n // a PlacementAndUpdate.\n workInProgress.flags |= Update;\n}\n\nfunction markRef$1(workInProgress) {\n workInProgress.flags |= Ref;\n\n {\n workInProgress.flags |= RefStatic;\n }\n}\n\nvar appendAllChildren;\nvar updateHostContainer;\nvar updateHostComponent$1;\nvar updateHostText$1;\n\n{\n // Mutation mode\n appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {\n // We only have the top Fiber that was created but we need recurse down its\n // children to find all the terminal nodes.\n var node = workInProgress.child;\n\n while (node !== null) {\n if (node.tag === HostComponent || node.tag === HostText) {\n appendInitialChild(parent, node.stateNode);\n } else if (node.tag === HostPortal) ; else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === workInProgress) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === workInProgress) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n };\n\n updateHostContainer = function (current, workInProgress) {// Noop\n };\n\n updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {\n // If we have an alternate, that means this is an update and we need to\n // schedule a side-effect to do the updates.\n var oldProps = current.memoizedProps;\n\n if (oldProps === newProps) {\n // In mutation mode, this is sufficient for a bailout because\n // we won't touch this node even if children changed.\n return;\n } // If we get updated because one of our children updated, we don't\n // have newProps so we'll have to reuse them.\n // TODO: Split the update API as separate for the props vs. children.\n // Even better would be if children weren't special cased at all tho.\n\n\n var instance = workInProgress.stateNode;\n var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host\n // component is hitting the resume path. Figure out why. Possibly\n // related to `hidden`.\n\n var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.\n\n workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n // is a new ref we mark this as an update. All the work is done in commitWork.\n\n if (updatePayload) {\n markUpdate(workInProgress);\n }\n };\n\n updateHostText$1 = function (current, workInProgress, oldText, newText) {\n // If the text differs, mark it as an update. All the work in done in commitWork.\n if (oldText !== newText) {\n markUpdate(workInProgress);\n }\n };\n}\n\nfunction cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {\n if (getIsHydrating()) {\n // If we're hydrating, we should consume as many items as we can\n // so we don't leave any behind.\n return;\n }\n\n switch (renderState.tailMode) {\n case 'hidden':\n {\n // Any insertions at the end of the tail list after this point\n // should be invisible. If there are already mounted boundaries\n // anything before them are not considered for collapsing.\n // Therefore we need to go through the whole tail to find if\n // there are any.\n var tailNode = renderState.tail;\n var lastTailNode = null;\n\n while (tailNode !== null) {\n if (tailNode.alternate !== null) {\n lastTailNode = tailNode;\n }\n\n tailNode = tailNode.sibling;\n } // Next we're simply going to delete all insertions after the\n // last rendered item.\n\n\n if (lastTailNode === null) {\n // All remaining items in the tail are insertions.\n renderState.tail = null;\n } else {\n // Detach the insertion after the last node that was already\n // inserted.\n lastTailNode.sibling = null;\n }\n\n break;\n }\n\n case 'collapsed':\n {\n // Any insertions at the end of the tail list after this point\n // should be invisible. If there are already mounted boundaries\n // anything before them are not considered for collapsing.\n // Therefore we need to go through the whole tail to find if\n // there are any.\n var _tailNode = renderState.tail;\n var _lastTailNode = null;\n\n while (_tailNode !== null) {\n if (_tailNode.alternate !== null) {\n _lastTailNode = _tailNode;\n }\n\n _tailNode = _tailNode.sibling;\n } // Next we're simply going to delete all insertions after the\n // last rendered item.\n\n\n if (_lastTailNode === null) {\n // All remaining items in the tail are insertions.\n if (!hasRenderedATailFallback && renderState.tail !== null) {\n // We suspended during the head. We want to show at least one\n // row at the tail. So we'll keep on and cut off the rest.\n renderState.tail.sibling = null;\n } else {\n renderState.tail = null;\n }\n } else {\n // Detach the insertion after the last node that was already\n // inserted.\n _lastTailNode.sibling = null;\n }\n\n break;\n }\n }\n}\n\nfunction bubbleProperties(completedWork) {\n var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child;\n var newChildLanes = NoLanes;\n var subtreeFlags = NoFlags;\n\n if (!didBailout) {\n // Bubble up the earliest expiration time.\n if ( (completedWork.mode & ProfileMode) !== NoMode) {\n // In profiling mode, resetChildExpirationTime is also used to reset\n // profiler durations.\n var actualDuration = completedWork.actualDuration;\n var treeBaseDuration = completedWork.selfBaseDuration;\n var child = completedWork.child;\n\n while (child !== null) {\n newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));\n subtreeFlags |= child.subtreeFlags;\n subtreeFlags |= child.flags; // When a fiber is cloned, its actualDuration is reset to 0. This value will\n // only be updated if work is done on the fiber (i.e. it doesn't bailout).\n // When work is done, it should bubble to the parent's actualDuration. If\n // the fiber has not been cloned though, (meaning no work was done), then\n // this value will reflect the amount of time spent working on a previous\n // render. In that case it should not bubble. We determine whether it was\n // cloned by comparing the child pointer.\n\n actualDuration += child.actualDuration;\n treeBaseDuration += child.treeBaseDuration;\n child = child.sibling;\n }\n\n completedWork.actualDuration = actualDuration;\n completedWork.treeBaseDuration = treeBaseDuration;\n } else {\n var _child = completedWork.child;\n\n while (_child !== null) {\n newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));\n subtreeFlags |= _child.subtreeFlags;\n subtreeFlags |= _child.flags; // Update the return pointer so the tree is consistent. This is a code\n // smell because it assumes the commit phase is never concurrent with\n // the render phase. Will address during refactor to alternate model.\n\n _child.return = completedWork;\n _child = _child.sibling;\n }\n }\n\n completedWork.subtreeFlags |= subtreeFlags;\n } else {\n // Bubble up the earliest expiration time.\n if ( (completedWork.mode & ProfileMode) !== NoMode) {\n // In profiling mode, resetChildExpirationTime is also used to reset\n // profiler durations.\n var _treeBaseDuration = completedWork.selfBaseDuration;\n var _child2 = completedWork.child;\n\n while (_child2 !== null) {\n newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes)); // \"Static\" flags share the lifetime of the fiber/hook they belong to,\n // so we should bubble those up even during a bailout. All the other\n // flags have a lifetime only of a single render + commit, so we should\n // ignore them.\n\n subtreeFlags |= _child2.subtreeFlags & StaticMask;\n subtreeFlags |= _child2.flags & StaticMask;\n _treeBaseDuration += _child2.treeBaseDuration;\n _child2 = _child2.sibling;\n }\n\n completedWork.treeBaseDuration = _treeBaseDuration;\n } else {\n var _child3 = completedWork.child;\n\n while (_child3 !== null) {\n newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes)); // \"Static\" flags share the lifetime of the fiber/hook they belong to,\n // so we should bubble those up even during a bailout. All the other\n // flags have a lifetime only of a single render + commit, so we should\n // ignore them.\n\n subtreeFlags |= _child3.subtreeFlags & StaticMask;\n subtreeFlags |= _child3.flags & StaticMask; // Update the return pointer so the tree is consistent. This is a code\n // smell because it assumes the commit phase is never concurrent with\n // the render phase. Will address during refactor to alternate model.\n\n _child3.return = completedWork;\n _child3 = _child3.sibling;\n }\n }\n\n completedWork.subtreeFlags |= subtreeFlags;\n }\n\n completedWork.childLanes = newChildLanes;\n return didBailout;\n}\n\nfunction completeDehydratedSuspenseBoundary(current, workInProgress, nextState) {\n if (hasUnhydratedTailNodes() && (workInProgress.mode & ConcurrentMode) !== NoMode && (workInProgress.flags & DidCapture) === NoFlags) {\n warnIfUnhydratedTailNodes(workInProgress);\n resetHydrationState();\n workInProgress.flags |= ForceClientRender | Incomplete | ShouldCapture;\n return false;\n }\n\n var wasHydrated = popHydrationState(workInProgress);\n\n if (nextState !== null && nextState.dehydrated !== null) {\n // We might be inside a hydration state the first time we're picking up this\n // Suspense boundary, and also after we've reentered it for further hydration.\n if (current === null) {\n if (!wasHydrated) {\n throw new Error('A dehydrated suspense component was completed without a hydrated node. ' + 'This is probably a bug in React.');\n }\n\n prepareToHydrateHostSuspenseInstance(workInProgress);\n bubbleProperties(workInProgress);\n\n {\n if ((workInProgress.mode & ProfileMode) !== NoMode) {\n var isTimedOutSuspense = nextState !== null;\n\n if (isTimedOutSuspense) {\n // Don't count time spent in a timed out Suspense subtree as part of the base duration.\n var primaryChildFragment = workInProgress.child;\n\n if (primaryChildFragment !== null) {\n // $FlowFixMe Flow doesn't support type casting in combination with the -= operator\n workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration;\n }\n }\n }\n }\n\n return false;\n } else {\n // We might have reentered this boundary to hydrate it. If so, we need to reset the hydration\n // state since we're now exiting out of it. popHydrationState doesn't do that for us.\n resetHydrationState();\n\n if ((workInProgress.flags & DidCapture) === NoFlags) {\n // This boundary did not suspend so it's now hydrated and unsuspended.\n workInProgress.memoizedState = null;\n } // If nothing suspended, we need to schedule an effect to mark this boundary\n // as having hydrated so events know that they're free to be invoked.\n // It's also a signal to replay events and the suspense callback.\n // If something suspended, schedule an effect to attach retry listeners.\n // So we might as well always mark this.\n\n\n workInProgress.flags |= Update;\n bubbleProperties(workInProgress);\n\n {\n if ((workInProgress.mode & ProfileMode) !== NoMode) {\n var _isTimedOutSuspense = nextState !== null;\n\n if (_isTimedOutSuspense) {\n // Don't count time spent in a timed out Suspense subtree as part of the base duration.\n var _primaryChildFragment = workInProgress.child;\n\n if (_primaryChildFragment !== null) {\n // $FlowFixMe Flow doesn't support type casting in combination with the -= operator\n workInProgress.treeBaseDuration -= _primaryChildFragment.treeBaseDuration;\n }\n }\n }\n }\n\n return false;\n }\n } else {\n // Successfully completed this tree. If this was a forced client render,\n // there may have been recoverable errors during first hydration\n // attempt. If so, add them to a queue so we can log them in the\n // commit phase.\n upgradeHydrationErrorsToRecoverable(); // Fall through to normal Suspense path\n\n return true;\n }\n}\n\nfunction completeWork(current, workInProgress, renderLanes) {\n var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing\n // to the current tree provider fiber is just as fast and less error-prone.\n // Ideally we would have a special version of the work loop only\n // for hydration.\n\n popTreeContext(workInProgress);\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n case LazyComponent:\n case SimpleMemoComponent:\n case FunctionComponent:\n case ForwardRef:\n case Fragment:\n case Mode:\n case Profiler:\n case ContextConsumer:\n case MemoComponent:\n bubbleProperties(workInProgress);\n return null;\n\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n popContext(workInProgress);\n }\n\n bubbleProperties(workInProgress);\n return null;\n }\n\n case HostRoot:\n {\n var fiberRoot = workInProgress.stateNode;\n popHostContainer(workInProgress);\n popTopLevelContextObject(workInProgress);\n resetWorkInProgressVersions();\n\n if (fiberRoot.pendingContext) {\n fiberRoot.context = fiberRoot.pendingContext;\n fiberRoot.pendingContext = null;\n }\n\n if (current === null || current.child === null) {\n // If we hydrated, pop so that we can delete any remaining children\n // that weren't hydrated.\n var wasHydrated = popHydrationState(workInProgress);\n\n if (wasHydrated) {\n // If we hydrated, then we'll need to schedule an update for\n // the commit side-effects on the root.\n markUpdate(workInProgress);\n } else {\n if (current !== null) {\n var prevState = current.memoizedState;\n\n if ( // Check if this is a client root\n !prevState.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error)\n (workInProgress.flags & ForceClientRender) !== NoFlags) {\n // Schedule an effect to clear this container at the start of the\n // next commit. This handles the case of React rendering into a\n // container with previous children. It's also safe to do for\n // updates too, because current.child would only be null if the\n // previous render was null (so the container would already\n // be empty).\n workInProgress.flags |= Snapshot; // If this was a forced client render, there may have been\n // recoverable errors during first hydration attempt. If so, add\n // them to a queue so we can log them in the commit phase.\n\n upgradeHydrationErrorsToRecoverable();\n }\n }\n }\n }\n\n updateHostContainer(current, workInProgress);\n bubbleProperties(workInProgress);\n\n return null;\n }\n\n case HostComponent:\n {\n popHostContext(workInProgress);\n var rootContainerInstance = getRootHostContainer();\n var type = workInProgress.type;\n\n if (current !== null && workInProgress.stateNode != null) {\n updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);\n\n if (current.ref !== workInProgress.ref) {\n markRef$1(workInProgress);\n }\n } else {\n if (!newProps) {\n if (workInProgress.stateNode === null) {\n throw new Error('We must have new props for new mounts. This error is likely ' + 'caused by a bug in React. Please file an issue.');\n } // This can happen when we abort work.\n\n\n bubbleProperties(workInProgress);\n return null;\n }\n\n var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context\n // \"stack\" as the parent. Then append children as we go in beginWork\n // or completeWork depending on whether we want to add them top->down or\n // bottom->up. Top->down is faster in IE11.\n\n var _wasHydrated = popHydrationState(workInProgress);\n\n if (_wasHydrated) {\n // TODO: Move this and createInstance step into the beginPhase\n // to consolidate.\n if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {\n // If changes to the hydrated node need to be applied at the\n // commit-phase we mark this as such.\n markUpdate(workInProgress);\n }\n } else {\n var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);\n appendAllChildren(instance, workInProgress, false, false);\n workInProgress.stateNode = instance; // Certain renderers require commit-time effects for initial mount.\n // (eg DOM renderer supports auto-focus for certain elements).\n // Make sure such renderers get scheduled for later work.\n\n if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {\n markUpdate(workInProgress);\n }\n }\n\n if (workInProgress.ref !== null) {\n // If there is a ref on a host node we need to schedule a callback\n markRef$1(workInProgress);\n }\n }\n\n bubbleProperties(workInProgress);\n return null;\n }\n\n case HostText:\n {\n var newText = newProps;\n\n if (current && workInProgress.stateNode != null) {\n var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need\n // to schedule a side-effect to do the updates.\n\n updateHostText$1(current, workInProgress, oldText, newText);\n } else {\n if (typeof newText !== 'string') {\n if (workInProgress.stateNode === null) {\n throw new Error('We must have new props for new mounts. This error is likely ' + 'caused by a bug in React. Please file an issue.');\n } // This can happen when we abort work.\n\n }\n\n var _rootContainerInstance = getRootHostContainer();\n\n var _currentHostContext = getHostContext();\n\n var _wasHydrated2 = popHydrationState(workInProgress);\n\n if (_wasHydrated2) {\n if (prepareToHydrateHostTextInstance(workInProgress)) {\n markUpdate(workInProgress);\n }\n } else {\n workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);\n }\n }\n\n bubbleProperties(workInProgress);\n return null;\n }\n\n case SuspenseComponent:\n {\n popSuspenseContext(workInProgress);\n var nextState = workInProgress.memoizedState; // Special path for dehydrated boundaries. We may eventually move this\n // to its own fiber type so that we can add other kinds of hydration\n // boundaries that aren't associated with a Suspense tree. In anticipation\n // of such a refactor, all the hydration logic is contained in\n // this branch.\n\n if (current === null || current.memoizedState !== null && current.memoizedState.dehydrated !== null) {\n var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current, workInProgress, nextState);\n\n if (!fallthroughToNormalSuspensePath) {\n if (workInProgress.flags & ShouldCapture) {\n // Special case. There were remaining unhydrated nodes. We treat\n // this as a mismatch. Revert to client rendering.\n return workInProgress;\n } else {\n // Did not finish hydrating, either because this is the initial\n // render or because something suspended.\n return null;\n }\n } // Continue with the normal Suspense path.\n\n }\n\n if ((workInProgress.flags & DidCapture) !== NoFlags) {\n // Something suspended. Re-render with the fallback children.\n workInProgress.lanes = renderLanes; // Do not reset the effect list.\n\n if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n transferActualDuration(workInProgress);\n } // Don't bubble properties in this case.\n\n\n return workInProgress;\n }\n\n var nextDidTimeout = nextState !== null;\n var prevDidTimeout = current !== null && current.memoizedState !== null;\n // a passive effect, which is when we process the transitions\n\n\n if (nextDidTimeout !== prevDidTimeout) {\n // an effect to toggle the subtree's visibility. When we switch from\n // fallback -> primary, the inner Offscreen fiber schedules this effect\n // as part of its normal complete phase. But when we switch from\n // primary -> fallback, the inner Offscreen fiber does not have a complete\n // phase. So we need to schedule its effect here.\n //\n // We also use this flag to connect/disconnect the effects, but the same\n // logic applies: when re-connecting, the Offscreen fiber's complete\n // phase will handle scheduling the effect. It's only when the fallback\n // is active that we have to do anything special.\n\n\n if (nextDidTimeout) {\n var _offscreenFiber2 = workInProgress.child;\n _offscreenFiber2.flags |= Visibility; // TODO: This will still suspend a synchronous tree if anything\n // in the concurrent tree already suspended during this render.\n // This is a known bug.\n\n if ((workInProgress.mode & ConcurrentMode) !== NoMode) {\n // TODO: Move this back to throwException because this is too late\n // if this is a large tree which is common for initial loads. We\n // don't know if we should restart a render or not until we get\n // this marker, and this is too late.\n // If this render already had a ping or lower pri updates,\n // and this is the first time we know we're going to suspend we\n // should be able to immediately restart from within throwException.\n var hasInvisibleChildContext = current === null && (workInProgress.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback);\n\n if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {\n // If this was in an invisible tree or a new render, then showing\n // this boundary is ok.\n renderDidSuspend();\n } else {\n // Otherwise, we're going to have to hide content so we should\n // suspend for longer if possible.\n renderDidSuspendDelayIfPossible();\n }\n }\n }\n }\n\n var wakeables = workInProgress.updateQueue;\n\n if (wakeables !== null) {\n // Schedule an effect to attach a retry listener to the promise.\n // TODO: Move to passive phase\n workInProgress.flags |= Update;\n }\n\n bubbleProperties(workInProgress);\n\n {\n if ((workInProgress.mode & ProfileMode) !== NoMode) {\n if (nextDidTimeout) {\n // Don't count time spent in a timed out Suspense subtree as part of the base duration.\n var primaryChildFragment = workInProgress.child;\n\n if (primaryChildFragment !== null) {\n // $FlowFixMe Flow doesn't support type casting in combination with the -= operator\n workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration;\n }\n }\n }\n }\n\n return null;\n }\n\n case HostPortal:\n popHostContainer(workInProgress);\n updateHostContainer(current, workInProgress);\n\n if (current === null) {\n preparePortalMount(workInProgress.stateNode.containerInfo);\n }\n\n bubbleProperties(workInProgress);\n return null;\n\n case ContextProvider:\n // Pop provider fiber\n var context = workInProgress.type._context;\n popProvider(context, workInProgress);\n bubbleProperties(workInProgress);\n return null;\n\n case IncompleteClassComponent:\n {\n // Same as class component case. I put it down here so that the tags are\n // sequential to ensure this switch is compiled to a jump table.\n var _Component = workInProgress.type;\n\n if (isContextProvider(_Component)) {\n popContext(workInProgress);\n }\n\n bubbleProperties(workInProgress);\n return null;\n }\n\n case SuspenseListComponent:\n {\n popSuspenseContext(workInProgress);\n var renderState = workInProgress.memoizedState;\n\n if (renderState === null) {\n // We're running in the default, \"independent\" mode.\n // We don't do anything in this mode.\n bubbleProperties(workInProgress);\n return null;\n }\n\n var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags;\n var renderedTail = renderState.rendering;\n\n if (renderedTail === null) {\n // We just rendered the head.\n if (!didSuspendAlready) {\n // This is the first pass. We need to figure out if anything is still\n // suspended in the rendered set.\n // If new content unsuspended, but there's still some content that\n // didn't. Then we need to do a second pass that forces everything\n // to keep showing their fallbacks.\n // We might be suspended if something in this render pass suspended, or\n // something in the previous committed pass suspended. Otherwise,\n // there's no chance so we can skip the expensive call to\n // findFirstSuspended.\n var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags);\n\n if (!cannotBeSuspended) {\n var row = workInProgress.child;\n\n while (row !== null) {\n var suspended = findFirstSuspended(row);\n\n if (suspended !== null) {\n didSuspendAlready = true;\n workInProgress.flags |= DidCapture;\n cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as\n // part of the second pass. In that case nothing will subscribe to\n // its thenables. Instead, we'll transfer its thenables to the\n // SuspenseList so that it can retry if they resolve.\n // There might be multiple of these in the list but since we're\n // going to wait for all of them anyway, it doesn't really matter\n // which ones gets to ping. In theory we could get clever and keep\n // track of how many dependencies remain but it gets tricky because\n // in the meantime, we can add/remove/change items and dependencies.\n // We might bail out of the loop before finding any but that\n // doesn't matter since that means that the other boundaries that\n // we did find already has their listeners attached.\n\n var newThenables = suspended.updateQueue;\n\n if (newThenables !== null) {\n workInProgress.updateQueue = newThenables;\n workInProgress.flags |= Update;\n } // Rerender the whole list, but this time, we'll force fallbacks\n // to stay in place.\n // Reset the effect flags before doing the second pass since that's now invalid.\n // Reset the child fibers to their original state.\n\n\n workInProgress.subtreeFlags = NoFlags;\n resetChildFibers(workInProgress, renderLanes); // Set up the Suspense Context to force suspense and immediately\n // rerender the children.\n\n pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback)); // Don't bubble properties in this case.\n\n return workInProgress.child;\n }\n\n row = row.sibling;\n }\n }\n\n if (renderState.tail !== null && now() > getRenderTargetTime()) {\n // We have already passed our CPU deadline but we still have rows\n // left in the tail. We'll just give up further attempts to render\n // the main content and only render fallbacks.\n workInProgress.flags |= DidCapture;\n didSuspendAlready = true;\n cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this\n // to get it started back up to attempt the next item. While in terms\n // of priority this work has the same priority as this current render,\n // it's not part of the same transition once the transition has\n // committed. If it's sync, we still want to yield so that it can be\n // painted. Conceptually, this is really the same as pinging.\n // We can use any RetryLane even if it's the one currently rendering\n // since we're leaving it behind on this node.\n\n workInProgress.lanes = SomeRetryLane;\n }\n } else {\n cutOffTailIfNeeded(renderState, false);\n } // Next we're going to render the tail.\n\n } else {\n // Append the rendered row to the child list.\n if (!didSuspendAlready) {\n var _suspended = findFirstSuspended(renderedTail);\n\n if (_suspended !== null) {\n workInProgress.flags |= DidCapture;\n didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't\n // get lost if this row ends up dropped during a second pass.\n\n var _newThenables = _suspended.updateQueue;\n\n if (_newThenables !== null) {\n workInProgress.updateQueue = _newThenables;\n workInProgress.flags |= Update;\n }\n\n cutOffTailIfNeeded(renderState, true); // This might have been modified.\n\n if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate && !getIsHydrating() // We don't cut it if we're hydrating.\n ) {\n // We're done.\n bubbleProperties(workInProgress);\n return null;\n }\n } else if ( // The time it took to render last row is greater than the remaining\n // time we have to render. So rendering one more row would likely\n // exceed it.\n now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) {\n // We have now passed our CPU deadline and we'll just give up further\n // attempts to render the main content and only render fallbacks.\n // The assumption is that this is usually faster.\n workInProgress.flags |= DidCapture;\n didSuspendAlready = true;\n cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this\n // to get it started back up to attempt the next item. While in terms\n // of priority this work has the same priority as this current render,\n // it's not part of the same transition once the transition has\n // committed. If it's sync, we still want to yield so that it can be\n // painted. Conceptually, this is really the same as pinging.\n // We can use any RetryLane even if it's the one currently rendering\n // since we're leaving it behind on this node.\n\n workInProgress.lanes = SomeRetryLane;\n }\n }\n\n if (renderState.isBackwards) {\n // The effect list of the backwards tail will have been added\n // to the end. This breaks the guarantee that life-cycles fire in\n // sibling order but that isn't a strong guarantee promised by React.\n // Especially since these might also just pop in during future commits.\n // Append to the beginning of the list.\n renderedTail.sibling = workInProgress.child;\n workInProgress.child = renderedTail;\n } else {\n var previousSibling = renderState.last;\n\n if (previousSibling !== null) {\n previousSibling.sibling = renderedTail;\n } else {\n workInProgress.child = renderedTail;\n }\n\n renderState.last = renderedTail;\n }\n }\n\n if (renderState.tail !== null) {\n // We still have tail rows to render.\n // Pop a row.\n var next = renderState.tail;\n renderState.rendering = next;\n renderState.tail = next.sibling;\n renderState.renderingStartTime = now();\n next.sibling = null; // Restore the context.\n // TODO: We can probably just avoid popping it instead and only\n // setting it the first time we go from not suspended to suspended.\n\n var suspenseContext = suspenseStackCursor.current;\n\n if (didSuspendAlready) {\n suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n } else {\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n }\n\n pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.\n // Don't bubble properties in this case.\n\n return next;\n }\n\n bubbleProperties(workInProgress);\n return null;\n }\n\n case ScopeComponent:\n {\n\n break;\n }\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n {\n popRenderLanes(workInProgress);\n var _nextState = workInProgress.memoizedState;\n var nextIsHidden = _nextState !== null;\n\n if (current !== null) {\n var _prevState = current.memoizedState;\n var prevIsHidden = _prevState !== null;\n\n if (prevIsHidden !== nextIsHidden && ( // LegacyHidden doesn't do any hiding — it only pre-renders.\n !enableLegacyHidden )) {\n workInProgress.flags |= Visibility;\n }\n }\n\n if (!nextIsHidden || (workInProgress.mode & ConcurrentMode) === NoMode) {\n bubbleProperties(workInProgress);\n } else {\n // Don't bubble properties for hidden children unless we're rendering\n // at offscreen priority.\n if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) {\n bubbleProperties(workInProgress);\n\n {\n // Check if there was an insertion or update in the hidden subtree.\n // If so, we need to hide those nodes in the commit phase, so\n // schedule a visibility effect.\n if ( workInProgress.subtreeFlags & (Placement | Update)) {\n workInProgress.flags |= Visibility;\n }\n }\n }\n }\n return null;\n }\n\n case CacheComponent:\n {\n\n return null;\n }\n\n case TracingMarkerComponent:\n {\n\n return null;\n }\n }\n\n throw new Error(\"Unknown unit of work tag (\" + workInProgress.tag + \"). This error is likely caused by a bug in \" + 'React. Please file an issue.');\n}\n\nfunction unwindWork(current, workInProgress, renderLanes) {\n // Note: This intentionally doesn't check if we're hydrating because comparing\n // to the current tree provider fiber is just as fast and less error-prone.\n // Ideally we would have a special version of the work loop only\n // for hydration.\n popTreeContext(workInProgress);\n\n switch (workInProgress.tag) {\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n popContext(workInProgress);\n }\n\n var flags = workInProgress.flags;\n\n if (flags & ShouldCapture) {\n workInProgress.flags = flags & ~ShouldCapture | DidCapture;\n\n if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n transferActualDuration(workInProgress);\n }\n\n return workInProgress;\n }\n\n return null;\n }\n\n case HostRoot:\n {\n var root = workInProgress.stateNode;\n popHostContainer(workInProgress);\n popTopLevelContextObject(workInProgress);\n resetWorkInProgressVersions();\n var _flags = workInProgress.flags;\n\n if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {\n // There was an error during render that wasn't captured by a suspense\n // boundary. Do a second pass on the root to unmount the children.\n workInProgress.flags = _flags & ~ShouldCapture | DidCapture;\n return workInProgress;\n } // We unwound to the root without completing it. Exit.\n\n\n return null;\n }\n\n case HostComponent:\n {\n // TODO: popHydrationState\n popHostContext(workInProgress);\n return null;\n }\n\n case SuspenseComponent:\n {\n popSuspenseContext(workInProgress);\n var suspenseState = workInProgress.memoizedState;\n\n if (suspenseState !== null && suspenseState.dehydrated !== null) {\n if (workInProgress.alternate === null) {\n throw new Error('Threw in newly mounted dehydrated component. This is likely a bug in ' + 'React. Please file an issue.');\n }\n\n resetHydrationState();\n }\n\n var _flags2 = workInProgress.flags;\n\n if (_flags2 & ShouldCapture) {\n workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.\n\n if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n transferActualDuration(workInProgress);\n }\n\n return workInProgress;\n }\n\n return null;\n }\n\n case SuspenseListComponent:\n {\n popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been\n // caught by a nested boundary. If not, it should bubble through.\n\n return null;\n }\n\n case HostPortal:\n popHostContainer(workInProgress);\n return null;\n\n case ContextProvider:\n var context = workInProgress.type._context;\n popProvider(context, workInProgress);\n return null;\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n popRenderLanes(workInProgress);\n return null;\n\n case CacheComponent:\n\n return null;\n\n default:\n return null;\n }\n}\n\nfunction unwindInterruptedWork(current, interruptedWork, renderLanes) {\n // Note: This intentionally doesn't check if we're hydrating because comparing\n // to the current tree provider fiber is just as fast and less error-prone.\n // Ideally we would have a special version of the work loop only\n // for hydration.\n popTreeContext(interruptedWork);\n\n switch (interruptedWork.tag) {\n case ClassComponent:\n {\n var childContextTypes = interruptedWork.type.childContextTypes;\n\n if (childContextTypes !== null && childContextTypes !== undefined) {\n popContext(interruptedWork);\n }\n\n break;\n }\n\n case HostRoot:\n {\n var root = interruptedWork.stateNode;\n popHostContainer(interruptedWork);\n popTopLevelContextObject(interruptedWork);\n resetWorkInProgressVersions();\n break;\n }\n\n case HostComponent:\n {\n popHostContext(interruptedWork);\n break;\n }\n\n case HostPortal:\n popHostContainer(interruptedWork);\n break;\n\n case SuspenseComponent:\n popSuspenseContext(interruptedWork);\n break;\n\n case SuspenseListComponent:\n popSuspenseContext(interruptedWork);\n break;\n\n case ContextProvider:\n var context = interruptedWork.type._context;\n popProvider(context, interruptedWork);\n break;\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n popRenderLanes(interruptedWork);\n break;\n }\n}\n\nvar didWarnAboutUndefinedSnapshotBeforeUpdate = null;\n\n{\n didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();\n} // Used during the commit phase to track the state of the Offscreen component stack.\n// Allows us to avoid traversing the return path to find the nearest Offscreen ancestor.\n// Only used when enableSuspenseLayoutEffectSemantics is enabled.\n\n\nvar offscreenSubtreeIsHidden = false;\nvar offscreenSubtreeWasHidden = false;\nvar PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;\nvar nextEffect = null; // Used for Profiling builds to track updaters.\n\nvar inProgressLanes = null;\nvar inProgressRoot = null;\nfunction reportUncaughtErrorInDEV(error) {\n // Wrapping each small part of the commit phase into a guarded\n // callback is a bit too slow (https://github.com/facebook/react/pull/21666).\n // But we rely on it to surface errors to DEV tools like overlays\n // (https://github.com/facebook/react/issues/21712).\n // As a compromise, rethrow only caught errors in a guard.\n {\n invokeGuardedCallback(null, function () {\n throw error;\n });\n clearCaughtError();\n }\n}\n\nvar callComponentWillUnmountWithTimer = function (current, instance) {\n instance.props = current.memoizedProps;\n instance.state = current.memoizedState;\n\n if ( current.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n instance.componentWillUnmount();\n } finally {\n recordLayoutEffectDuration(current);\n }\n } else {\n instance.componentWillUnmount();\n }\n}; // Capture errors so they don't interrupt mounting.\n\n\nfunction safelyCallCommitHookLayoutEffectListMount(current, nearestMountedAncestor) {\n try {\n commitHookEffectListMount(Layout, current);\n } catch (error) {\n captureCommitPhaseError(current, nearestMountedAncestor, error);\n }\n} // Capture errors so they don't interrupt unmounting.\n\n\nfunction safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) {\n try {\n callComponentWillUnmountWithTimer(current, instance);\n } catch (error) {\n captureCommitPhaseError(current, nearestMountedAncestor, error);\n }\n} // Capture errors so they don't interrupt mounting.\n\n\nfunction safelyCallComponentDidMount(current, nearestMountedAncestor, instance) {\n try {\n instance.componentDidMount();\n } catch (error) {\n captureCommitPhaseError(current, nearestMountedAncestor, error);\n }\n} // Capture errors so they don't interrupt mounting.\n\n\nfunction safelyAttachRef(current, nearestMountedAncestor) {\n try {\n commitAttachRef(current);\n } catch (error) {\n captureCommitPhaseError(current, nearestMountedAncestor, error);\n }\n}\n\nfunction safelyDetachRef(current, nearestMountedAncestor) {\n var ref = current.ref;\n\n if (ref !== null) {\n if (typeof ref === 'function') {\n var retVal;\n\n try {\n if (enableProfilerTimer && enableProfilerCommitHooks && current.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n retVal = ref(null);\n } finally {\n recordLayoutEffectDuration(current);\n }\n } else {\n retVal = ref(null);\n }\n } catch (error) {\n captureCommitPhaseError(current, nearestMountedAncestor, error);\n }\n\n {\n if (typeof retVal === 'function') {\n error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(current));\n }\n }\n } else {\n ref.current = null;\n }\n }\n}\n\nfunction safelyCallDestroy(current, nearestMountedAncestor, destroy) {\n try {\n destroy();\n } catch (error) {\n captureCommitPhaseError(current, nearestMountedAncestor, error);\n }\n}\n\nvar focusedInstanceHandle = null;\nvar shouldFireAfterActiveInstanceBlur = false;\nfunction commitBeforeMutationEffects(root, firstChild) {\n focusedInstanceHandle = prepareForCommit(root.containerInfo);\n nextEffect = firstChild;\n commitBeforeMutationEffects_begin(); // We no longer need to track the active instance fiber\n\n var shouldFire = shouldFireAfterActiveInstanceBlur;\n shouldFireAfterActiveInstanceBlur = false;\n focusedInstanceHandle = null;\n return shouldFire;\n}\n\nfunction commitBeforeMutationEffects_begin() {\n while (nextEffect !== null) {\n var fiber = nextEffect; // This phase is only used for beforeActiveInstanceBlur.\n\n var child = fiber.child;\n\n if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {\n child.return = fiber;\n nextEffect = child;\n } else {\n commitBeforeMutationEffects_complete();\n }\n }\n}\n\nfunction commitBeforeMutationEffects_complete() {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n setCurrentFiber(fiber);\n\n try {\n commitBeforeMutationEffectsOnFiber(fiber);\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n\n resetCurrentFiber();\n var sibling = fiber.sibling;\n\n if (sibling !== null) {\n sibling.return = fiber.return;\n nextEffect = sibling;\n return;\n }\n\n nextEffect = fiber.return;\n }\n}\n\nfunction commitBeforeMutationEffectsOnFiber(finishedWork) {\n var current = finishedWork.alternate;\n var flags = finishedWork.flags;\n\n if ((flags & Snapshot) !== NoFlags) {\n setCurrentFiber(finishedWork);\n\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n break;\n }\n\n case ClassComponent:\n {\n if (current !== null) {\n var prevProps = current.memoizedProps;\n var prevState = current.memoizedState;\n var instance = finishedWork.stateNode; // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance');\n }\n }\n }\n\n var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);\n\n {\n var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;\n\n if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {\n didWarnSet.add(finishedWork.type);\n\n error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentNameFromFiber(finishedWork));\n }\n }\n\n instance.__reactInternalSnapshotBeforeUpdate = snapshot;\n }\n\n break;\n }\n\n case HostRoot:\n {\n {\n var root = finishedWork.stateNode;\n clearContainer(root.containerInfo);\n }\n\n break;\n }\n\n case HostComponent:\n case HostText:\n case HostPortal:\n case IncompleteClassComponent:\n // Nothing to do for these component types\n break;\n\n default:\n {\n throw new Error('This unit of work tag should not have side-effects. This error is ' + 'likely caused by a bug in React. Please file an issue.');\n }\n }\n\n resetCurrentFiber();\n }\n}\n\nfunction commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n if ((effect.tag & flags) === flags) {\n // Unmount\n var destroy = effect.destroy;\n effect.destroy = undefined;\n\n if (destroy !== undefined) {\n {\n if ((flags & Passive$1) !== NoFlags$1) {\n markComponentPassiveEffectUnmountStarted(finishedWork);\n } else if ((flags & Layout) !== NoFlags$1) {\n markComponentLayoutEffectUnmountStarted(finishedWork);\n }\n }\n\n {\n if ((flags & Insertion) !== NoFlags$1) {\n setIsRunningInsertionEffect(true);\n }\n }\n\n safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);\n\n {\n if ((flags & Insertion) !== NoFlags$1) {\n setIsRunningInsertionEffect(false);\n }\n }\n\n {\n if ((flags & Passive$1) !== NoFlags$1) {\n markComponentPassiveEffectUnmountStopped();\n } else if ((flags & Layout) !== NoFlags$1) {\n markComponentLayoutEffectUnmountStopped();\n }\n }\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction commitHookEffectListMount(flags, finishedWork) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n if ((effect.tag & flags) === flags) {\n {\n if ((flags & Passive$1) !== NoFlags$1) {\n markComponentPassiveEffectMountStarted(finishedWork);\n } else if ((flags & Layout) !== NoFlags$1) {\n markComponentLayoutEffectMountStarted(finishedWork);\n }\n } // Mount\n\n\n var create = effect.create;\n\n {\n if ((flags & Insertion) !== NoFlags$1) {\n setIsRunningInsertionEffect(true);\n }\n }\n\n effect.destroy = create();\n\n {\n if ((flags & Insertion) !== NoFlags$1) {\n setIsRunningInsertionEffect(false);\n }\n }\n\n {\n if ((flags & Passive$1) !== NoFlags$1) {\n markComponentPassiveEffectMountStopped();\n } else if ((flags & Layout) !== NoFlags$1) {\n markComponentLayoutEffectMountStopped();\n }\n }\n\n {\n var destroy = effect.destroy;\n\n if (destroy !== undefined && typeof destroy !== 'function') {\n var hookName = void 0;\n\n if ((effect.tag & Layout) !== NoFlags) {\n hookName = 'useLayoutEffect';\n } else if ((effect.tag & Insertion) !== NoFlags) {\n hookName = 'useInsertionEffect';\n } else {\n hookName = 'useEffect';\n }\n\n var addendum = void 0;\n\n if (destroy === null) {\n addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';\n } else if (typeof destroy.then === 'function') {\n addendum = '\\n\\nIt looks like you wrote ' + hookName + '(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\\n\\n' + hookName + '(() => {\\n' + ' async function fetchData() {\\n' + ' // You can await here\\n' + ' const response = await MyAPI.getData(someId);\\n' + ' // ...\\n' + ' }\\n' + ' fetchData();\\n' + \"}, [someId]); // Or [] if effect doesn't need props or state\\n\\n\" + 'Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching';\n } else {\n addendum = ' You returned: ' + destroy;\n }\n\n error('%s must not return anything besides a function, ' + 'which is used for clean-up.%s', hookName, addendum);\n }\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction commitPassiveEffectDurations(finishedRoot, finishedWork) {\n {\n // Only Profilers with work in their subtree will have an Update effect scheduled.\n if ((finishedWork.flags & Update) !== NoFlags) {\n switch (finishedWork.tag) {\n case Profiler:\n {\n var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;\n var _finishedWork$memoize = finishedWork.memoizedProps,\n id = _finishedWork$memoize.id,\n onPostCommit = _finishedWork$memoize.onPostCommit; // This value will still reflect the previous commit phase.\n // It does not get reset until the start of the next commit phase.\n\n var commitTime = getCommitTime();\n var phase = finishedWork.alternate === null ? 'mount' : 'update';\n\n {\n if (isCurrentUpdateNested()) {\n phase = 'nested-update';\n }\n }\n\n if (typeof onPostCommit === 'function') {\n onPostCommit(id, phase, passiveEffectDuration, commitTime);\n } // Bubble times to the next nearest ancestor Profiler.\n // After we process that Profiler, we'll bubble further up.\n\n\n var parentFiber = finishedWork.return;\n\n outer: while (parentFiber !== null) {\n switch (parentFiber.tag) {\n case HostRoot:\n var root = parentFiber.stateNode;\n root.passiveEffectDuration += passiveEffectDuration;\n break outer;\n\n case Profiler:\n var parentStateNode = parentFiber.stateNode;\n parentStateNode.passiveEffectDuration += passiveEffectDuration;\n break outer;\n }\n\n parentFiber = parentFiber.return;\n }\n\n break;\n }\n }\n }\n }\n}\n\nfunction commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committedLanes) {\n if ((finishedWork.flags & LayoutMask) !== NoFlags) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n if ( !offscreenSubtreeWasHidden) {\n // At this point layout effects have already been destroyed (during mutation phase).\n // This is done to prevent sibling component effects from interfering with each other,\n // e.g. a destroy function in one component should never override a ref set\n // by a create function in another component during the same commit.\n if ( finishedWork.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n commitHookEffectListMount(Layout | HasEffect, finishedWork);\n } finally {\n recordLayoutEffectDuration(finishedWork);\n }\n } else {\n commitHookEffectListMount(Layout | HasEffect, finishedWork);\n }\n }\n\n break;\n }\n\n case ClassComponent:\n {\n var instance = finishedWork.stateNode;\n\n if (finishedWork.flags & Update) {\n if (!offscreenSubtreeWasHidden) {\n if (current === null) {\n // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance');\n }\n }\n }\n\n if ( finishedWork.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n instance.componentDidMount();\n } finally {\n recordLayoutEffectDuration(finishedWork);\n }\n } else {\n instance.componentDidMount();\n }\n } else {\n var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);\n var prevState = current.memoizedState; // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance');\n }\n }\n }\n\n if ( finishedWork.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);\n } finally {\n recordLayoutEffectDuration(finishedWork);\n }\n } else {\n instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);\n }\n }\n }\n } // TODO: I think this is now always non-null by the time it reaches the\n // commit phase. Consider removing the type check.\n\n\n var updateQueue = finishedWork.updateQueue;\n\n if (updateQueue !== null) {\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance');\n }\n }\n } // We could update instance props and state here,\n // but instead we rely on them being set during last render.\n // TODO: revisit this when we implement resuming.\n\n\n commitUpdateQueue(finishedWork, updateQueue, instance);\n }\n\n break;\n }\n\n case HostRoot:\n {\n // TODO: I think this is now always non-null by the time it reaches the\n // commit phase. Consider removing the type check.\n var _updateQueue = finishedWork.updateQueue;\n\n if (_updateQueue !== null) {\n var _instance = null;\n\n if (finishedWork.child !== null) {\n switch (finishedWork.child.tag) {\n case HostComponent:\n _instance = getPublicInstance(finishedWork.child.stateNode);\n break;\n\n case ClassComponent:\n _instance = finishedWork.child.stateNode;\n break;\n }\n }\n\n commitUpdateQueue(finishedWork, _updateQueue, _instance);\n }\n\n break;\n }\n\n case HostComponent:\n {\n var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted\n // (eg DOM renderer may schedule auto-focus for inputs and form controls).\n // These effects should only be committed when components are first mounted,\n // aka when there is no current/alternate.\n\n if (current === null && finishedWork.flags & Update) {\n var type = finishedWork.type;\n var props = finishedWork.memoizedProps;\n commitMount(_instance2, type, props);\n }\n\n break;\n }\n\n case HostText:\n {\n // We have no life-cycles associated with text.\n break;\n }\n\n case HostPortal:\n {\n // We have no life-cycles associated with portals.\n break;\n }\n\n case Profiler:\n {\n {\n var _finishedWork$memoize2 = finishedWork.memoizedProps,\n onCommit = _finishedWork$memoize2.onCommit,\n onRender = _finishedWork$memoize2.onRender;\n var effectDuration = finishedWork.stateNode.effectDuration;\n var commitTime = getCommitTime();\n var phase = current === null ? 'mount' : 'update';\n\n {\n if (isCurrentUpdateNested()) {\n phase = 'nested-update';\n }\n }\n\n if (typeof onRender === 'function') {\n onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime);\n }\n\n {\n if (typeof onCommit === 'function') {\n onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime);\n } // Schedule a passive effect for this Profiler to call onPostCommit hooks.\n // This effect should be scheduled even if there is no onPostCommit callback for this Profiler,\n // because the effect is also where times bubble to parent Profilers.\n\n\n enqueuePendingPassiveProfilerEffect(finishedWork); // Propagate layout effect durations to the next nearest Profiler ancestor.\n // Do not reset these values until the next render so DevTools has a chance to read them first.\n\n var parentFiber = finishedWork.return;\n\n outer: while (parentFiber !== null) {\n switch (parentFiber.tag) {\n case HostRoot:\n var root = parentFiber.stateNode;\n root.effectDuration += effectDuration;\n break outer;\n\n case Profiler:\n var parentStateNode = parentFiber.stateNode;\n parentStateNode.effectDuration += effectDuration;\n break outer;\n }\n\n parentFiber = parentFiber.return;\n }\n }\n }\n\n break;\n }\n\n case SuspenseComponent:\n {\n commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);\n break;\n }\n\n case SuspenseListComponent:\n case IncompleteClassComponent:\n case ScopeComponent:\n case OffscreenComponent:\n case LegacyHiddenComponent:\n case TracingMarkerComponent:\n {\n break;\n }\n\n default:\n throw new Error('This unit of work tag should not have side-effects. This error is ' + 'likely caused by a bug in React. Please file an issue.');\n }\n }\n\n if ( !offscreenSubtreeWasHidden) {\n {\n if (finishedWork.flags & Ref) {\n commitAttachRef(finishedWork);\n }\n }\n }\n}\n\nfunction reappearLayoutEffectsOnFiber(node) {\n // Turn on layout effects in a tree that previously disappeared.\n // TODO (Offscreen) Check: flags & LayoutStatic\n switch (node.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n if ( node.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n safelyCallCommitHookLayoutEffectListMount(node, node.return);\n } finally {\n recordLayoutEffectDuration(node);\n }\n } else {\n safelyCallCommitHookLayoutEffectListMount(node, node.return);\n }\n\n break;\n }\n\n case ClassComponent:\n {\n var instance = node.stateNode;\n\n if (typeof instance.componentDidMount === 'function') {\n safelyCallComponentDidMount(node, node.return, instance);\n }\n\n safelyAttachRef(node, node.return);\n break;\n }\n\n case HostComponent:\n {\n safelyAttachRef(node, node.return);\n break;\n }\n }\n}\n\nfunction hideOrUnhideAllChildren(finishedWork, isHidden) {\n // Only hide or unhide the top-most host nodes.\n var hostSubtreeRoot = null;\n\n {\n // We only have the top Fiber that was inserted but we need to recurse down its\n // children to find all the terminal nodes.\n var node = finishedWork;\n\n while (true) {\n if (node.tag === HostComponent) {\n if (hostSubtreeRoot === null) {\n hostSubtreeRoot = node;\n\n try {\n var instance = node.stateNode;\n\n if (isHidden) {\n hideInstance(instance);\n } else {\n unhideInstance(node.stateNode, node.memoizedProps);\n }\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n }\n } else if (node.tag === HostText) {\n if (hostSubtreeRoot === null) {\n try {\n var _instance3 = node.stateNode;\n\n if (isHidden) {\n hideTextInstance(_instance3);\n } else {\n unhideTextInstance(_instance3, node.memoizedProps);\n }\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n }\n } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ; else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === finishedWork) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === finishedWork) {\n return;\n }\n\n if (hostSubtreeRoot === node) {\n hostSubtreeRoot = null;\n }\n\n node = node.return;\n }\n\n if (hostSubtreeRoot === node) {\n hostSubtreeRoot = null;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n }\n}\n\nfunction commitAttachRef(finishedWork) {\n var ref = finishedWork.ref;\n\n if (ref !== null) {\n var instance = finishedWork.stateNode;\n var instanceToUse;\n\n switch (finishedWork.tag) {\n case HostComponent:\n instanceToUse = getPublicInstance(instance);\n break;\n\n default:\n instanceToUse = instance;\n } // Moved outside to ensure DCE works with this flag\n\n if (typeof ref === 'function') {\n var retVal;\n\n if ( finishedWork.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n retVal = ref(instanceToUse);\n } finally {\n recordLayoutEffectDuration(finishedWork);\n }\n } else {\n retVal = ref(instanceToUse);\n }\n\n {\n if (typeof retVal === 'function') {\n error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(finishedWork));\n }\n }\n } else {\n {\n if (!ref.hasOwnProperty('current')) {\n error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentNameFromFiber(finishedWork));\n }\n }\n\n ref.current = instanceToUse;\n }\n }\n}\n\nfunction detachFiberMutation(fiber) {\n // Cut off the return pointer to disconnect it from the tree.\n // This enables us to detect and warn against state updates on an unmounted component.\n // It also prevents events from bubbling from within disconnected components.\n //\n // Ideally, we should also clear the child pointer of the parent alternate to let this\n // get GC:ed but we don't know which for sure which parent is the current\n // one so we'll settle for GC:ing the subtree of this child.\n // This child itself will be GC:ed when the parent updates the next time.\n //\n // Note that we can't clear child or sibling pointers yet.\n // They're needed for passive effects and for findDOMNode.\n // We defer those fields, and all other cleanup, to the passive phase (see detachFiberAfterEffects).\n //\n // Don't reset the alternate yet, either. We need that so we can detach the\n // alternate's fields in the passive phase. Clearing the return pointer is\n // sufficient for findDOMNode semantics.\n var alternate = fiber.alternate;\n\n if (alternate !== null) {\n alternate.return = null;\n }\n\n fiber.return = null;\n}\n\nfunction detachFiberAfterEffects(fiber) {\n var alternate = fiber.alternate;\n\n if (alternate !== null) {\n fiber.alternate = null;\n detachFiberAfterEffects(alternate);\n } // Note: Defensively using negation instead of < in case\n // `deletedTreeCleanUpLevel` is undefined.\n\n\n {\n // Clear cyclical Fiber fields. This level alone is designed to roughly\n // approximate the planned Fiber refactor. In that world, `setState` will be\n // bound to a special \"instance\" object instead of a Fiber. The Instance\n // object will not have any of these fields. It will only be connected to\n // the fiber tree via a single link at the root. So if this level alone is\n // sufficient to fix memory issues, that bodes well for our plans.\n fiber.child = null;\n fiber.deletions = null;\n fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host\n // tree, which has its own pointers to children, parents, and siblings.\n // The other host nodes also point back to fibers, so we should detach that\n // one, too.\n\n if (fiber.tag === HostComponent) {\n var hostInstance = fiber.stateNode;\n\n if (hostInstance !== null) {\n detachDeletedInstance(hostInstance);\n }\n }\n\n fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We\n // already disconnect the `return` pointer at the root of the deleted\n // subtree (in `detachFiberMutation`). Besides, `return` by itself is not\n // cyclical — it's only cyclical when combined with `child`, `sibling`, and\n // `alternate`. But we'll clear it in the next level anyway, just in case.\n\n {\n fiber._debugOwner = null;\n }\n\n {\n // Theoretically, nothing in here should be necessary, because we already\n // disconnected the fiber from the tree. So even if something leaks this\n // particular fiber, it won't leak anything else\n //\n // The purpose of this branch is to be super aggressive so we can measure\n // if there's any difference in memory impact. If there is, that could\n // indicate a React leak we don't know about.\n fiber.return = null;\n fiber.dependencies = null;\n fiber.memoizedProps = null;\n fiber.memoizedState = null;\n fiber.pendingProps = null;\n fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.\n\n fiber.updateQueue = null;\n }\n }\n}\n\nfunction getHostParentFiber(fiber) {\n var parent = fiber.return;\n\n while (parent !== null) {\n if (isHostParent(parent)) {\n return parent;\n }\n\n parent = parent.return;\n }\n\n throw new Error('Expected to find a host parent. This error is likely caused by a bug ' + 'in React. Please file an issue.');\n}\n\nfunction isHostParent(fiber) {\n return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;\n}\n\nfunction getHostSibling(fiber) {\n // We're going to search forward into the tree until we find a sibling host\n // node. Unfortunately, if multiple insertions are done in a row we have to\n // search past them. This leads to exponential search for the next sibling.\n // TODO: Find a more efficient way to do this.\n var node = fiber;\n\n siblings: while (true) {\n // If we didn't find anything, let's try the next sibling.\n while (node.sibling === null) {\n if (node.return === null || isHostParent(node.return)) {\n // If we pop out of the root or hit the parent the fiber we are the\n // last sibling.\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n\n while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {\n // If it is not host node and, we might have a host node inside it.\n // Try to search down until we find one.\n if (node.flags & Placement) {\n // If we don't have a child, try the siblings instead.\n continue siblings;\n } // If we don't have a child, try the siblings instead.\n // We also skip portals because they are not part of this host tree.\n\n\n if (node.child === null || node.tag === HostPortal) {\n continue siblings;\n } else {\n node.child.return = node;\n node = node.child;\n }\n } // Check if this host node is stable or about to be placed.\n\n\n if (!(node.flags & Placement)) {\n // Found it!\n return node.stateNode;\n }\n }\n}\n\nfunction commitPlacement(finishedWork) {\n\n\n var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.\n\n switch (parentFiber.tag) {\n case HostComponent:\n {\n var parent = parentFiber.stateNode;\n\n if (parentFiber.flags & ContentReset) {\n // Reset the text content of the parent before doing any insertions\n resetTextContent(parent); // Clear ContentReset from the effect tag\n\n parentFiber.flags &= ~ContentReset;\n }\n\n var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its\n // children to find all the terminal nodes.\n\n insertOrAppendPlacementNode(finishedWork, before, parent);\n break;\n }\n\n case HostRoot:\n case HostPortal:\n {\n var _parent = parentFiber.stateNode.containerInfo;\n\n var _before = getHostSibling(finishedWork);\n\n insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);\n break;\n }\n // eslint-disable-next-line-no-fallthrough\n\n default:\n throw new Error('Invalid host parent fiber. This error is likely caused by a bug ' + 'in React. Please file an issue.');\n }\n}\n\nfunction insertOrAppendPlacementNodeIntoContainer(node, before, parent) {\n var tag = node.tag;\n var isHost = tag === HostComponent || tag === HostText;\n\n if (isHost) {\n var stateNode = node.stateNode;\n\n if (before) {\n insertInContainerBefore(parent, stateNode, before);\n } else {\n appendChildToContainer(parent, stateNode);\n }\n } else if (tag === HostPortal) ; else {\n var child = node.child;\n\n if (child !== null) {\n insertOrAppendPlacementNodeIntoContainer(child, before, parent);\n var sibling = child.sibling;\n\n while (sibling !== null) {\n insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);\n sibling = sibling.sibling;\n }\n }\n }\n}\n\nfunction insertOrAppendPlacementNode(node, before, parent) {\n var tag = node.tag;\n var isHost = tag === HostComponent || tag === HostText;\n\n if (isHost) {\n var stateNode = node.stateNode;\n\n if (before) {\n insertBefore(parent, stateNode, before);\n } else {\n appendChild(parent, stateNode);\n }\n } else if (tag === HostPortal) ; else {\n var child = node.child;\n\n if (child !== null) {\n insertOrAppendPlacementNode(child, before, parent);\n var sibling = child.sibling;\n\n while (sibling !== null) {\n insertOrAppendPlacementNode(sibling, before, parent);\n sibling = sibling.sibling;\n }\n }\n }\n} // These are tracked on the stack as we recursively traverse a\n// deleted subtree.\n// TODO: Update these during the whole mutation phase, not just during\n// a deletion.\n\n\nvar hostParent = null;\nvar hostParentIsContainer = false;\n\nfunction commitDeletionEffects(root, returnFiber, deletedFiber) {\n {\n // We only have the top Fiber that was deleted but we need to recurse down its\n // children to find all the terminal nodes.\n // Recursively delete all host nodes from the parent, detach refs, clean\n // up mounted layout effects, and call componentWillUnmount.\n // We only need to remove the topmost host child in each branch. But then we\n // still need to keep traversing to unmount effects, refs, and cWU. TODO: We\n // could split this into two separate traversals functions, where the second\n // one doesn't include any removeChild logic. This is maybe the same\n // function as \"disappearLayoutEffects\" (or whatever that turns into after\n // the layout phase is refactored to use recursion).\n // Before starting, find the nearest host parent on the stack so we know\n // which instance/container to remove the children from.\n // TODO: Instead of searching up the fiber return path on every deletion, we\n // can track the nearest host component on the JS stack as we traverse the\n // tree during the commit phase. This would make insertions faster, too.\n var parent = returnFiber;\n\n findParent: while (parent !== null) {\n switch (parent.tag) {\n case HostComponent:\n {\n hostParent = parent.stateNode;\n hostParentIsContainer = false;\n break findParent;\n }\n\n case HostRoot:\n {\n hostParent = parent.stateNode.containerInfo;\n hostParentIsContainer = true;\n break findParent;\n }\n\n case HostPortal:\n {\n hostParent = parent.stateNode.containerInfo;\n hostParentIsContainer = true;\n break findParent;\n }\n }\n\n parent = parent.return;\n }\n\n if (hostParent === null) {\n throw new Error('Expected to find a host parent. This error is likely caused by ' + 'a bug in React. Please file an issue.');\n }\n\n commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber);\n hostParent = null;\n hostParentIsContainer = false;\n }\n\n detachFiberMutation(deletedFiber);\n}\n\nfunction recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {\n // TODO: Use a static flag to skip trees that don't have unmount effects\n var child = parent.child;\n\n while (child !== null) {\n commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child);\n child = child.sibling;\n }\n}\n\nfunction commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {\n onCommitUnmount(deletedFiber); // The cases in this outer switch modify the stack before they traverse\n // into their subtree. There are simpler cases in the inner switch\n // that don't modify the stack.\n\n switch (deletedFiber.tag) {\n case HostComponent:\n {\n if (!offscreenSubtreeWasHidden) {\n safelyDetachRef(deletedFiber, nearestMountedAncestor);\n } // Intentional fallthrough to next branch\n\n }\n // eslint-disable-next-line-no-fallthrough\n\n case HostText:\n {\n // We only need to remove the nearest host child. Set the host parent\n // to `null` on the stack to indicate that nested children don't\n // need to be removed.\n {\n var prevHostParent = hostParent;\n var prevHostParentIsContainer = hostParentIsContainer;\n hostParent = null;\n recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);\n hostParent = prevHostParent;\n hostParentIsContainer = prevHostParentIsContainer;\n\n if (hostParent !== null) {\n // Now that all the child effects have unmounted, we can remove the\n // node from the tree.\n if (hostParentIsContainer) {\n removeChildFromContainer(hostParent, deletedFiber.stateNode);\n } else {\n removeChild(hostParent, deletedFiber.stateNode);\n }\n }\n }\n\n return;\n }\n\n case DehydratedFragment:\n {\n // Delete the dehydrated suspense boundary and all of its content.\n\n\n {\n if (hostParent !== null) {\n if (hostParentIsContainer) {\n clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode);\n } else {\n clearSuspenseBoundary(hostParent, deletedFiber.stateNode);\n }\n }\n }\n\n return;\n }\n\n case HostPortal:\n {\n {\n // When we go into a portal, it becomes the parent to remove from.\n var _prevHostParent = hostParent;\n var _prevHostParentIsContainer = hostParentIsContainer;\n hostParent = deletedFiber.stateNode.containerInfo;\n hostParentIsContainer = true;\n recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);\n hostParent = _prevHostParent;\n hostParentIsContainer = _prevHostParentIsContainer;\n }\n\n return;\n }\n\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n {\n if (!offscreenSubtreeWasHidden) {\n var updateQueue = deletedFiber.updateQueue;\n\n if (updateQueue !== null) {\n var lastEffect = updateQueue.lastEffect;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n var _effect = effect,\n destroy = _effect.destroy,\n tag = _effect.tag;\n\n if (destroy !== undefined) {\n if ((tag & Insertion) !== NoFlags$1) {\n safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);\n } else if ((tag & Layout) !== NoFlags$1) {\n {\n markComponentLayoutEffectUnmountStarted(deletedFiber);\n }\n\n if ( deletedFiber.mode & ProfileMode) {\n startLayoutEffectTimer();\n safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);\n recordLayoutEffectDuration(deletedFiber);\n } else {\n safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);\n }\n\n {\n markComponentLayoutEffectUnmountStopped();\n }\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n }\n }\n\n recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);\n return;\n }\n\n case ClassComponent:\n {\n if (!offscreenSubtreeWasHidden) {\n safelyDetachRef(deletedFiber, nearestMountedAncestor);\n var instance = deletedFiber.stateNode;\n\n if (typeof instance.componentWillUnmount === 'function') {\n safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance);\n }\n }\n\n recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);\n return;\n }\n\n case ScopeComponent:\n {\n\n recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);\n return;\n }\n\n case OffscreenComponent:\n {\n if ( // TODO: Remove this dead flag\n deletedFiber.mode & ConcurrentMode) {\n // If this offscreen component is hidden, we already unmounted it. Before\n // deleting the children, track that it's already unmounted so that we\n // don't attempt to unmount the effects again.\n // TODO: If the tree is hidden, in most cases we should be able to skip\n // over the nested children entirely. An exception is we haven't yet found\n // the topmost host node to delete, which we already track on the stack.\n // But the other case is portals, which need to be detached no matter how\n // deeply they are nested. We should use a subtree flag to track whether a\n // subtree includes a nested portal.\n var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;\n offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null;\n recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);\n offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;\n } else {\n recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);\n }\n\n break;\n }\n\n default:\n {\n recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);\n return;\n }\n }\n}\n\nfunction commitSuspenseCallback(finishedWork) {\n // TODO: Move this to passive phase\n var newState = finishedWork.memoizedState;\n}\n\nfunction commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {\n\n var newState = finishedWork.memoizedState;\n\n if (newState === null) {\n var current = finishedWork.alternate;\n\n if (current !== null) {\n var prevState = current.memoizedState;\n\n if (prevState !== null) {\n var suspenseInstance = prevState.dehydrated;\n\n if (suspenseInstance !== null) {\n commitHydratedSuspenseInstance(suspenseInstance);\n }\n }\n }\n }\n}\n\nfunction attachSuspenseRetryListeners(finishedWork) {\n // If this boundary just timed out, then it will have a set of wakeables.\n // For each wakeable, attach a listener so that when it resolves, React\n // attempts to re-render the boundary in the primary (pre-timeout) state.\n var wakeables = finishedWork.updateQueue;\n\n if (wakeables !== null) {\n finishedWork.updateQueue = null;\n var retryCache = finishedWork.stateNode;\n\n if (retryCache === null) {\n retryCache = finishedWork.stateNode = new PossiblyWeakSet();\n }\n\n wakeables.forEach(function (wakeable) {\n // Memoize using the boundary fiber to prevent redundant listeners.\n var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);\n\n if (!retryCache.has(wakeable)) {\n retryCache.add(wakeable);\n\n {\n if (isDevToolsPresent) {\n if (inProgressLanes !== null && inProgressRoot !== null) {\n // If we have pending work still, associate the original updaters with it.\n restorePendingUpdaters(inProgressRoot, inProgressLanes);\n } else {\n throw Error('Expected finished root and lanes to be set. This is a bug in React.');\n }\n }\n }\n\n wakeable.then(retry, retry);\n }\n });\n }\n} // This function detects when a Suspense boundary goes from visible to hidden.\nfunction commitMutationEffects(root, finishedWork, committedLanes) {\n inProgressLanes = committedLanes;\n inProgressRoot = root;\n setCurrentFiber(finishedWork);\n commitMutationEffectsOnFiber(finishedWork, root);\n setCurrentFiber(finishedWork);\n inProgressLanes = null;\n inProgressRoot = null;\n}\n\nfunction recursivelyTraverseMutationEffects(root, parentFiber, lanes) {\n // Deletions effects can be scheduled on any fiber type. They need to happen\n // before the children effects hae fired.\n var deletions = parentFiber.deletions;\n\n if (deletions !== null) {\n for (var i = 0; i < deletions.length; i++) {\n var childToDelete = deletions[i];\n\n try {\n commitDeletionEffects(root, parentFiber, childToDelete);\n } catch (error) {\n captureCommitPhaseError(childToDelete, parentFiber, error);\n }\n }\n }\n\n var prevDebugFiber = getCurrentFiber();\n\n if (parentFiber.subtreeFlags & MutationMask) {\n var child = parentFiber.child;\n\n while (child !== null) {\n setCurrentFiber(child);\n commitMutationEffectsOnFiber(child, root);\n child = child.sibling;\n }\n }\n\n setCurrentFiber(prevDebugFiber);\n}\n\nfunction commitMutationEffectsOnFiber(finishedWork, root, lanes) {\n var current = finishedWork.alternate;\n var flags = finishedWork.flags; // The effect flag should be checked *after* we refine the type of fiber,\n // because the fiber tag is more specific. An exception is any flag related\n // to reconcilation, because those can be set on all fiber types.\n\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n\n if (flags & Update) {\n try {\n commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return);\n commitHookEffectListMount(Insertion | HasEffect, finishedWork);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n } // Layout effects are destroyed during the mutation phase so that all\n // destroy functions for all fibers are called before any create functions.\n // This prevents sibling component effects from interfering with each other,\n // e.g. a destroy function in one component should never override a ref set\n // by a create function in another component during the same commit.\n\n\n if ( finishedWork.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n\n recordLayoutEffectDuration(finishedWork);\n } else {\n try {\n commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n }\n }\n\n return;\n }\n\n case ClassComponent:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n\n if (flags & Ref) {\n if (current !== null) {\n safelyDetachRef(current, current.return);\n }\n }\n\n return;\n }\n\n case HostComponent:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n\n if (flags & Ref) {\n if (current !== null) {\n safelyDetachRef(current, current.return);\n }\n }\n\n {\n // TODO: ContentReset gets cleared by the children during the commit\n // phase. This is a refactor hazard because it means we must read\n // flags the flags after `commitReconciliationEffects` has already run;\n // the order matters. We should refactor so that ContentReset does not\n // rely on mutating the flag during commit. Like by setting a flag\n // during the render phase instead.\n if (finishedWork.flags & ContentReset) {\n var instance = finishedWork.stateNode;\n\n try {\n resetTextContent(instance);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n }\n\n if (flags & Update) {\n var _instance4 = finishedWork.stateNode;\n\n if (_instance4 != null) {\n // Commit the work prepared earlier.\n var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n // as the newProps. The updatePayload will contain the real change in\n // this case.\n\n var oldProps = current !== null ? current.memoizedProps : newProps;\n var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.\n\n var updatePayload = finishedWork.updateQueue;\n finishedWork.updateQueue = null;\n\n if (updatePayload !== null) {\n try {\n commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n }\n }\n }\n }\n\n return;\n }\n\n case HostText:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n\n if (flags & Update) {\n {\n if (finishedWork.stateNode === null) {\n throw new Error('This should have a text node initialized. This error is likely ' + 'caused by a bug in React. Please file an issue.');\n }\n\n var textInstance = finishedWork.stateNode;\n var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n // as the newProps. The updatePayload will contain the real change in\n // this case.\n\n var oldText = current !== null ? current.memoizedProps : newText;\n\n try {\n commitTextUpdate(textInstance, oldText, newText);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n }\n }\n\n return;\n }\n\n case HostRoot:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n\n if (flags & Update) {\n {\n if (current !== null) {\n var prevRootState = current.memoizedState;\n\n if (prevRootState.isDehydrated) {\n try {\n commitHydratedContainer(root.containerInfo);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n }\n }\n }\n }\n\n return;\n }\n\n case HostPortal:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n\n return;\n }\n\n case SuspenseComponent:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n var offscreenFiber = finishedWork.child;\n\n if (offscreenFiber.flags & Visibility) {\n var offscreenInstance = offscreenFiber.stateNode;\n var newState = offscreenFiber.memoizedState;\n var isHidden = newState !== null; // Track the current state on the Offscreen instance so we can\n // read it during an event\n\n offscreenInstance.isHidden = isHidden;\n\n if (isHidden) {\n var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null;\n\n if (!wasHidden) {\n // TODO: Move to passive phase\n markCommitTimeOfFallback();\n }\n }\n }\n\n if (flags & Update) {\n try {\n commitSuspenseCallback(finishedWork);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n }\n\n attachSuspenseRetryListeners(finishedWork);\n }\n\n return;\n }\n\n case OffscreenComponent:\n {\n var _wasHidden = current !== null && current.memoizedState !== null;\n\n if ( // TODO: Remove this dead flag\n finishedWork.mode & ConcurrentMode) {\n // Before committing the children, track on the stack whether this\n // offscreen subtree was already hidden, so that we don't unmount the\n // effects again.\n var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;\n offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden;\n recursivelyTraverseMutationEffects(root, finishedWork);\n offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;\n } else {\n recursivelyTraverseMutationEffects(root, finishedWork);\n }\n\n commitReconciliationEffects(finishedWork);\n\n if (flags & Visibility) {\n var _offscreenInstance = finishedWork.stateNode;\n var _newState = finishedWork.memoizedState;\n\n var _isHidden = _newState !== null;\n\n var offscreenBoundary = finishedWork; // Track the current state on the Offscreen instance so we can\n // read it during an event\n\n _offscreenInstance.isHidden = _isHidden;\n\n {\n if (_isHidden) {\n if (!_wasHidden) {\n if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {\n nextEffect = offscreenBoundary;\n var offscreenChild = offscreenBoundary.child;\n\n while (offscreenChild !== null) {\n nextEffect = offscreenChild;\n disappearLayoutEffects_begin(offscreenChild);\n offscreenChild = offscreenChild.sibling;\n }\n }\n }\n }\n }\n\n {\n // TODO: This needs to run whenever there's an insertion or update\n // inside a hidden Offscreen tree.\n hideOrUnhideAllChildren(offscreenBoundary, _isHidden);\n }\n }\n\n return;\n }\n\n case SuspenseListComponent:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n\n if (flags & Update) {\n attachSuspenseRetryListeners(finishedWork);\n }\n\n return;\n }\n\n case ScopeComponent:\n {\n\n return;\n }\n\n default:\n {\n recursivelyTraverseMutationEffects(root, finishedWork);\n commitReconciliationEffects(finishedWork);\n return;\n }\n }\n}\n\nfunction commitReconciliationEffects(finishedWork) {\n // Placement effects (insertions, reorders) can be scheduled on any fiber\n // type. They needs to happen after the children effects have fired, but\n // before the effects on this fiber have fired.\n var flags = finishedWork.flags;\n\n if (flags & Placement) {\n try {\n commitPlacement(finishedWork);\n } catch (error) {\n captureCommitPhaseError(finishedWork, finishedWork.return, error);\n } // Clear the \"placement\" from effect tag so that we know that this is\n // inserted, before any life-cycles like componentDidMount gets called.\n // TODO: findDOMNode doesn't rely on this any more but isMounted does\n // and isMounted is deprecated anyway so we should be able to kill this.\n\n\n finishedWork.flags &= ~Placement;\n }\n\n if (flags & Hydrating) {\n finishedWork.flags &= ~Hydrating;\n }\n}\n\nfunction commitLayoutEffects(finishedWork, root, committedLanes) {\n inProgressLanes = committedLanes;\n inProgressRoot = root;\n nextEffect = finishedWork;\n commitLayoutEffects_begin(finishedWork, root, committedLanes);\n inProgressLanes = null;\n inProgressRoot = null;\n}\n\nfunction commitLayoutEffects_begin(subtreeRoot, root, committedLanes) {\n // Suspense layout effects semantics don't change for legacy roots.\n var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode;\n\n while (nextEffect !== null) {\n var fiber = nextEffect;\n var firstChild = fiber.child;\n\n if ( fiber.tag === OffscreenComponent && isModernRoot) {\n // Keep track of the current Offscreen stack's state.\n var isHidden = fiber.memoizedState !== null;\n var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;\n\n if (newOffscreenSubtreeIsHidden) {\n // The Offscreen tree is hidden. Skip over its layout effects.\n commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes);\n continue;\n } else {\n // TODO (Offscreen) Also check: subtreeFlags & LayoutMask\n var current = fiber.alternate;\n var wasHidden = current !== null && current.memoizedState !== null;\n var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;\n var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;\n var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; // Traverse the Offscreen subtree with the current Offscreen as the root.\n\n offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;\n offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;\n\n if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {\n // This is the root of a reappearing boundary. Turn its layout effects\n // back on.\n nextEffect = fiber;\n reappearLayoutEffects_begin(fiber);\n }\n\n var child = firstChild;\n\n while (child !== null) {\n nextEffect = child;\n commitLayoutEffects_begin(child, // New root; bubble back up to here and stop.\n root, committedLanes);\n child = child.sibling;\n } // Restore Offscreen state and resume in our-progress traversal.\n\n\n nextEffect = fiber;\n offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;\n offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;\n commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes);\n continue;\n }\n }\n\n if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {\n firstChild.return = fiber;\n nextEffect = firstChild;\n } else {\n commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes);\n }\n }\n}\n\nfunction commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n\n if ((fiber.flags & LayoutMask) !== NoFlags) {\n var current = fiber.alternate;\n setCurrentFiber(fiber);\n\n try {\n commitLayoutEffectOnFiber(root, current, fiber, committedLanes);\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n\n resetCurrentFiber();\n }\n\n if (fiber === subtreeRoot) {\n nextEffect = null;\n return;\n }\n\n var sibling = fiber.sibling;\n\n if (sibling !== null) {\n sibling.return = fiber.return;\n nextEffect = sibling;\n return;\n }\n\n nextEffect = fiber.return;\n }\n}\n\nfunction disappearLayoutEffects_begin(subtreeRoot) {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n var firstChild = fiber.child; // TODO (Offscreen) Check: flags & (RefStatic | LayoutStatic)\n\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n {\n if ( fiber.mode & ProfileMode) {\n try {\n startLayoutEffectTimer();\n commitHookEffectListUnmount(Layout, fiber, fiber.return);\n } finally {\n recordLayoutEffectDuration(fiber);\n }\n } else {\n commitHookEffectListUnmount(Layout, fiber, fiber.return);\n }\n\n break;\n }\n\n case ClassComponent:\n {\n // TODO (Offscreen) Check: flags & RefStatic\n safelyDetachRef(fiber, fiber.return);\n var instance = fiber.stateNode;\n\n if (typeof instance.componentWillUnmount === 'function') {\n safelyCallComponentWillUnmount(fiber, fiber.return, instance);\n }\n\n break;\n }\n\n case HostComponent:\n {\n safelyDetachRef(fiber, fiber.return);\n break;\n }\n\n case OffscreenComponent:\n {\n // Check if this is a\n var isHidden = fiber.memoizedState !== null;\n\n if (isHidden) {\n // Nested Offscreen tree is already hidden. Don't disappear\n // its effects.\n disappearLayoutEffects_complete(subtreeRoot);\n continue;\n }\n\n break;\n }\n } // TODO (Offscreen) Check: subtreeFlags & LayoutStatic\n\n\n if (firstChild !== null) {\n firstChild.return = fiber;\n nextEffect = firstChild;\n } else {\n disappearLayoutEffects_complete(subtreeRoot);\n }\n }\n}\n\nfunction disappearLayoutEffects_complete(subtreeRoot) {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n\n if (fiber === subtreeRoot) {\n nextEffect = null;\n return;\n }\n\n var sibling = fiber.sibling;\n\n if (sibling !== null) {\n sibling.return = fiber.return;\n nextEffect = sibling;\n return;\n }\n\n nextEffect = fiber.return;\n }\n}\n\nfunction reappearLayoutEffects_begin(subtreeRoot) {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n var firstChild = fiber.child;\n\n if (fiber.tag === OffscreenComponent) {\n var isHidden = fiber.memoizedState !== null;\n\n if (isHidden) {\n // Nested Offscreen tree is still hidden. Don't re-appear its effects.\n reappearLayoutEffects_complete(subtreeRoot);\n continue;\n }\n } // TODO (Offscreen) Check: subtreeFlags & LayoutStatic\n\n\n if (firstChild !== null) {\n // This node may have been reused from a previous render, so we can't\n // assume its return pointer is correct.\n firstChild.return = fiber;\n nextEffect = firstChild;\n } else {\n reappearLayoutEffects_complete(subtreeRoot);\n }\n }\n}\n\nfunction reappearLayoutEffects_complete(subtreeRoot) {\n while (nextEffect !== null) {\n var fiber = nextEffect; // TODO (Offscreen) Check: flags & LayoutStatic\n\n setCurrentFiber(fiber);\n\n try {\n reappearLayoutEffectsOnFiber(fiber);\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n\n resetCurrentFiber();\n\n if (fiber === subtreeRoot) {\n nextEffect = null;\n return;\n }\n\n var sibling = fiber.sibling;\n\n if (sibling !== null) {\n // This node may have been reused from a previous render, so we can't\n // assume its return pointer is correct.\n sibling.return = fiber.return;\n nextEffect = sibling;\n return;\n }\n\n nextEffect = fiber.return;\n }\n}\n\nfunction commitPassiveMountEffects(root, finishedWork, committedLanes, committedTransitions) {\n nextEffect = finishedWork;\n commitPassiveMountEffects_begin(finishedWork, root, committedLanes, committedTransitions);\n}\n\nfunction commitPassiveMountEffects_begin(subtreeRoot, root, committedLanes, committedTransitions) {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n var firstChild = fiber.child;\n\n if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) {\n firstChild.return = fiber;\n nextEffect = firstChild;\n } else {\n commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions);\n }\n }\n}\n\nfunction commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions) {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n\n if ((fiber.flags & Passive) !== NoFlags) {\n setCurrentFiber(fiber);\n\n try {\n commitPassiveMountOnFiber(root, fiber, committedLanes, committedTransitions);\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n\n resetCurrentFiber();\n }\n\n if (fiber === subtreeRoot) {\n nextEffect = null;\n return;\n }\n\n var sibling = fiber.sibling;\n\n if (sibling !== null) {\n sibling.return = fiber.return;\n nextEffect = sibling;\n return;\n }\n\n nextEffect = fiber.return;\n }\n}\n\nfunction commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n if ( finishedWork.mode & ProfileMode) {\n startPassiveEffectTimer();\n\n try {\n commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);\n } finally {\n recordPassiveEffectDuration(finishedWork);\n }\n } else {\n commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);\n }\n\n break;\n }\n }\n}\n\nfunction commitPassiveUnmountEffects(firstChild) {\n nextEffect = firstChild;\n commitPassiveUnmountEffects_begin();\n}\n\nfunction commitPassiveUnmountEffects_begin() {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n var child = fiber.child;\n\n if ((nextEffect.flags & ChildDeletion) !== NoFlags) {\n var deletions = fiber.deletions;\n\n if (deletions !== null) {\n for (var i = 0; i < deletions.length; i++) {\n var fiberToDelete = deletions[i];\n nextEffect = fiberToDelete;\n commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);\n }\n\n {\n // A fiber was deleted from this parent fiber, but it's still part of\n // the previous (alternate) parent fiber's list of children. Because\n // children are a linked list, an earlier sibling that's still alive\n // will be connected to the deleted fiber via its `alternate`:\n //\n // live fiber\n // --alternate--> previous live fiber\n // --sibling--> deleted fiber\n //\n // We can't disconnect `alternate` on nodes that haven't been deleted\n // yet, but we can disconnect the `sibling` and `child` pointers.\n var previousFiber = fiber.alternate;\n\n if (previousFiber !== null) {\n var detachedChild = previousFiber.child;\n\n if (detachedChild !== null) {\n previousFiber.child = null;\n\n do {\n var detachedSibling = detachedChild.sibling;\n detachedChild.sibling = null;\n detachedChild = detachedSibling;\n } while (detachedChild !== null);\n }\n }\n }\n\n nextEffect = fiber;\n }\n }\n\n if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {\n child.return = fiber;\n nextEffect = child;\n } else {\n commitPassiveUnmountEffects_complete();\n }\n }\n}\n\nfunction commitPassiveUnmountEffects_complete() {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n\n if ((fiber.flags & Passive) !== NoFlags) {\n setCurrentFiber(fiber);\n commitPassiveUnmountOnFiber(fiber);\n resetCurrentFiber();\n }\n\n var sibling = fiber.sibling;\n\n if (sibling !== null) {\n sibling.return = fiber.return;\n nextEffect = sibling;\n return;\n }\n\n nextEffect = fiber.return;\n }\n}\n\nfunction commitPassiveUnmountOnFiber(finishedWork) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n if ( finishedWork.mode & ProfileMode) {\n startPassiveEffectTimer();\n commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);\n recordPassiveEffectDuration(finishedWork);\n } else {\n commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);\n }\n\n break;\n }\n }\n}\n\nfunction commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {\n while (nextEffect !== null) {\n var fiber = nextEffect; // Deletion effects fire in parent -> child order\n // TODO: Check if fiber has a PassiveStatic flag\n\n setCurrentFiber(fiber);\n commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);\n resetCurrentFiber();\n var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we\n // do this, still need to handle `deletedTreeCleanUpLevel` correctly.)\n\n if (child !== null) {\n child.return = fiber;\n nextEffect = child;\n } else {\n commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);\n }\n }\n}\n\nfunction commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) {\n while (nextEffect !== null) {\n var fiber = nextEffect;\n var sibling = fiber.sibling;\n var returnFiber = fiber.return;\n\n {\n // Recursively traverse the entire deleted tree and clean up fiber fields.\n // This is more aggressive than ideal, and the long term goal is to only\n // have to detach the deleted tree at the root.\n detachFiberAfterEffects(fiber);\n\n if (fiber === deletedSubtreeRoot) {\n nextEffect = null;\n return;\n }\n }\n\n if (sibling !== null) {\n sibling.return = returnFiber;\n nextEffect = sibling;\n return;\n }\n\n nextEffect = returnFiber;\n }\n}\n\nfunction commitPassiveUnmountInsideDeletedTreeOnFiber(current, nearestMountedAncestor) {\n switch (current.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n if ( current.mode & ProfileMode) {\n startPassiveEffectTimer();\n commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor);\n recordPassiveEffectDuration(current);\n } else {\n commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor);\n }\n\n break;\n }\n }\n} // TODO: Reuse reappearLayoutEffects traversal here?\n\n\nfunction invokeLayoutEffectMountInDEV(fiber) {\n {\n // We don't need to re-check StrictEffectsMode here.\n // This function is only called if that check has already passed.\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n try {\n commitHookEffectListMount(Layout | HasEffect, fiber);\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n\n break;\n }\n\n case ClassComponent:\n {\n var instance = fiber.stateNode;\n\n try {\n instance.componentDidMount();\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n\n break;\n }\n }\n }\n}\n\nfunction invokePassiveEffectMountInDEV(fiber) {\n {\n // We don't need to re-check StrictEffectsMode here.\n // This function is only called if that check has already passed.\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n try {\n commitHookEffectListMount(Passive$1 | HasEffect, fiber);\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n\n break;\n }\n }\n }\n}\n\nfunction invokeLayoutEffectUnmountInDEV(fiber) {\n {\n // We don't need to re-check StrictEffectsMode here.\n // This function is only called if that check has already passed.\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n try {\n commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return);\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n\n break;\n }\n\n case ClassComponent:\n {\n var instance = fiber.stateNode;\n\n if (typeof instance.componentWillUnmount === 'function') {\n safelyCallComponentWillUnmount(fiber, fiber.return, instance);\n }\n\n break;\n }\n }\n }\n}\n\nfunction invokePassiveEffectUnmountInDEV(fiber) {\n {\n // We don't need to re-check StrictEffectsMode here.\n // This function is only called if that check has already passed.\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n try {\n commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return);\n } catch (error) {\n captureCommitPhaseError(fiber, fiber.return, error);\n }\n }\n }\n }\n}\n\nvar COMPONENT_TYPE = 0;\nvar HAS_PSEUDO_CLASS_TYPE = 1;\nvar ROLE_TYPE = 2;\nvar TEST_NAME_TYPE = 3;\nvar TEXT_TYPE = 4;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n var symbolFor = Symbol.for;\n COMPONENT_TYPE = symbolFor('selector.component');\n HAS_PSEUDO_CLASS_TYPE = symbolFor('selector.has_pseudo_class');\n ROLE_TYPE = symbolFor('selector.role');\n TEST_NAME_TYPE = symbolFor('selector.test_id');\n TEXT_TYPE = symbolFor('selector.text');\n}\nvar commitHooks = [];\nfunction onCommitRoot$1() {\n {\n commitHooks.forEach(function (commitHook) {\n return commitHook();\n });\n }\n}\n\nvar ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;\nfunction isLegacyActEnvironment(fiber) {\n {\n // Legacy mode. We preserve the behavior of React 17's act. It assumes an\n // act environment whenever `jest` is defined, but you can still turn off\n // spurious warnings by setting IS_REACT_ACT_ENVIRONMENT explicitly\n // to false.\n var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global\n typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined' ? IS_REACT_ACT_ENVIRONMENT : undefined; // $FlowExpectedError - Flow doesn't know about jest\n\n var jestIsDefined = typeof jest !== 'undefined';\n return jestIsDefined && isReactActEnvironmentGlobal !== false;\n }\n}\nfunction isConcurrentActEnvironment() {\n {\n var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global\n typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined' ? IS_REACT_ACT_ENVIRONMENT : undefined;\n\n if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {\n // TODO: Include link to relevant documentation page.\n error('The current testing environment is not configured to support ' + 'act(...)');\n }\n\n return isReactActEnvironmentGlobal;\n }\n}\n\nvar ceil = Math.ceil;\nvar ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher,\n ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,\n ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig,\n ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;\nvar NoContext =\n/* */\n0;\nvar BatchedContext =\n/* */\n1;\nvar RenderContext =\n/* */\n2;\nvar CommitContext =\n/* */\n4;\nvar RootInProgress = 0;\nvar RootFatalErrored = 1;\nvar RootErrored = 2;\nvar RootSuspended = 3;\nvar RootSuspendedWithDelay = 4;\nvar RootCompleted = 5;\nvar RootDidNotComplete = 6; // Describes where we are in the React execution stack\n\nvar executionContext = NoContext; // The root we're working on\n\nvar workInProgressRoot = null; // The fiber we're working on\n\nvar workInProgress = null; // The lanes we're rendering\n\nvar workInProgressRootRenderLanes = NoLanes; // Stack that allows components to change the render lanes for its subtree\n// This is a superset of the lanes we started working on at the root. The only\n// case where it's different from `workInProgressRootRenderLanes` is when we\n// enter a subtree that is hidden and needs to be unhidden: Suspense and\n// Offscreen component.\n//\n// Most things in the work loop should deal with workInProgressRootRenderLanes.\n// Most things in begin/complete phases should deal with subtreeRenderLanes.\n\nvar subtreeRenderLanes = NoLanes;\nvar subtreeRenderLanesCursor = createCursor(NoLanes); // Whether to root completed, errored, suspended, etc.\n\nvar workInProgressRootExitStatus = RootInProgress; // A fatal error, if one is thrown\n\nvar workInProgressRootFatalError = null; // \"Included\" lanes refer to lanes that were worked on during this render. It's\n// slightly different than `renderLanes` because `renderLanes` can change as you\n// enter and exit an Offscreen tree. This value is the combination of all render\n// lanes for the entire render phase.\n\nvar workInProgressRootIncludedLanes = NoLanes; // The work left over by components that were visited during this render. Only\n// includes unprocessed updates, not work in bailed out children.\n\nvar workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render.\n\nvar workInProgressRootInterleavedUpdatedLanes = NoLanes; // Lanes that were updated during the render phase (*not* an interleaved event).\n\nvar workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during the render phase.\n\nvar workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI.\n// We will log them once the tree commits.\n\nvar workInProgressRootRecoverableErrors = null; // The most recent time we committed a fallback. This lets us ensure a train\n// model where we don't commit new loading states in too quick succession.\n\nvar globalMostRecentFallbackTime = 0;\nvar FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering\n// more and prefer CPU suspense heuristics instead.\n\nvar workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU\n// suspense heuristics and opt out of rendering more content.\n\nvar RENDER_TIMEOUT_MS = 500;\nvar workInProgressTransitions = null;\n\nfunction resetRenderTimer() {\n workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;\n}\n\nfunction getRenderTargetTime() {\n return workInProgressRootRenderTargetTime;\n}\nvar hasUncaughtError = false;\nvar firstUncaughtError = null;\nvar legacyErrorBoundariesThatAlreadyFailed = null; // Only used when enableProfilerNestedUpdateScheduledHook is true;\nvar rootDoesHavePassiveEffects = false;\nvar rootWithPendingPassiveEffects = null;\nvar pendingPassiveEffectsLanes = NoLanes;\nvar pendingPassiveProfilerEffects = [];\nvar pendingPassiveTransitions = null; // Use these to prevent an infinite loop of nested updates\n\nvar NESTED_UPDATE_LIMIT = 50;\nvar nestedUpdateCount = 0;\nvar rootWithNestedUpdates = null;\nvar isFlushingPassiveEffects = false;\nvar didScheduleUpdateDuringPassiveEffects = false;\nvar NESTED_PASSIVE_UPDATE_LIMIT = 50;\nvar nestedPassiveUpdateCount = 0;\nvar rootWithPassiveNestedUpdates = null; // If two updates are scheduled within the same event, we should treat their\n// event times as simultaneous, even if the actual clock time has advanced\n// between the first and second call.\n\nvar currentEventTime = NoTimestamp;\nvar currentEventTransitionLane = NoLanes;\nvar isRunningInsertionEffect = false;\nfunction getWorkInProgressRoot() {\n return workInProgressRoot;\n}\nfunction requestEventTime() {\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n // We're inside React, so it's fine to read the actual time.\n return now();\n } // We're not inside React, so we may be in the middle of a browser event.\n\n\n if (currentEventTime !== NoTimestamp) {\n // Use the same start time for all updates until we enter React again.\n return currentEventTime;\n } // This is the first update since React yielded. Compute a new start time.\n\n\n currentEventTime = now();\n return currentEventTime;\n}\nfunction requestUpdateLane(fiber) {\n // Special cases\n var mode = fiber.mode;\n\n if ((mode & ConcurrentMode) === NoMode) {\n return SyncLane;\n } else if ( (executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) {\n // This is a render phase update. These are not officially supported. The\n // old behavior is to give this the same \"thread\" (lanes) as\n // whatever is currently rendering. So if you call `setState` on a component\n // that happens later in the same render, it will flush. Ideally, we want to\n // remove the special case and treat them as if they came from an\n // interleaved event. Regardless, this pattern is not officially supported.\n // This behavior is only a fallback. The flag only exists until we can roll\n // out the setState warning, since existing code might accidentally rely on\n // the current behavior.\n return pickArbitraryLane(workInProgressRootRenderLanes);\n }\n\n var isTransition = requestCurrentTransition() !== NoTransition;\n\n if (isTransition) {\n if ( ReactCurrentBatchConfig$3.transition !== null) {\n var transition = ReactCurrentBatchConfig$3.transition;\n\n if (!transition._updatedFibers) {\n transition._updatedFibers = new Set();\n }\n\n transition._updatedFibers.add(fiber);\n } // The algorithm for assigning an update to a lane should be stable for all\n // updates at the same priority within the same event. To do this, the\n // inputs to the algorithm must be the same.\n //\n // The trick we use is to cache the first of each of these inputs within an\n // event. Then reset the cached values once we can be sure the event is\n // over. Our heuristic for that is whenever we enter a concurrent work loop.\n\n\n if (currentEventTransitionLane === NoLane) {\n // All transitions within the same event are assigned the same lane.\n currentEventTransitionLane = claimNextTransitionLane();\n }\n\n return currentEventTransitionLane;\n } // Updates originating inside certain React methods, like flushSync, have\n // their priority set by tracking it with a context variable.\n //\n // The opaque type returned by the host config is internally a lane, so we can\n // use that directly.\n // TODO: Move this type conversion to the event priority module.\n\n\n var updateLane = getCurrentUpdatePriority();\n\n if (updateLane !== NoLane) {\n return updateLane;\n } // This update originated outside React. Ask the host environment for an\n // appropriate priority, based on the type of event.\n //\n // The opaque type returned by the host config is internally a lane, so we can\n // use that directly.\n // TODO: Move this type conversion to the event priority module.\n\n\n var eventLane = getCurrentEventPriority();\n return eventLane;\n}\n\nfunction requestRetryLane(fiber) {\n // This is a fork of `requestUpdateLane` designed specifically for Suspense\n // \"retries\" — a special update that attempts to flip a Suspense boundary\n // from its placeholder state to its primary/resolved state.\n // Special cases\n var mode = fiber.mode;\n\n if ((mode & ConcurrentMode) === NoMode) {\n return SyncLane;\n }\n\n return claimNextRetryLane();\n}\n\nfunction scheduleUpdateOnFiber(root, fiber, lane, eventTime) {\n checkForNestedUpdates();\n\n {\n if (isRunningInsertionEffect) {\n error('useInsertionEffect must not schedule updates.');\n }\n }\n\n {\n if (isFlushingPassiveEffects) {\n didScheduleUpdateDuringPassiveEffects = true;\n }\n } // Mark that the root has a pending update.\n\n\n markRootUpdated(root, lane, eventTime);\n\n if ((executionContext & RenderContext) !== NoLanes && root === workInProgressRoot) {\n // This update was dispatched during the render phase. This is a mistake\n // if the update originates from user space (with the exception of local\n // hook updates, which are handled differently and don't reach this\n // function), but there are some internal React features that use this as\n // an implementation detail, like selective hydration.\n warnAboutRenderPhaseUpdatesInDEV(fiber); // Track lanes that were updated during the render phase\n } else {\n // This is a normal update, scheduled from outside the render phase. For\n // example, during an input event.\n {\n if (isDevToolsPresent) {\n addFiberToLanesMap(root, fiber, lane);\n }\n }\n\n warnIfUpdatesNotWrappedWithActDEV(fiber);\n\n if (root === workInProgressRoot) {\n // Received an update to a tree that's in the middle of rendering. Mark\n // that there was an interleaved update work on this root. Unless the\n // `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render\n // phase update. In that case, we don't treat render phase updates as if\n // they were interleaved, for backwards compat reasons.\n if ( (executionContext & RenderContext) === NoContext) {\n workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane);\n }\n\n if (workInProgressRootExitStatus === RootSuspendedWithDelay) {\n // The root already suspended with a delay, which means this render\n // definitely won't finish. Since we have a new update, let's mark it as\n // suspended now, right before marking the incoming update. This has the\n // effect of interrupting the current render and switching to the update.\n // TODO: Make sure this doesn't override pings that happen while we've\n // already started rendering.\n markRootSuspended$1(root, workInProgressRootRenderLanes);\n }\n }\n\n ensureRootIsScheduled(root, eventTime);\n\n if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.\n !( ReactCurrentActQueue$1.isBatchingLegacy)) {\n // Flush the synchronous work now, unless we're already working or inside\n // a batch. This is intentionally inside scheduleUpdateOnFiber instead of\n // scheduleCallbackForFiber to preserve the ability to schedule a callback\n // without immediately flushing it. We only do this for user-initiated\n // updates, to preserve historical behavior of legacy mode.\n resetRenderTimer();\n flushSyncCallbacksOnlyInLegacyMode();\n }\n }\n}\nfunction scheduleInitialHydrationOnRoot(root, lane, eventTime) {\n // This is a special fork of scheduleUpdateOnFiber that is only used to\n // schedule the initial hydration of a root that has just been created. Most\n // of the stuff in scheduleUpdateOnFiber can be skipped.\n //\n // The main reason for this separate path, though, is to distinguish the\n // initial children from subsequent updates. In fully client-rendered roots\n // (createRoot instead of hydrateRoot), all top-level renders are modeled as\n // updates, but hydration roots are special because the initial render must\n // match what was rendered on the server.\n var current = root.current;\n current.lanes = lane;\n markRootUpdated(root, lane, eventTime);\n ensureRootIsScheduled(root, eventTime);\n}\nfunction isUnsafeClassRenderPhaseUpdate(fiber) {\n // Check if this is a render phase update. Only called by class components,\n // which special (deprecated) behavior for UNSAFE_componentWillReceive props.\n return (// TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We\n // decided not to enable it.\n (executionContext & RenderContext) !== NoContext\n );\n} // Use this function to schedule a task for a root. There's only one task per\n// root; if a task was already scheduled, we'll check to make sure the priority\n// of the existing task is the same as the priority of the next level that the\n// root has work on. This function is called on every update, and right before\n// exiting a task.\n\nfunction ensureRootIsScheduled(root, currentTime) {\n var existingCallbackNode = root.callbackNode; // Check if any lanes are being starved by other work. If so, mark them as\n // expired so we know to work on those next.\n\n markStarvedLanesAsExpired(root, currentTime); // Determine the next lanes to work on, and their priority.\n\n var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);\n\n if (nextLanes === NoLanes) {\n // Special case: There's nothing to work on.\n if (existingCallbackNode !== null) {\n cancelCallback$1(existingCallbackNode);\n }\n\n root.callbackNode = null;\n root.callbackPriority = NoLane;\n return;\n } // We use the highest priority lane to represent the priority of the callback.\n\n\n var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.\n\n var existingCallbackPriority = root.callbackPriority;\n\n if (existingCallbackPriority === newCallbackPriority && // Special case related to `act`. If the currently scheduled task is a\n // Scheduler task, rather than an `act` task, cancel it and re-scheduled\n // on the `act` queue.\n !( ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) {\n {\n // If we're going to re-use an existing task, it needs to exist.\n // Assume that discrete update microtasks are non-cancellable and null.\n // TODO: Temporary until we confirm this warning is not fired.\n if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) {\n error('Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.');\n }\n } // The priority hasn't changed. We can reuse the existing task. Exit.\n\n\n return;\n }\n\n if (existingCallbackNode != null) {\n // Cancel the existing callback. We'll schedule a new one below.\n cancelCallback$1(existingCallbackNode);\n } // Schedule a new callback.\n\n\n var newCallbackNode;\n\n if (newCallbackPriority === SyncLane) {\n // Special case: Sync React callbacks are scheduled on a special\n // internal queue\n if (root.tag === LegacyRoot) {\n if ( ReactCurrentActQueue$1.isBatchingLegacy !== null) {\n ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;\n }\n\n scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n }\n\n {\n // Flush the queue in a microtask.\n if ( ReactCurrentActQueue$1.current !== null) {\n // Inside `act`, use our internal `act` queue so that these get flushed\n // at the end of the current scope even when using the sync version\n // of `act`.\n ReactCurrentActQueue$1.current.push(flushSyncCallbacks);\n } else {\n scheduleMicrotask(function () {\n // In Safari, appending an iframe forces microtasks to run.\n // https://github.com/facebook/react/issues/22459\n // We don't support running callbacks in the middle of render\n // or commit so we need to check against that.\n if ((executionContext & (RenderContext | CommitContext)) === NoContext) {\n // Note that this would still prematurely flush the callbacks\n // if this happens outside render or commit phase (e.g. in an event).\n flushSyncCallbacks();\n }\n });\n }\n }\n\n newCallbackNode = null;\n } else {\n var schedulerPriorityLevel;\n\n switch (lanesToEventPriority(nextLanes)) {\n case DiscreteEventPriority:\n schedulerPriorityLevel = ImmediatePriority;\n break;\n\n case ContinuousEventPriority:\n schedulerPriorityLevel = UserBlockingPriority;\n break;\n\n case DefaultEventPriority:\n schedulerPriorityLevel = NormalPriority;\n break;\n\n case IdleEventPriority:\n schedulerPriorityLevel = IdlePriority;\n break;\n\n default:\n schedulerPriorityLevel = NormalPriority;\n break;\n }\n\n newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n }\n\n root.callbackPriority = newCallbackPriority;\n root.callbackNode = newCallbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that\n// goes through Scheduler.\n\n\nfunction performConcurrentWorkOnRoot(root, didTimeout) {\n {\n resetNestedUpdateFlag();\n } // Since we know we're in a React event, we can clear the current\n // event time. The next update will compute a new event time.\n\n\n currentEventTime = NoTimestamp;\n currentEventTransitionLane = NoLanes;\n\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n throw new Error('Should not already be working.');\n } // Flush any pending passive effects before deciding which lanes to work on,\n // in case they schedule additional work.\n\n\n var originalCallbackNode = root.callbackNode;\n var didFlushPassiveEffects = flushPassiveEffects();\n\n if (didFlushPassiveEffects) {\n // Something in the passive effect phase may have canceled the current task.\n // Check if the task node for this root was changed.\n if (root.callbackNode !== originalCallbackNode) {\n // The current task was canceled. Exit. We don't need to call\n // `ensureRootIsScheduled` because the check above implies either that\n // there's a new task, or that there's no remaining work on this root.\n return null;\n }\n } // Determine the next lanes to work on, using the fields stored\n // on the root.\n\n\n var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);\n\n if (lanes === NoLanes) {\n // Defensive coding. This is never expected to happen.\n return null;\n } // We disable time-slicing in some cases: if the work has been CPU-bound\n // for too long (\"expired\" work, to prevent starvation), or we're in\n // sync-updates-by-default mode.\n // TODO: We only check `didTimeout` defensively, to account for a Scheduler\n // bug we're still investigating. Once the bug in Scheduler is fixed,\n // we can remove this, since we track expiration ourselves.\n\n\n var shouldTimeSlice = !includesBlockingLane(root, lanes) && !includesExpiredLane(root, lanes) && ( !didTimeout);\n var exitStatus = shouldTimeSlice ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes);\n\n if (exitStatus !== RootInProgress) {\n if (exitStatus === RootErrored) {\n // If something threw an error, try rendering one more time. We'll\n // render synchronously to block concurrent data mutations, and we'll\n // includes all pending updates are included. If it still fails after\n // the second attempt, we'll give up and commit the resulting tree.\n var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root);\n\n if (errorRetryLanes !== NoLanes) {\n lanes = errorRetryLanes;\n exitStatus = recoverFromConcurrentError(root, errorRetryLanes);\n }\n }\n\n if (exitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n prepareFreshStack(root, NoLanes);\n markRootSuspended$1(root, lanes);\n ensureRootIsScheduled(root, now());\n throw fatalError;\n }\n\n if (exitStatus === RootDidNotComplete) {\n // The render unwound without completing the tree. This happens in special\n // cases where need to exit the current render without producing a\n // consistent tree or committing.\n //\n // This should only happen during a concurrent render, not a discrete or\n // synchronous update. We should have already checked for this when we\n // unwound the stack.\n markRootSuspended$1(root, lanes);\n } else {\n // The render completed.\n // Check if this render may have yielded to a concurrent event, and if so,\n // confirm that any newly rendered stores are consistent.\n // TODO: It's possible that even a concurrent render may never have yielded\n // to the main thread, if it was fast enough, or if it expired. We could\n // skip the consistency check in that case, too.\n var renderWasConcurrent = !includesBlockingLane(root, lanes);\n var finishedWork = root.current.alternate;\n\n if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) {\n // A store was mutated in an interleaved event. Render again,\n // synchronously, to block further mutations.\n exitStatus = renderRootSync(root, lanes); // We need to check again if something threw\n\n if (exitStatus === RootErrored) {\n var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root);\n\n if (_errorRetryLanes !== NoLanes) {\n lanes = _errorRetryLanes;\n exitStatus = recoverFromConcurrentError(root, _errorRetryLanes); // We assume the tree is now consistent because we didn't yield to any\n // concurrent events.\n }\n }\n\n if (exitStatus === RootFatalErrored) {\n var _fatalError = workInProgressRootFatalError;\n prepareFreshStack(root, NoLanes);\n markRootSuspended$1(root, lanes);\n ensureRootIsScheduled(root, now());\n throw _fatalError;\n }\n } // We now have a consistent tree. The next step is either to commit it,\n // or, if something suspended, wait to commit it after a timeout.\n\n\n root.finishedWork = finishedWork;\n root.finishedLanes = lanes;\n finishConcurrentRender(root, exitStatus, lanes);\n }\n }\n\n ensureRootIsScheduled(root, now());\n\n if (root.callbackNode === originalCallbackNode) {\n // The task node scheduled for this root is the same one that's\n // currently executed. Need to return a continuation.\n return performConcurrentWorkOnRoot.bind(null, root);\n }\n\n return null;\n}\n\nfunction recoverFromConcurrentError(root, errorRetryLanes) {\n // If an error occurred during hydration, discard server response and fall\n // back to client side render.\n // Before rendering again, save the errors from the previous attempt.\n var errorsFromFirstAttempt = workInProgressRootConcurrentErrors;\n\n if (isRootDehydrated(root)) {\n // The shell failed to hydrate. Set a flag to force a client rendering\n // during the next attempt. To do this, we call prepareFreshStack now\n // to create the root work-in-progress fiber. This is a bit weird in terms\n // of factoring, because it relies on renderRootSync not calling\n // prepareFreshStack again in the call below, which happens because the\n // root and lanes haven't changed.\n //\n // TODO: I think what we should do is set ForceClientRender inside\n // throwException, like we do for nested Suspense boundaries. The reason\n // it's here instead is so we can switch to the synchronous work loop, too.\n // Something to consider for a future refactor.\n var rootWorkInProgress = prepareFreshStack(root, errorRetryLanes);\n rootWorkInProgress.flags |= ForceClientRender;\n\n {\n errorHydratingContainer(root.containerInfo);\n }\n }\n\n var exitStatus = renderRootSync(root, errorRetryLanes);\n\n if (exitStatus !== RootErrored) {\n // Successfully finished rendering on retry\n // The errors from the failed first attempt have been recovered. Add\n // them to the collection of recoverable errors. We'll log them in the\n // commit phase.\n var errorsFromSecondAttempt = workInProgressRootRecoverableErrors;\n workInProgressRootRecoverableErrors = errorsFromFirstAttempt; // The errors from the second attempt should be queued after the errors\n // from the first attempt, to preserve the causal sequence.\n\n if (errorsFromSecondAttempt !== null) {\n queueRecoverableErrors(errorsFromSecondAttempt);\n }\n }\n\n return exitStatus;\n}\n\nfunction queueRecoverableErrors(errors) {\n if (workInProgressRootRecoverableErrors === null) {\n workInProgressRootRecoverableErrors = errors;\n } else {\n workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors);\n }\n}\n\nfunction finishConcurrentRender(root, exitStatus, lanes) {\n switch (exitStatus) {\n case RootInProgress:\n case RootFatalErrored:\n {\n throw new Error('Root did not complete. This is a bug in React.');\n }\n // Flow knows about invariant, so it complains if I add a break\n // statement, but eslint doesn't know about invariant, so it complains\n // if I do. eslint-disable-next-line no-fallthrough\n\n case RootErrored:\n {\n // We should have already attempted to retry this tree. If we reached\n // this point, it errored again. Commit it.\n commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions);\n break;\n }\n\n case RootSuspended:\n {\n markRootSuspended$1(root, lanes); // We have an acceptable loading state. We need to figure out if we\n // should immediately commit it or wait a bit.\n\n if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope\n !shouldForceFlushFallbacksInDEV()) {\n // This render only included retries, no updates. Throttle committing\n // retries so that we don't show too many loading states too quickly.\n var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.\n\n if (msUntilTimeout > 10) {\n var nextLanes = getNextLanes(root, NoLanes);\n\n if (nextLanes !== NoLanes) {\n // There's additional work on this root.\n break;\n }\n\n var suspendedLanes = root.suspendedLanes;\n\n if (!isSubsetOfLanes(suspendedLanes, lanes)) {\n // We should prefer to render the fallback of at the last\n // suspended level. Ping the last suspended level to try\n // rendering it again.\n // FIXME: What if the suspended lanes are Idle? Should not restart.\n var eventTime = requestEventTime();\n markRootPinged(root, suspendedLanes);\n break;\n } // The render is suspended, it hasn't timed out, and there's no\n // lower priority work to do. Instead of committing the fallback\n // immediately, wait for more data to arrive.\n\n\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout);\n break;\n }\n } // The work expired. Commit immediately.\n\n\n commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions);\n break;\n }\n\n case RootSuspendedWithDelay:\n {\n markRootSuspended$1(root, lanes);\n\n if (includesOnlyTransitions(lanes)) {\n // This is a transition, so we should exit without committing a\n // placeholder and without scheduling a timeout. Delay indefinitely\n // until we receive more data.\n break;\n }\n\n if (!shouldForceFlushFallbacksInDEV()) {\n // This is not a transition, but we did trigger an avoided state.\n // Schedule a placeholder to display after a short delay, using the Just\n // Noticeable Difference.\n // TODO: Is the JND optimization worth the added complexity? If this is\n // the only reason we track the event time, then probably not.\n // Consider removing.\n var mostRecentEventTime = getMostRecentEventTime(root, lanes);\n var eventTimeMs = mostRecentEventTime;\n var timeElapsedMs = now() - eventTimeMs;\n\n var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.\n\n\n if (_msUntilTimeout > 10) {\n // Instead of committing the fallback immediately, wait for more data\n // to arrive.\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout);\n break;\n }\n } // Commit the placeholder.\n\n\n commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions);\n break;\n }\n\n case RootCompleted:\n {\n // The work completed. Ready to commit.\n commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions);\n break;\n }\n\n default:\n {\n throw new Error('Unknown root exit status.');\n }\n }\n}\n\nfunction isRenderConsistentWithExternalStores(finishedWork) {\n // Search the rendered tree for external store reads, and check whether the\n // stores were mutated in a concurrent event. Intentionally using an iterative\n // loop instead of recursion so we can exit early.\n var node = finishedWork;\n\n while (true) {\n if (node.flags & StoreConsistency) {\n var updateQueue = node.updateQueue;\n\n if (updateQueue !== null) {\n var checks = updateQueue.stores;\n\n if (checks !== null) {\n for (var i = 0; i < checks.length; i++) {\n var check = checks[i];\n var getSnapshot = check.getSnapshot;\n var renderedValue = check.value;\n\n try {\n if (!objectIs(getSnapshot(), renderedValue)) {\n // Found an inconsistent store.\n return false;\n }\n } catch (error) {\n // If `getSnapshot` throws, return `false`. This will schedule\n // a re-render, and the error will be rethrown during render.\n return false;\n }\n }\n }\n }\n }\n\n var child = node.child;\n\n if (node.subtreeFlags & StoreConsistency && child !== null) {\n child.return = node;\n node = child;\n continue;\n }\n\n if (node === finishedWork) {\n return true;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === finishedWork) {\n return true;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } // Flow doesn't know this is unreachable, but eslint does\n // eslint-disable-next-line no-unreachable\n\n\n return true;\n}\n\nfunction markRootSuspended$1(root, suspendedLanes) {\n // When suspending, we should always exclude lanes that were pinged or (more\n // rarely, since we try to avoid it) updated during the render phase.\n // TODO: Lol maybe there's a better way to factor this besides this\n // obnoxiously named function :)\n suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);\n suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes);\n markRootSuspended(root, suspendedLanes);\n} // This is the entry point for synchronous tasks that don't go\n// through Scheduler\n\n\nfunction performSyncWorkOnRoot(root) {\n {\n syncNestedUpdateFlag();\n }\n\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n throw new Error('Should not already be working.');\n }\n\n flushPassiveEffects();\n var lanes = getNextLanes(root, NoLanes);\n\n if (!includesSomeLane(lanes, SyncLane)) {\n // There's no remaining sync work left.\n ensureRootIsScheduled(root, now());\n return null;\n }\n\n var exitStatus = renderRootSync(root, lanes);\n\n if (root.tag !== LegacyRoot && exitStatus === RootErrored) {\n // If something threw an error, try rendering one more time. We'll render\n // synchronously to block concurrent data mutations, and we'll includes\n // all pending updates are included. If it still fails after the second\n // attempt, we'll give up and commit the resulting tree.\n var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root);\n\n if (errorRetryLanes !== NoLanes) {\n lanes = errorRetryLanes;\n exitStatus = recoverFromConcurrentError(root, errorRetryLanes);\n }\n }\n\n if (exitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n prepareFreshStack(root, NoLanes);\n markRootSuspended$1(root, lanes);\n ensureRootIsScheduled(root, now());\n throw fatalError;\n }\n\n if (exitStatus === RootDidNotComplete) {\n throw new Error('Root did not complete. This is a bug in React.');\n } // We now have a consistent tree. Because this is a sync render, we\n // will commit it even if something suspended.\n\n\n var finishedWork = root.current.alternate;\n root.finishedWork = finishedWork;\n root.finishedLanes = lanes;\n commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); // Before exiting, make sure there's a callback scheduled for the next\n // pending level.\n\n ensureRootIsScheduled(root, now());\n return null;\n}\n\nfunction flushRoot(root, lanes) {\n if (lanes !== NoLanes) {\n markRootEntangled(root, mergeLanes(lanes, SyncLane));\n ensureRootIsScheduled(root, now());\n\n if ((executionContext & (RenderContext | CommitContext)) === NoContext) {\n resetRenderTimer();\n flushSyncCallbacks();\n }\n }\n}\nfunction batchedUpdates$1(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext |= BatchedContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer\n // most batchedUpdates-like method.\n\n if (executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.\n !( ReactCurrentActQueue$1.isBatchingLegacy)) {\n resetRenderTimer();\n flushSyncCallbacksOnlyInLegacyMode();\n }\n }\n}\nfunction discreteUpdates(fn, a, b, c, d) {\n var previousPriority = getCurrentUpdatePriority();\n var prevTransition = ReactCurrentBatchConfig$3.transition;\n\n try {\n ReactCurrentBatchConfig$3.transition = null;\n setCurrentUpdatePriority(DiscreteEventPriority);\n return fn(a, b, c, d);\n } finally {\n setCurrentUpdatePriority(previousPriority);\n ReactCurrentBatchConfig$3.transition = prevTransition;\n\n if (executionContext === NoContext) {\n resetRenderTimer();\n }\n }\n} // Overload the definition to the two valid signatures.\n// Warning, this opts-out of checking the function body.\n\n// eslint-disable-next-line no-redeclare\nfunction flushSync(fn) {\n // In legacy mode, we flush pending passive effects at the beginning of the\n // next event, not at the end of the previous one.\n if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) {\n flushPassiveEffects();\n }\n\n var prevExecutionContext = executionContext;\n executionContext |= BatchedContext;\n var prevTransition = ReactCurrentBatchConfig$3.transition;\n var previousPriority = getCurrentUpdatePriority();\n\n try {\n ReactCurrentBatchConfig$3.transition = null;\n setCurrentUpdatePriority(DiscreteEventPriority);\n\n if (fn) {\n return fn();\n } else {\n return undefined;\n }\n } finally {\n setCurrentUpdatePriority(previousPriority);\n ReactCurrentBatchConfig$3.transition = prevTransition;\n executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.\n // Note that this will happen even if batchedUpdates is higher up\n // the stack.\n\n if ((executionContext & (RenderContext | CommitContext)) === NoContext) {\n flushSyncCallbacks();\n }\n }\n}\nfunction isAlreadyRendering() {\n // Used by the renderer to print a warning if certain APIs are called from\n // the wrong context.\n return (executionContext & (RenderContext | CommitContext)) !== NoContext;\n}\nfunction pushRenderLanes(fiber, lanes) {\n push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);\n subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);\n workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);\n}\nfunction popRenderLanes(fiber) {\n subtreeRenderLanes = subtreeRenderLanesCursor.current;\n pop(subtreeRenderLanesCursor, fiber);\n}\n\nfunction prepareFreshStack(root, lanes) {\n root.finishedWork = null;\n root.finishedLanes = NoLanes;\n var timeoutHandle = root.timeoutHandle;\n\n if (timeoutHandle !== noTimeout) {\n // The root previous suspended and scheduled a timeout to commit a fallback\n // state. Now that we have additional work, cancel the timeout.\n root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above\n\n cancelTimeout(timeoutHandle);\n }\n\n if (workInProgress !== null) {\n var interruptedWork = workInProgress.return;\n\n while (interruptedWork !== null) {\n var current = interruptedWork.alternate;\n unwindInterruptedWork(current, interruptedWork);\n interruptedWork = interruptedWork.return;\n }\n }\n\n workInProgressRoot = root;\n var rootWorkInProgress = createWorkInProgress(root.current, null);\n workInProgress = rootWorkInProgress;\n workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;\n workInProgressRootExitStatus = RootInProgress;\n workInProgressRootFatalError = null;\n workInProgressRootSkippedLanes = NoLanes;\n workInProgressRootInterleavedUpdatedLanes = NoLanes;\n workInProgressRootPingedLanes = NoLanes;\n workInProgressRootConcurrentErrors = null;\n workInProgressRootRecoverableErrors = null;\n finishQueueingConcurrentUpdates();\n\n {\n ReactStrictModeWarnings.discardPendingWarnings();\n }\n\n return rootWorkInProgress;\n}\n\nfunction handleError(root, thrownValue) {\n do {\n var erroredWork = workInProgress;\n\n try {\n // Reset module-level state that was set during the render phase.\n resetContextDependencies();\n resetHooksAfterThrow();\n resetCurrentFiber(); // TODO: I found and added this missing line while investigating a\n // separate issue. Write a regression test using string refs.\n\n ReactCurrentOwner$2.current = null;\n\n if (erroredWork === null || erroredWork.return === null) {\n // Expected to be working on a non-root fiber. This is a fatal error\n // because there's no ancestor that can handle it; the root is\n // supposed to capture all errors that weren't caught by an error\n // boundary.\n workInProgressRootExitStatus = RootFatalErrored;\n workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next\n // sibling, or the parent if there are no siblings. But since the root\n // has no siblings nor a parent, we set it to null. Usually this is\n // handled by `completeUnitOfWork` or `unwindWork`, but since we're\n // intentionally not calling those, we need set it here.\n // TODO: Consider calling `unwindWork` to pop the contexts.\n\n workInProgress = null;\n return;\n }\n\n if (enableProfilerTimer && erroredWork.mode & ProfileMode) {\n // Record the time spent rendering before an error was thrown. This\n // avoids inaccurate Profiler durations in the case of a\n // suspended render.\n stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);\n }\n\n if (enableSchedulingProfiler) {\n markComponentRenderStopped();\n\n if (thrownValue !== null && typeof thrownValue === 'object' && typeof thrownValue.then === 'function') {\n var wakeable = thrownValue;\n markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes);\n } else {\n markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes);\n }\n }\n\n throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);\n completeUnitOfWork(erroredWork);\n } catch (yetAnotherThrownValue) {\n // Something in the return path also threw.\n thrownValue = yetAnotherThrownValue;\n\n if (workInProgress === erroredWork && erroredWork !== null) {\n // If this boundary has already errored, then we had trouble processing\n // the error. Bubble it to the next boundary.\n erroredWork = erroredWork.return;\n workInProgress = erroredWork;\n } else {\n erroredWork = workInProgress;\n }\n\n continue;\n } // Return to the normal work loop.\n\n\n return;\n } while (true);\n}\n\nfunction pushDispatcher() {\n var prevDispatcher = ReactCurrentDispatcher$2.current;\n ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;\n\n if (prevDispatcher === null) {\n // The React isomorphic package does not include a default dispatcher.\n // Instead the first renderer will lazily attach one, in order to give\n // nicer error messages.\n return ContextOnlyDispatcher;\n } else {\n return prevDispatcher;\n }\n}\n\nfunction popDispatcher(prevDispatcher) {\n ReactCurrentDispatcher$2.current = prevDispatcher;\n}\n\nfunction markCommitTimeOfFallback() {\n globalMostRecentFallbackTime = now();\n}\nfunction markSkippedUpdateLanes(lane) {\n workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);\n}\nfunction renderDidSuspend() {\n if (workInProgressRootExitStatus === RootInProgress) {\n workInProgressRootExitStatus = RootSuspended;\n }\n}\nfunction renderDidSuspendDelayIfPossible() {\n if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) {\n workInProgressRootExitStatus = RootSuspendedWithDelay;\n } // Check if there are updates that we skipped tree that might have unblocked\n // this render.\n\n\n if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) {\n // Mark the current render as suspended so that we switch to working on\n // the updates that were skipped. Usually we only suspend at the end of\n // the render phase.\n // TODO: We should probably always mark the root as suspended immediately\n // (inside this function), since by suspending at the end of the render\n // phase introduces a potential mistake where we suspend lanes that were\n // pinged or updated while we were rendering.\n markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);\n }\n}\nfunction renderDidError(error) {\n if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {\n workInProgressRootExitStatus = RootErrored;\n }\n\n if (workInProgressRootConcurrentErrors === null) {\n workInProgressRootConcurrentErrors = [error];\n } else {\n workInProgressRootConcurrentErrors.push(error);\n }\n} // Called during render to determine if anything has suspended.\n// Returns false if we're not sure.\n\nfunction renderHasNotSuspendedYet() {\n // If something errored or completed, we can't really be sure,\n // so those are false.\n return workInProgressRootExitStatus === RootInProgress;\n}\n\nfunction renderRootSync(root, lanes) {\n var prevExecutionContext = executionContext;\n executionContext |= RenderContext;\n var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack\n // and prepare a fresh one. Otherwise we'll continue where we left off.\n\n if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {\n {\n if (isDevToolsPresent) {\n var memoizedUpdaters = root.memoizedUpdaters;\n\n if (memoizedUpdaters.size > 0) {\n restorePendingUpdaters(root, workInProgressRootRenderLanes);\n memoizedUpdaters.clear();\n } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set.\n // If we bailout on this work, we'll move them back (like above).\n // It's important to move them now in case the work spawns more work at the same priority with different updaters.\n // That way we can keep the current update and future updates separate.\n\n\n movePendingFibersToMemoized(root, lanes);\n }\n }\n\n workInProgressTransitions = getTransitionsForLanes();\n prepareFreshStack(root, lanes);\n }\n\n {\n markRenderStarted(lanes);\n }\n\n do {\n try {\n workLoopSync();\n break;\n } catch (thrownValue) {\n handleError(root, thrownValue);\n }\n } while (true);\n\n resetContextDependencies();\n executionContext = prevExecutionContext;\n popDispatcher(prevDispatcher);\n\n if (workInProgress !== null) {\n // This is a sync render, so we should have finished the whole tree.\n throw new Error('Cannot commit an incomplete root. This error is likely caused by a ' + 'bug in React. Please file an issue.');\n }\n\n {\n markRenderStopped();\n } // Set this to null to indicate there's no in-progress render.\n\n\n workInProgressRoot = null;\n workInProgressRootRenderLanes = NoLanes;\n return workInProgressRootExitStatus;\n} // The work loop is an extremely hot path. Tell Closure not to inline it.\n\n/** @noinline */\n\n\nfunction workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}\n\nfunction renderRootConcurrent(root, lanes) {\n var prevExecutionContext = executionContext;\n executionContext |= RenderContext;\n var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack\n // and prepare a fresh one. Otherwise we'll continue where we left off.\n\n if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {\n {\n if (isDevToolsPresent) {\n var memoizedUpdaters = root.memoizedUpdaters;\n\n if (memoizedUpdaters.size > 0) {\n restorePendingUpdaters(root, workInProgressRootRenderLanes);\n memoizedUpdaters.clear();\n } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set.\n // If we bailout on this work, we'll move them back (like above).\n // It's important to move them now in case the work spawns more work at the same priority with different updaters.\n // That way we can keep the current update and future updates separate.\n\n\n movePendingFibersToMemoized(root, lanes);\n }\n }\n\n workInProgressTransitions = getTransitionsForLanes();\n resetRenderTimer();\n prepareFreshStack(root, lanes);\n }\n\n {\n markRenderStarted(lanes);\n }\n\n do {\n try {\n workLoopConcurrent();\n break;\n } catch (thrownValue) {\n handleError(root, thrownValue);\n }\n } while (true);\n\n resetContextDependencies();\n popDispatcher(prevDispatcher);\n executionContext = prevExecutionContext;\n\n\n if (workInProgress !== null) {\n // Still work remaining.\n {\n markRenderYielded();\n }\n\n return RootInProgress;\n } else {\n // Completed the tree.\n {\n markRenderStopped();\n } // Set this to null to indicate there's no in-progress render.\n\n\n workInProgressRoot = null;\n workInProgressRootRenderLanes = NoLanes; // Return the final exit status.\n\n return workInProgressRootExitStatus;\n }\n}\n/** @noinline */\n\n\nfunction workLoopConcurrent() {\n // Perform work until Scheduler asks us to yield\n while (workInProgress !== null && !shouldYield()) {\n performUnitOfWork(workInProgress);\n }\n}\n\nfunction performUnitOfWork(unitOfWork) {\n // The current, flushed, state of this fiber is the alternate. Ideally\n // nothing should rely on this, but relying on it here means that we don't\n // need an additional field on the work in progress.\n var current = unitOfWork.alternate;\n setCurrentFiber(unitOfWork);\n var next;\n\n if ( (unitOfWork.mode & ProfileMode) !== NoMode) {\n startProfilerTimer(unitOfWork);\n next = beginWork$1(current, unitOfWork, subtreeRenderLanes);\n stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);\n } else {\n next = beginWork$1(current, unitOfWork, subtreeRenderLanes);\n }\n\n resetCurrentFiber();\n unitOfWork.memoizedProps = unitOfWork.pendingProps;\n\n if (next === null) {\n // If this doesn't spawn new work, complete the current work.\n completeUnitOfWork(unitOfWork);\n } else {\n workInProgress = next;\n }\n\n ReactCurrentOwner$2.current = null;\n}\n\nfunction completeUnitOfWork(unitOfWork) {\n // Attempt to complete the current unit of work, then move to the next\n // sibling. If there are no more siblings, return to the parent fiber.\n var completedWork = unitOfWork;\n\n do {\n // The current, flushed, state of this fiber is the alternate. Ideally\n // nothing should rely on this, but relying on it here means that we don't\n // need an additional field on the work in progress.\n var current = completedWork.alternate;\n var returnFiber = completedWork.return; // Check if the work completed or if something threw.\n\n if ((completedWork.flags & Incomplete) === NoFlags) {\n setCurrentFiber(completedWork);\n var next = void 0;\n\n if ( (completedWork.mode & ProfileMode) === NoMode) {\n next = completeWork(current, completedWork, subtreeRenderLanes);\n } else {\n startProfilerTimer(completedWork);\n next = completeWork(current, completedWork, subtreeRenderLanes); // Update render duration assuming we didn't error.\n\n stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);\n }\n\n resetCurrentFiber();\n\n if (next !== null) {\n // Completing this fiber spawned new work. Work on that next.\n workInProgress = next;\n return;\n }\n } else {\n // This fiber did not complete because something threw. Pop values off\n // the stack without entering the complete phase. If this is a boundary,\n // capture values if possible.\n var _next = unwindWork(current, completedWork); // Because this fiber did not complete, don't reset its lanes.\n\n\n if (_next !== null) {\n // If completing this work spawned new work, do that next. We'll come\n // back here again.\n // Since we're restarting, remove anything that is not a host effect\n // from the effect tag.\n _next.flags &= HostEffectMask;\n workInProgress = _next;\n return;\n }\n\n if ( (completedWork.mode & ProfileMode) !== NoMode) {\n // Record the render duration for the fiber that errored.\n stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); // Include the time spent working on failed children before continuing.\n\n var actualDuration = completedWork.actualDuration;\n var child = completedWork.child;\n\n while (child !== null) {\n actualDuration += child.actualDuration;\n child = child.sibling;\n }\n\n completedWork.actualDuration = actualDuration;\n }\n\n if (returnFiber !== null) {\n // Mark the parent fiber as incomplete and clear its subtree flags.\n returnFiber.flags |= Incomplete;\n returnFiber.subtreeFlags = NoFlags;\n returnFiber.deletions = null;\n } else {\n // We've unwound all the way to the root.\n workInProgressRootExitStatus = RootDidNotComplete;\n workInProgress = null;\n return;\n }\n }\n\n var siblingFiber = completedWork.sibling;\n\n if (siblingFiber !== null) {\n // If there is more work to do in this returnFiber, do that next.\n workInProgress = siblingFiber;\n return;\n } // Otherwise, return to the parent\n\n\n completedWork = returnFiber; // Update the next thing we're working on in case something throws.\n\n workInProgress = completedWork;\n } while (completedWork !== null); // We've reached the root.\n\n\n if (workInProgressRootExitStatus === RootInProgress) {\n workInProgressRootExitStatus = RootCompleted;\n }\n}\n\nfunction commitRoot(root, recoverableErrors, transitions) {\n // TODO: This no longer makes any sense. We already wrap the mutation and\n // layout phases. Should be able to remove.\n var previousUpdateLanePriority = getCurrentUpdatePriority();\n var prevTransition = ReactCurrentBatchConfig$3.transition;\n\n try {\n ReactCurrentBatchConfig$3.transition = null;\n setCurrentUpdatePriority(DiscreteEventPriority);\n commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority);\n } finally {\n ReactCurrentBatchConfig$3.transition = prevTransition;\n setCurrentUpdatePriority(previousUpdateLanePriority);\n }\n\n return null;\n}\n\nfunction commitRootImpl(root, recoverableErrors, transitions, renderPriorityLevel) {\n do {\n // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which\n // means `flushPassiveEffects` will sometimes result in additional\n // passive effects. So we need to keep flushing in a loop until there are\n // no more pending effects.\n // TODO: Might be better if `flushPassiveEffects` did not automatically\n // flush synchronous work at the end, to avoid factoring hazards like this.\n flushPassiveEffects();\n } while (rootWithPendingPassiveEffects !== null);\n\n flushRenderPhaseStrictModeWarningsInDEV();\n\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n throw new Error('Should not already be working.');\n }\n\n var finishedWork = root.finishedWork;\n var lanes = root.finishedLanes;\n\n {\n markCommitStarted(lanes);\n }\n\n if (finishedWork === null) {\n\n {\n markCommitStopped();\n }\n\n return null;\n } else {\n {\n if (lanes === NoLanes) {\n error('root.finishedLanes should not be empty during a commit. This is a ' + 'bug in React.');\n }\n }\n }\n\n root.finishedWork = null;\n root.finishedLanes = NoLanes;\n\n if (finishedWork === root.current) {\n throw new Error('Cannot commit the same tree as before. This error is likely caused by ' + 'a bug in React. Please file an issue.');\n } // commitRoot never returns a continuation; it always finishes synchronously.\n // So we can clear these now to allow a new callback to be scheduled.\n\n\n root.callbackNode = null;\n root.callbackPriority = NoLane; // Update the first and last pending times on this root. The new first\n // pending time is whatever is left on the root fiber.\n\n var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);\n markRootFinished(root, remainingLanes);\n\n if (root === workInProgressRoot) {\n // We can reset these now that they are finished.\n workInProgressRoot = null;\n workInProgress = null;\n workInProgressRootRenderLanes = NoLanes;\n } // If there are pending passive effects, schedule a callback to process them.\n // Do this as early as possible, so it is queued before anything else that\n // might get scheduled in the commit phase. (See #16714.)\n // TODO: Delete all other places that schedule the passive effect callback\n // They're redundant.\n\n\n if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {\n if (!rootDoesHavePassiveEffects) {\n rootDoesHavePassiveEffects = true;\n // to store it in pendingPassiveTransitions until they get processed\n // We need to pass this through as an argument to commitRoot\n // because workInProgressTransitions might have changed between\n // the previous render and commit if we throttle the commit\n // with setTimeout\n\n pendingPassiveTransitions = transitions;\n scheduleCallback$1(NormalPriority, function () {\n flushPassiveEffects(); // This render triggered passive effects: release the root cache pool\n // *after* passive effects fire to avoid freeing a cache pool that may\n // be referenced by a node in the tree (HostRoot, Cache boundary etc)\n\n return null;\n });\n }\n } // Check if there are any effects in the whole tree.\n // TODO: This is left over from the effect list implementation, where we had\n // to check for the existence of `firstEffect` to satisfy Flow. I think the\n // only other reason this optimization exists is because it affects profiling.\n // Reconsider whether this is necessary.\n\n\n var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;\n var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;\n\n if (subtreeHasEffects || rootHasEffect) {\n var prevTransition = ReactCurrentBatchConfig$3.transition;\n ReactCurrentBatchConfig$3.transition = null;\n var previousPriority = getCurrentUpdatePriority();\n setCurrentUpdatePriority(DiscreteEventPriority);\n var prevExecutionContext = executionContext;\n executionContext |= CommitContext; // Reset this to null before calling lifecycles\n\n ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass\n // of the effect list for each phase: all mutation effects come before all\n // layout effects, and so on.\n // The first phase a \"before mutation\" phase. We use this phase to read the\n // state of the host tree right before we mutate it. This is where\n // getSnapshotBeforeUpdate is called.\n\n var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects(root, finishedWork);\n\n {\n // Mark the current commit time to be shared by all Profilers in this\n // batch. This enables them to be grouped later.\n recordCommitTime();\n }\n\n\n commitMutationEffects(root, finishedWork, lanes);\n\n resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after\n // the mutation phase, so that the previous tree is still current during\n // componentWillUnmount, but before the layout phase, so that the finished\n // work is current during componentDidMount/Update.\n\n root.current = finishedWork; // The next phase is the layout phase, where we call effects that read\n\n {\n markLayoutEffectsStarted(lanes);\n }\n\n commitLayoutEffects(finishedWork, root, lanes);\n\n {\n markLayoutEffectsStopped();\n }\n // opportunity to paint.\n\n\n requestPaint();\n executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value.\n\n setCurrentUpdatePriority(previousPriority);\n ReactCurrentBatchConfig$3.transition = prevTransition;\n } else {\n // No effects.\n root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were\n // no effects.\n // TODO: Maybe there's a better way to report this.\n\n {\n recordCommitTime();\n }\n }\n\n var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;\n\n if (rootDoesHavePassiveEffects) {\n // This commit has passive effects. Stash a reference to them. But don't\n // schedule a callback until after flushing layout work.\n rootDoesHavePassiveEffects = false;\n rootWithPendingPassiveEffects = root;\n pendingPassiveEffectsLanes = lanes;\n } else {\n\n {\n nestedPassiveUpdateCount = 0;\n rootWithPassiveNestedUpdates = null;\n }\n } // Read this again, since an effect might have updated it\n\n\n remainingLanes = root.pendingLanes; // Check if there's remaining work on this root\n // TODO: This is part of the `componentDidCatch` implementation. Its purpose\n // is to detect whether something might have called setState inside\n // `componentDidCatch`. The mechanism is known to be flawed because `setState`\n // inside `componentDidCatch` is itself flawed — that's why we recommend\n // `getDerivedStateFromError` instead. However, it could be improved by\n // checking if remainingLanes includes Sync work, instead of whether there's\n // any work remaining at all (which would also include stuff like Suspense\n // retries or transitions). It's been like this for a while, though, so fixing\n // it probably isn't that urgent.\n\n if (remainingLanes === NoLanes) {\n // If there's no remaining work, we can clear the set of already failed\n // error boundaries.\n legacyErrorBoundariesThatAlreadyFailed = null;\n }\n\n {\n if (!rootDidHavePassiveEffects) {\n commitDoubleInvokeEffectsInDEV(root.current, false);\n }\n }\n\n onCommitRoot(finishedWork.stateNode, renderPriorityLevel);\n\n {\n if (isDevToolsPresent) {\n root.memoizedUpdaters.clear();\n }\n }\n\n {\n onCommitRoot$1();\n } // Always call this before exiting `commitRoot`, to ensure that any\n // additional work on this root is scheduled.\n\n\n ensureRootIsScheduled(root, now());\n\n if (recoverableErrors !== null) {\n // There were errors during this render, but recovered from them without\n // needing to surface it to the UI. We log them here.\n var onRecoverableError = root.onRecoverableError;\n\n for (var i = 0; i < recoverableErrors.length; i++) {\n var recoverableError = recoverableErrors[i];\n var componentStack = recoverableError.stack;\n var digest = recoverableError.digest;\n onRecoverableError(recoverableError.value, {\n componentStack: componentStack,\n digest: digest\n });\n }\n }\n\n if (hasUncaughtError) {\n hasUncaughtError = false;\n var error$1 = firstUncaughtError;\n firstUncaughtError = null;\n throw error$1;\n } // If the passive effects are the result of a discrete render, flush them\n // synchronously at the end of the current task so that the result is\n // immediately observable. Otherwise, we assume that they are not\n // order-dependent and do not need to be observed by external systems, so we\n // can wait until after paint.\n // TODO: We can optimize this by not scheduling the callback earlier. Since we\n // currently schedule the callback in multiple places, will wait until those\n // are consolidated.\n\n\n if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root.tag !== LegacyRoot) {\n flushPassiveEffects();\n } // Read this again, since a passive effect might have updated it\n\n\n remainingLanes = root.pendingLanes;\n\n if (includesSomeLane(remainingLanes, SyncLane)) {\n {\n markNestedUpdateScheduled();\n } // Count the number of times the root synchronously re-renders without\n // finishing. If there are too many, it indicates an infinite update loop.\n\n\n if (root === rootWithNestedUpdates) {\n nestedUpdateCount++;\n } else {\n nestedUpdateCount = 0;\n rootWithNestedUpdates = root;\n }\n } else {\n nestedUpdateCount = 0;\n } // If layout work was scheduled, flush it now.\n\n\n flushSyncCallbacks();\n\n {\n markCommitStopped();\n }\n\n return null;\n}\n\nfunction flushPassiveEffects() {\n // Returns whether passive effects were flushed.\n // TODO: Combine this check with the one in flushPassiveEFfectsImpl. We should\n // probably just combine the two functions. I believe they were only separate\n // in the first place because we used to wrap it with\n // `Scheduler.runWithPriority`, which accepts a function. But now we track the\n // priority within React itself, so we can mutate the variable directly.\n if (rootWithPendingPassiveEffects !== null) {\n var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);\n var priority = lowerEventPriority(DefaultEventPriority, renderPriority);\n var prevTransition = ReactCurrentBatchConfig$3.transition;\n var previousPriority = getCurrentUpdatePriority();\n\n try {\n ReactCurrentBatchConfig$3.transition = null;\n setCurrentUpdatePriority(priority);\n return flushPassiveEffectsImpl();\n } finally {\n setCurrentUpdatePriority(previousPriority);\n ReactCurrentBatchConfig$3.transition = prevTransition; // Once passive effects have run for the tree - giving components a\n }\n }\n\n return false;\n}\nfunction enqueuePendingPassiveProfilerEffect(fiber) {\n {\n pendingPassiveProfilerEffects.push(fiber);\n\n if (!rootDoesHavePassiveEffects) {\n rootDoesHavePassiveEffects = true;\n scheduleCallback$1(NormalPriority, function () {\n flushPassiveEffects();\n return null;\n });\n }\n }\n}\n\nfunction flushPassiveEffectsImpl() {\n if (rootWithPendingPassiveEffects === null) {\n return false;\n } // Cache and clear the transitions flag\n\n\n var transitions = pendingPassiveTransitions;\n pendingPassiveTransitions = null;\n var root = rootWithPendingPassiveEffects;\n var lanes = pendingPassiveEffectsLanes;\n rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects.\n // Figure out why and fix it. It's not causing any known issues (probably\n // because it's only used for profiling), but it's a refactor hazard.\n\n pendingPassiveEffectsLanes = NoLanes;\n\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n throw new Error('Cannot flush passive effects while already rendering.');\n }\n\n {\n isFlushingPassiveEffects = true;\n didScheduleUpdateDuringPassiveEffects = false;\n }\n\n {\n markPassiveEffectsStarted(lanes);\n }\n\n var prevExecutionContext = executionContext;\n executionContext |= CommitContext;\n commitPassiveUnmountEffects(root.current);\n commitPassiveMountEffects(root, root.current, lanes, transitions); // TODO: Move to commitPassiveMountEffects\n\n {\n var profilerEffects = pendingPassiveProfilerEffects;\n pendingPassiveProfilerEffects = [];\n\n for (var i = 0; i < profilerEffects.length; i++) {\n var _fiber = profilerEffects[i];\n commitPassiveEffectDurations(root, _fiber);\n }\n }\n\n {\n markPassiveEffectsStopped();\n }\n\n {\n commitDoubleInvokeEffectsInDEV(root.current, true);\n }\n\n executionContext = prevExecutionContext;\n flushSyncCallbacks();\n\n {\n // If additional passive effects were scheduled, increment a counter. If this\n // exceeds the limit, we'll fire a warning.\n if (didScheduleUpdateDuringPassiveEffects) {\n if (root === rootWithPassiveNestedUpdates) {\n nestedPassiveUpdateCount++;\n } else {\n nestedPassiveUpdateCount = 0;\n rootWithPassiveNestedUpdates = root;\n }\n } else {\n nestedPassiveUpdateCount = 0;\n }\n\n isFlushingPassiveEffects = false;\n didScheduleUpdateDuringPassiveEffects = false;\n } // TODO: Move to commitPassiveMountEffects\n\n\n onPostCommitRoot(root);\n\n {\n var stateNode = root.current.stateNode;\n stateNode.effectDuration = 0;\n stateNode.passiveEffectDuration = 0;\n }\n\n return true;\n}\n\nfunction isAlreadyFailedLegacyErrorBoundary(instance) {\n return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);\n}\nfunction markLegacyErrorBoundaryAsFailed(instance) {\n if (legacyErrorBoundariesThatAlreadyFailed === null) {\n legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);\n } else {\n legacyErrorBoundariesThatAlreadyFailed.add(instance);\n }\n}\n\nfunction prepareToThrowUncaughtError(error) {\n if (!hasUncaughtError) {\n hasUncaughtError = true;\n firstUncaughtError = error;\n }\n}\n\nvar onUncaughtError = prepareToThrowUncaughtError;\n\nfunction captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {\n var errorInfo = createCapturedValueAtFiber(error, sourceFiber);\n var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);\n var root = enqueueUpdate(rootFiber, update, SyncLane);\n var eventTime = requestEventTime();\n\n if (root !== null) {\n markRootUpdated(root, SyncLane, eventTime);\n ensureRootIsScheduled(root, eventTime);\n }\n}\n\nfunction captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {\n {\n reportUncaughtErrorInDEV(error$1);\n setIsRunningInsertionEffect(false);\n }\n\n if (sourceFiber.tag === HostRoot) {\n // Error was thrown at the root. There is no parent, so the root\n // itself should capture it.\n captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1);\n return;\n }\n\n var fiber = null;\n\n {\n fiber = nearestMountedAncestor;\n }\n\n while (fiber !== null) {\n if (fiber.tag === HostRoot) {\n captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1);\n return;\n } else if (fiber.tag === ClassComponent) {\n var ctor = fiber.type;\n var instance = fiber.stateNode;\n\n if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {\n var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber);\n var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);\n var root = enqueueUpdate(fiber, update, SyncLane);\n var eventTime = requestEventTime();\n\n if (root !== null) {\n markRootUpdated(root, SyncLane, eventTime);\n ensureRootIsScheduled(root, eventTime);\n }\n\n return;\n }\n }\n\n fiber = fiber.return;\n }\n\n {\n // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning\n // will fire for errors that are thrown by destroy functions inside deleted\n // trees. What it should instead do is propagate the error to the parent of\n // the deleted tree. In the meantime, do not add this warning to the\n // allowlist; this is only for our internal use.\n error('Internal React error: Attempted to capture a commit phase error ' + 'inside a detached tree. This indicates a bug in React. Likely ' + 'causes include deleting the same fiber more than once, committing an ' + 'already-finished tree, or an inconsistent return pointer.\\n\\n' + 'Error message:\\n\\n%s', error$1);\n }\n}\nfunction pingSuspendedRoot(root, wakeable, pingedLanes) {\n var pingCache = root.pingCache;\n\n if (pingCache !== null) {\n // The wakeable resolved, so we no longer need to memoize, because it will\n // never be thrown again.\n pingCache.delete(wakeable);\n }\n\n var eventTime = requestEventTime();\n markRootPinged(root, pingedLanes);\n warnIfSuspenseResolutionNotWrappedWithActDEV(root);\n\n if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {\n // Received a ping at the same priority level at which we're currently\n // rendering. We might want to restart this render. This should mirror\n // the logic of whether or not a root suspends once it completes.\n // TODO: If we're rendering sync either due to Sync, Batched or expired,\n // we should probably never restart.\n // If we're suspended with delay, or if it's a retry, we'll always suspend\n // so we can always restart.\n if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {\n // Restart from the root.\n prepareFreshStack(root, NoLanes);\n } else {\n // Even though we can't restart right now, we might get an\n // opportunity later. So we mark this render as having a ping.\n workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);\n }\n }\n\n ensureRootIsScheduled(root, eventTime);\n}\n\nfunction retryTimedOutBoundary(boundaryFiber, retryLane) {\n // The boundary fiber (a Suspense component or SuspenseList component)\n // previously was rendered in its fallback state. One of the promises that\n // suspended it has resolved, which means at least part of the tree was\n // likely unblocked. Try rendering again, at a new lanes.\n if (retryLane === NoLane) {\n // TODO: Assign this to `suspenseState.retryLane`? to avoid\n // unnecessary entanglement?\n retryLane = requestRetryLane(boundaryFiber);\n } // TODO: Special case idle priority?\n\n\n var eventTime = requestEventTime();\n var root = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);\n\n if (root !== null) {\n markRootUpdated(root, retryLane, eventTime);\n ensureRootIsScheduled(root, eventTime);\n }\n}\n\nfunction retryDehydratedSuspenseBoundary(boundaryFiber) {\n var suspenseState = boundaryFiber.memoizedState;\n var retryLane = NoLane;\n\n if (suspenseState !== null) {\n retryLane = suspenseState.retryLane;\n }\n\n retryTimedOutBoundary(boundaryFiber, retryLane);\n}\nfunction resolveRetryWakeable(boundaryFiber, wakeable) {\n var retryLane = NoLane; // Default\n\n var retryCache;\n\n switch (boundaryFiber.tag) {\n case SuspenseComponent:\n retryCache = boundaryFiber.stateNode;\n var suspenseState = boundaryFiber.memoizedState;\n\n if (suspenseState !== null) {\n retryLane = suspenseState.retryLane;\n }\n\n break;\n\n case SuspenseListComponent:\n retryCache = boundaryFiber.stateNode;\n break;\n\n default:\n throw new Error('Pinged unknown suspense boundary type. ' + 'This is probably a bug in React.');\n }\n\n if (retryCache !== null) {\n // The wakeable resolved, so we no longer need to memoize, because it will\n // never be thrown again.\n retryCache.delete(wakeable);\n }\n\n retryTimedOutBoundary(boundaryFiber, retryLane);\n} // Computes the next Just Noticeable Difference (JND) boundary.\n// The theory is that a person can't tell the difference between small differences in time.\n// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable\n// difference in the experience. However, waiting for longer might mean that we can avoid\n// showing an intermediate loading state. The longer we have already waited, the harder it\n// is to tell small differences in time. Therefore, the longer we've already waited,\n// the longer we can wait additionally. At some point we have to give up though.\n// We pick a train model where the next boundary commits at a consistent schedule.\n// These particular numbers are vague estimates. We expect to adjust them based on research.\n\nfunction jnd(timeElapsed) {\n return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;\n}\n\nfunction checkForNestedUpdates() {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n nestedUpdateCount = 0;\n rootWithNestedUpdates = null;\n throw new Error('Maximum update depth exceeded. This can happen when a component ' + 'repeatedly calls setState inside componentWillUpdate or ' + 'componentDidUpdate. React limits the number of nested updates to ' + 'prevent infinite loops.');\n }\n\n {\n if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {\n nestedPassiveUpdateCount = 0;\n rootWithPassiveNestedUpdates = null;\n\n error('Maximum update depth exceeded. This can happen when a component ' + \"calls setState inside useEffect, but useEffect either doesn't \" + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');\n }\n }\n}\n\nfunction flushRenderPhaseStrictModeWarningsInDEV() {\n {\n ReactStrictModeWarnings.flushLegacyContextWarning();\n\n {\n ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();\n }\n }\n}\n\nfunction commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) {\n {\n // TODO (StrictEffects) Should we set a marker on the root if it contains strict effects\n // so we don't traverse unnecessarily? similar to subtreeFlags but just at the root level.\n // Maybe not a big deal since this is DEV only behavior.\n setCurrentFiber(fiber);\n invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV);\n\n if (hasPassiveEffects) {\n invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV);\n }\n\n invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV);\n\n if (hasPassiveEffects) {\n invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV);\n }\n\n resetCurrentFiber();\n }\n}\n\nfunction invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) {\n {\n // We don't need to re-check StrictEffectsMode here.\n // This function is only called if that check has already passed.\n var current = firstChild;\n var subtreeRoot = null;\n\n while (current !== null) {\n var primarySubtreeFlag = current.subtreeFlags & fiberFlags;\n\n if (current !== subtreeRoot && current.child !== null && primarySubtreeFlag !== NoFlags) {\n current = current.child;\n } else {\n if ((current.flags & fiberFlags) !== NoFlags) {\n invokeEffectFn(current);\n }\n\n if (current.sibling !== null) {\n current = current.sibling;\n } else {\n current = subtreeRoot = current.return;\n }\n }\n }\n }\n}\n\nvar didWarnStateUpdateForNotYetMountedComponent = null;\nfunction warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {\n {\n if ((executionContext & RenderContext) !== NoContext) {\n // We let the other warning about render phase updates deal with this one.\n return;\n }\n\n if (!(fiber.mode & ConcurrentMode)) {\n return;\n }\n\n var tag = fiber.tag;\n\n if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {\n // Only warn for user-defined components, not internal ones like Suspense.\n return;\n } // We show the whole stack but dedupe on the top component's name because\n // the problematic code almost always lies inside that component.\n\n\n var componentName = getComponentNameFromFiber(fiber) || 'ReactComponent';\n\n if (didWarnStateUpdateForNotYetMountedComponent !== null) {\n if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {\n return;\n }\n\n didWarnStateUpdateForNotYetMountedComponent.add(componentName);\n } else {\n didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]);\n }\n\n var previousFiber = current;\n\n try {\n setCurrentFiber(fiber);\n\n error(\"Can't perform a React state update on a component that hasn't mounted yet. \" + 'This indicates that you have a side-effect in your render function that ' + 'asynchronously later calls tries to update the component. Move this work to ' + 'useEffect instead.');\n } finally {\n if (previousFiber) {\n setCurrentFiber(fiber);\n } else {\n resetCurrentFiber();\n }\n }\n }\n}\nvar beginWork$1;\n\n{\n var dummyFiber = null;\n\n beginWork$1 = function (current, unitOfWork, lanes) {\n // If a component throws an error, we replay it again in a synchronously\n // dispatched event, so that the debugger will treat it as an uncaught\n // error See ReactErrorUtils for more information.\n // Before entering the begin phase, copy the work-in-progress onto a dummy\n // fiber. If beginWork throws, we'll use this to reset the state.\n var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);\n\n try {\n return beginWork(current, unitOfWork, lanes);\n } catch (originalError) {\n if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {\n // Don't replay promises.\n // Don't replay errors if we are hydrating and have already suspended or handled an error\n throw originalError;\n } // Keep this code in sync with handleError; any changes here must have\n // corresponding changes there.\n\n\n resetContextDependencies();\n resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the\n // same fiber again.\n // Unwind the failed stack frame\n\n unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber.\n\n assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);\n\n if ( unitOfWork.mode & ProfileMode) {\n // Reset the profiler timer.\n startProfilerTimer(unitOfWork);\n } // Run beginWork again.\n\n\n invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes);\n\n if (hasCaughtError()) {\n var replayError = clearCaughtError();\n\n if (typeof replayError === 'object' && replayError !== null && replayError._suppressLogging && typeof originalError === 'object' && originalError !== null && !originalError._suppressLogging) {\n // If suppressed, let the flag carry over to the original error which is the one we'll rethrow.\n originalError._suppressLogging = true;\n }\n } // We always throw the original error in case the second render pass is not idempotent.\n // This can happen if a memoized function or CommonJS module doesn't throw after first invocation.\n\n\n throw originalError;\n }\n };\n}\n\nvar didWarnAboutUpdateInRender = false;\nvar didWarnAboutUpdateInRenderForAnotherComponent;\n\n{\n didWarnAboutUpdateInRenderForAnotherComponent = new Set();\n}\n\nfunction warnAboutRenderPhaseUpdatesInDEV(fiber) {\n {\n if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.\n\n var dedupeKey = renderingComponentName;\n\n if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {\n didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);\n var setStateComponentName = getComponentNameFromFiber(fiber) || 'Unknown';\n\n error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://reactjs.org/link/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);\n }\n\n break;\n }\n\n case ClassComponent:\n {\n if (!didWarnAboutUpdateInRender) {\n error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');\n\n didWarnAboutUpdateInRender = true;\n }\n\n break;\n }\n }\n }\n }\n}\n\nfunction restorePendingUpdaters(root, lanes) {\n {\n if (isDevToolsPresent) {\n var memoizedUpdaters = root.memoizedUpdaters;\n memoizedUpdaters.forEach(function (schedulingFiber) {\n addFiberToLanesMap(root, schedulingFiber, lanes);\n }); // This function intentionally does not clear memoized updaters.\n // Those may still be relevant to the current commit\n // and a future one (e.g. Suspense).\n }\n }\n}\nvar fakeActCallbackNode = {};\n\nfunction scheduleCallback$1(priorityLevel, callback) {\n {\n // If we're currently inside an `act` scope, bypass Scheduler and push to\n // the `act` queue instead.\n var actQueue = ReactCurrentActQueue$1.current;\n\n if (actQueue !== null) {\n actQueue.push(callback);\n return fakeActCallbackNode;\n } else {\n return scheduleCallback(priorityLevel, callback);\n }\n }\n}\n\nfunction cancelCallback$1(callbackNode) {\n if ( callbackNode === fakeActCallbackNode) {\n return;\n } // In production, always call Scheduler. This function will be stripped out.\n\n\n return cancelCallback(callbackNode);\n}\n\nfunction shouldForceFlushFallbacksInDEV() {\n // Never force flush in production. This function should get stripped out.\n return ReactCurrentActQueue$1.current !== null;\n}\n\nfunction warnIfUpdatesNotWrappedWithActDEV(fiber) {\n {\n if (fiber.mode & ConcurrentMode) {\n if (!isConcurrentActEnvironment()) {\n // Not in an act environment. No need to warn.\n return;\n }\n } else {\n // Legacy mode has additional cases where we suppress a warning.\n if (!isLegacyActEnvironment()) {\n // Not in an act environment. No need to warn.\n return;\n }\n\n if (executionContext !== NoContext) {\n // Legacy mode doesn't warn if the update is batched, i.e.\n // batchedUpdates or flushSync.\n return;\n }\n\n if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) {\n // For backwards compatibility with pre-hooks code, legacy mode only\n // warns for updates that originate from a hook.\n return;\n }\n }\n\n if (ReactCurrentActQueue$1.current === null) {\n var previousFiber = current;\n\n try {\n setCurrentFiber(fiber);\n\n error('An update to %s inside a test was not wrapped in act(...).\\n\\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\\n\\n' + 'act(() => {\\n' + ' /* fire events that update state */\\n' + '});\\n' + '/* assert on the output */\\n\\n' + \"This ensures that you're testing the behavior the user would see \" + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentNameFromFiber(fiber));\n } finally {\n if (previousFiber) {\n setCurrentFiber(fiber);\n } else {\n resetCurrentFiber();\n }\n }\n }\n }\n}\n\nfunction warnIfSuspenseResolutionNotWrappedWithActDEV(root) {\n {\n if (root.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) {\n error('A suspended resource finished loading inside a test, but the event ' + 'was not wrapped in act(...).\\n\\n' + 'When testing, code that resolves suspended data should be wrapped ' + 'into act(...):\\n\\n' + 'act(() => {\\n' + ' /* finish loading suspended data */\\n' + '});\\n' + '/* assert on the output */\\n\\n' + \"This ensures that you're testing the behavior the user would see \" + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act');\n }\n }\n}\n\nfunction setIsRunningInsertionEffect(isRunning) {\n {\n isRunningInsertionEffect = isRunning;\n }\n}\n\n/* eslint-disable react-internal/prod-error-codes */\nvar resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.\n\nvar failedBoundaries = null;\nvar setRefreshHandler = function (handler) {\n {\n resolveFamily = handler;\n }\n};\nfunction resolveFunctionForHotReloading(type) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return type;\n }\n\n var family = resolveFamily(type);\n\n if (family === undefined) {\n return type;\n } // Use the latest known implementation.\n\n\n return family.current;\n }\n}\nfunction resolveClassForHotReloading(type) {\n // No implementation differences.\n return resolveFunctionForHotReloading(type);\n}\nfunction resolveForwardRefForHotReloading(type) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return type;\n }\n\n var family = resolveFamily(type);\n\n if (family === undefined) {\n // Check if we're dealing with a real forwardRef. Don't want to crash early.\n if (type !== null && type !== undefined && typeof type.render === 'function') {\n // ForwardRef is special because its resolved .type is an object,\n // but it's possible that we only have its inner render function in the map.\n // If that inner render function is different, we'll build a new forwardRef type.\n var currentRender = resolveFunctionForHotReloading(type.render);\n\n if (type.render !== currentRender) {\n var syntheticType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: currentRender\n };\n\n if (type.displayName !== undefined) {\n syntheticType.displayName = type.displayName;\n }\n\n return syntheticType;\n }\n }\n\n return type;\n } // Use the latest known implementation.\n\n\n return family.current;\n }\n}\nfunction isCompatibleFamilyForHotReloading(fiber, element) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return false;\n }\n\n var prevType = fiber.elementType;\n var nextType = element.type; // If we got here, we know types aren't === equal.\n\n var needsCompareFamilies = false;\n var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;\n\n switch (fiber.tag) {\n case ClassComponent:\n {\n if (typeof nextType === 'function') {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case FunctionComponent:\n {\n if (typeof nextType === 'function') {\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n // We don't know the inner type yet.\n // We're going to assume that the lazy inner type is stable,\n // and so it is sufficient to avoid reconciling it away.\n // We're not going to unwrap or actually use the new lazy type.\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case ForwardRef:\n {\n if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case MemoComponent:\n case SimpleMemoComponent:\n {\n if ($$typeofNextType === REACT_MEMO_TYPE) {\n // TODO: if it was but can no longer be simple,\n // we shouldn't set this.\n needsCompareFamilies = true;\n } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n default:\n return false;\n } // Check if both types have a family and it's the same one.\n\n\n if (needsCompareFamilies) {\n // Note: memo() and forwardRef() we'll compare outer rather than inner type.\n // This means both of them need to be registered to preserve state.\n // If we unwrapped and compared the inner types for wrappers instead,\n // then we would risk falsely saying two separate memo(Foo)\n // calls are equivalent because they wrap the same Foo function.\n var prevFamily = resolveFamily(prevType);\n\n if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {\n return true;\n }\n }\n\n return false;\n }\n}\nfunction markFailedErrorBoundaryForHotReloading(fiber) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return;\n }\n\n if (typeof WeakSet !== 'function') {\n return;\n }\n\n if (failedBoundaries === null) {\n failedBoundaries = new WeakSet();\n }\n\n failedBoundaries.add(fiber);\n }\n}\nvar scheduleRefresh = function (root, update) {\n {\n if (resolveFamily === null) {\n // Hot reloading is disabled.\n return;\n }\n\n var staleFamilies = update.staleFamilies,\n updatedFamilies = update.updatedFamilies;\n flushPassiveEffects();\n flushSync(function () {\n scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);\n });\n }\n};\nvar scheduleRoot = function (root, element) {\n {\n if (root.context !== emptyContextObject) {\n // Super edge case: root has a legacy _renderSubtree context\n // but we don't know the parentComponent so we can't pass it.\n // Just ignore. We'll delete this with _renderSubtree code path later.\n return;\n }\n\n flushPassiveEffects();\n flushSync(function () {\n updateContainer(element, root, null, null);\n });\n }\n};\n\nfunction scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {\n {\n var alternate = fiber.alternate,\n child = fiber.child,\n sibling = fiber.sibling,\n tag = fiber.tag,\n type = fiber.type;\n var candidateType = null;\n\n switch (tag) {\n case FunctionComponent:\n case SimpleMemoComponent:\n case ClassComponent:\n candidateType = type;\n break;\n\n case ForwardRef:\n candidateType = type.render;\n break;\n }\n\n if (resolveFamily === null) {\n throw new Error('Expected resolveFamily to be set during hot reload.');\n }\n\n var needsRender = false;\n var needsRemount = false;\n\n if (candidateType !== null) {\n var family = resolveFamily(candidateType);\n\n if (family !== undefined) {\n if (staleFamilies.has(family)) {\n needsRemount = true;\n } else if (updatedFamilies.has(family)) {\n if (tag === ClassComponent) {\n needsRemount = true;\n } else {\n needsRender = true;\n }\n }\n }\n }\n\n if (failedBoundaries !== null) {\n if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {\n needsRemount = true;\n }\n }\n\n if (needsRemount) {\n fiber._debugNeedsRemount = true;\n }\n\n if (needsRemount || needsRender) {\n var _root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (_root !== null) {\n scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp);\n }\n }\n\n if (child !== null && !needsRemount) {\n scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);\n }\n\n if (sibling !== null) {\n scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);\n }\n }\n}\n\nvar findHostInstancesForRefresh = function (root, families) {\n {\n var hostInstances = new Set();\n var types = new Set(families.map(function (family) {\n return family.current;\n }));\n findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);\n return hostInstances;\n }\n};\n\nfunction findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {\n {\n var child = fiber.child,\n sibling = fiber.sibling,\n tag = fiber.tag,\n type = fiber.type;\n var candidateType = null;\n\n switch (tag) {\n case FunctionComponent:\n case SimpleMemoComponent:\n case ClassComponent:\n candidateType = type;\n break;\n\n case ForwardRef:\n candidateType = type.render;\n break;\n }\n\n var didMatch = false;\n\n if (candidateType !== null) {\n if (types.has(candidateType)) {\n didMatch = true;\n }\n }\n\n if (didMatch) {\n // We have a match. This only drills down to the closest host components.\n // There's no need to search deeper because for the purpose of giving\n // visual feedback, \"flashing\" outermost parent rectangles is sufficient.\n findHostInstancesForFiberShallowly(fiber, hostInstances);\n } else {\n // If there's no match, maybe there will be one further down in the child tree.\n if (child !== null) {\n findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);\n }\n }\n\n if (sibling !== null) {\n findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);\n }\n }\n}\n\nfunction findHostInstancesForFiberShallowly(fiber, hostInstances) {\n {\n var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);\n\n if (foundHostInstances) {\n return;\n } // If we didn't find any host children, fallback to closest host parent.\n\n\n var node = fiber;\n\n while (true) {\n switch (node.tag) {\n case HostComponent:\n hostInstances.add(node.stateNode);\n return;\n\n case HostPortal:\n hostInstances.add(node.stateNode.containerInfo);\n return;\n\n case HostRoot:\n hostInstances.add(node.stateNode.containerInfo);\n return;\n }\n\n if (node.return === null) {\n throw new Error('Expected to reach root first.');\n }\n\n node = node.return;\n }\n }\n}\n\nfunction findChildHostInstancesForFiberShallowly(fiber, hostInstances) {\n {\n var node = fiber;\n var foundHostInstances = false;\n\n while (true) {\n if (node.tag === HostComponent) {\n // We got a match.\n foundHostInstances = true;\n hostInstances.add(node.stateNode); // There may still be more, so keep searching.\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === fiber) {\n return foundHostInstances;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === fiber) {\n return foundHostInstances;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n }\n\n return false;\n}\n\nvar hasBadMapPolyfill;\n\n{\n hasBadMapPolyfill = false;\n\n try {\n var nonExtensibleObject = Object.preventExtensions({});\n /* eslint-disable no-new */\n\n new Map([[nonExtensibleObject, null]]);\n new Set([nonExtensibleObject]);\n /* eslint-enable no-new */\n } catch (e) {\n // TODO: Consider warning about bad polyfills\n hasBadMapPolyfill = true;\n }\n}\n\nfunction FiberNode(tag, pendingProps, key, mode) {\n // Instance\n this.tag = tag;\n this.key = key;\n this.elementType = null;\n this.type = null;\n this.stateNode = null; // Fiber\n\n this.return = null;\n this.child = null;\n this.sibling = null;\n this.index = 0;\n this.ref = null;\n this.pendingProps = pendingProps;\n this.memoizedProps = null;\n this.updateQueue = null;\n this.memoizedState = null;\n this.dependencies = null;\n this.mode = mode; // Effects\n\n this.flags = NoFlags;\n this.subtreeFlags = NoFlags;\n this.deletions = null;\n this.lanes = NoLanes;\n this.childLanes = NoLanes;\n this.alternate = null;\n\n {\n // Note: The following is done to avoid a v8 performance cliff.\n //\n // Initializing the fields below to smis and later updating them with\n // double values will cause Fibers to end up having separate shapes.\n // This behavior/bug has something to do with Object.preventExtension().\n // Fortunately this only impacts DEV builds.\n // Unfortunately it makes React unusably slow for some applications.\n // To work around this, initialize the fields below with doubles.\n //\n // Learn more about this here:\n // https://github.com/facebook/react/issues/14365\n // https://bugs.chromium.org/p/v8/issues/detail?id=8538\n this.actualDuration = Number.NaN;\n this.actualStartTime = Number.NaN;\n this.selfBaseDuration = Number.NaN;\n this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.\n // This won't trigger the performance cliff mentioned above,\n // and it simplifies other profiler code (including DevTools).\n\n this.actualDuration = 0;\n this.actualStartTime = -1;\n this.selfBaseDuration = 0;\n this.treeBaseDuration = 0;\n }\n\n {\n // This isn't directly used but is handy for debugging internals:\n this._debugSource = null;\n this._debugOwner = null;\n this._debugNeedsRemount = false;\n this._debugHookTypes = null;\n\n if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {\n Object.preventExtensions(this);\n }\n }\n} // This is a constructor function, rather than a POJO constructor, still\n// please ensure we do the following:\n// 1) Nobody should add any instance methods on this. Instance methods can be\n// more difficult to predict when they get optimized and they are almost\n// never inlined properly in static compilers.\n// 2) Nobody should rely on `instanceof Fiber` for type testing. We should\n// always know when it is a fiber.\n// 3) We might want to experiment with using numeric keys since they are easier\n// to optimize in a non-JIT environment.\n// 4) We can easily go from a constructor to a createFiber object literal if that\n// is faster.\n// 5) It should be easy to port this to a C struct and keep a C implementation\n// compatible.\n\n\nvar createFiber = function (tag, pendingProps, key, mode) {\n // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors\n return new FiberNode(tag, pendingProps, key, mode);\n};\n\nfunction shouldConstruct$1(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction isSimpleFunctionComponent(type) {\n return typeof type === 'function' && !shouldConstruct$1(type) && type.defaultProps === undefined;\n}\nfunction resolveLazyComponentTag(Component) {\n if (typeof Component === 'function') {\n return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;\n } else if (Component !== undefined && Component !== null) {\n var $$typeof = Component.$$typeof;\n\n if ($$typeof === REACT_FORWARD_REF_TYPE) {\n return ForwardRef;\n }\n\n if ($$typeof === REACT_MEMO_TYPE) {\n return MemoComponent;\n }\n }\n\n return IndeterminateComponent;\n} // This is used to create an alternate fiber to do work on.\n\nfunction createWorkInProgress(current, pendingProps) {\n var workInProgress = current.alternate;\n\n if (workInProgress === null) {\n // We use a double buffering pooling technique because we know that we'll\n // only ever need at most two versions of a tree. We pool the \"other\" unused\n // node that we're free to reuse. This is lazily created to avoid allocating\n // extra objects for things that are never updated. It also allow us to\n // reclaim the extra memory if needed.\n workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);\n workInProgress.elementType = current.elementType;\n workInProgress.type = current.type;\n workInProgress.stateNode = current.stateNode;\n\n {\n // DEV-only fields\n workInProgress._debugSource = current._debugSource;\n workInProgress._debugOwner = current._debugOwner;\n workInProgress._debugHookTypes = current._debugHookTypes;\n }\n\n workInProgress.alternate = current;\n current.alternate = workInProgress;\n } else {\n workInProgress.pendingProps = pendingProps; // Needed because Blocks store data on type.\n\n workInProgress.type = current.type; // We already have an alternate.\n // Reset the effect tag.\n\n workInProgress.flags = NoFlags; // The effects are no longer valid.\n\n workInProgress.subtreeFlags = NoFlags;\n workInProgress.deletions = null;\n\n {\n // We intentionally reset, rather than copy, actualDuration & actualStartTime.\n // This prevents time from endlessly accumulating in new commits.\n // This has the downside of resetting values for different priority renders,\n // But works for yielding (the common case) and should support resuming.\n workInProgress.actualDuration = 0;\n workInProgress.actualStartTime = -1;\n }\n } // Reset all effects except static ones.\n // Static effects are not specific to a render.\n\n\n workInProgress.flags = current.flags & StaticMask;\n workInProgress.childLanes = current.childLanes;\n workInProgress.lanes = current.lanes;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so\n // it cannot be shared with the current fiber.\n\n var currentDependencies = current.dependencies;\n workInProgress.dependencies = currentDependencies === null ? null : {\n lanes: currentDependencies.lanes,\n firstContext: currentDependencies.firstContext\n }; // These will be overridden during the parent's reconciliation\n\n workInProgress.sibling = current.sibling;\n workInProgress.index = current.index;\n workInProgress.ref = current.ref;\n\n {\n workInProgress.selfBaseDuration = current.selfBaseDuration;\n workInProgress.treeBaseDuration = current.treeBaseDuration;\n }\n\n {\n workInProgress._debugNeedsRemount = current._debugNeedsRemount;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n case FunctionComponent:\n case SimpleMemoComponent:\n workInProgress.type = resolveFunctionForHotReloading(current.type);\n break;\n\n case ClassComponent:\n workInProgress.type = resolveClassForHotReloading(current.type);\n break;\n\n case ForwardRef:\n workInProgress.type = resolveForwardRefForHotReloading(current.type);\n break;\n }\n }\n\n return workInProgress;\n} // Used to reuse a Fiber for a second pass.\n\nfunction resetWorkInProgress(workInProgress, renderLanes) {\n // This resets the Fiber to what createFiber or createWorkInProgress would\n // have set the values to before during the first pass. Ideally this wouldn't\n // be necessary but unfortunately many code paths reads from the workInProgress\n // when they should be reading from current and writing to workInProgress.\n // We assume pendingProps, index, key, ref, return are still untouched to\n // avoid doing another reconciliation.\n // Reset the effect flags but keep any Placement tags, since that's something\n // that child fiber is setting, not the reconciliation.\n workInProgress.flags &= StaticMask | Placement; // The effects are no longer valid.\n\n var current = workInProgress.alternate;\n\n if (current === null) {\n // Reset to createFiber's initial values.\n workInProgress.childLanes = NoLanes;\n workInProgress.lanes = renderLanes;\n workInProgress.child = null;\n workInProgress.subtreeFlags = NoFlags;\n workInProgress.memoizedProps = null;\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.dependencies = null;\n workInProgress.stateNode = null;\n\n {\n // Note: We don't reset the actualTime counts. It's useful to accumulate\n // actual time across multiple render passes.\n workInProgress.selfBaseDuration = 0;\n workInProgress.treeBaseDuration = 0;\n }\n } else {\n // Reset to the cloned values that createWorkInProgress would've.\n workInProgress.childLanes = current.childLanes;\n workInProgress.lanes = current.lanes;\n workInProgress.child = current.child;\n workInProgress.subtreeFlags = NoFlags;\n workInProgress.deletions = null;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue; // Needed because Blocks store data on type.\n\n workInProgress.type = current.type; // Clone the dependencies object. This is mutated during the render phase, so\n // it cannot be shared with the current fiber.\n\n var currentDependencies = current.dependencies;\n workInProgress.dependencies = currentDependencies === null ? null : {\n lanes: currentDependencies.lanes,\n firstContext: currentDependencies.firstContext\n };\n\n {\n // Note: We don't reset the actualTime counts. It's useful to accumulate\n // actual time across multiple render passes.\n workInProgress.selfBaseDuration = current.selfBaseDuration;\n workInProgress.treeBaseDuration = current.treeBaseDuration;\n }\n }\n\n return workInProgress;\n}\nfunction createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) {\n var mode;\n\n if (tag === ConcurrentRoot) {\n mode = ConcurrentMode;\n\n if (isStrictMode === true) {\n mode |= StrictLegacyMode;\n\n {\n mode |= StrictEffectsMode;\n }\n }\n } else {\n mode = NoMode;\n }\n\n if ( isDevToolsPresent) {\n // Always collect profile timings when DevTools are present.\n // This enables DevTools to start capturing timing at any point–\n // Without some nodes in the tree having empty base times.\n mode |= ProfileMode;\n }\n\n return createFiber(HostRoot, null, null, mode);\n}\nfunction createFiberFromTypeAndProps(type, // React$ElementType\nkey, pendingProps, owner, mode, lanes) {\n var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.\n\n var resolvedType = type;\n\n if (typeof type === 'function') {\n if (shouldConstruct$1(type)) {\n fiberTag = ClassComponent;\n\n {\n resolvedType = resolveClassForHotReloading(resolvedType);\n }\n } else {\n {\n resolvedType = resolveFunctionForHotReloading(resolvedType);\n }\n }\n } else if (typeof type === 'string') {\n fiberTag = HostComponent;\n } else {\n getTag: switch (type) {\n case REACT_FRAGMENT_TYPE:\n return createFiberFromFragment(pendingProps.children, mode, lanes, key);\n\n case REACT_STRICT_MODE_TYPE:\n fiberTag = Mode;\n mode |= StrictLegacyMode;\n\n if ( (mode & ConcurrentMode) !== NoMode) {\n // Strict effects should never run on legacy roots\n mode |= StrictEffectsMode;\n }\n\n break;\n\n case REACT_PROFILER_TYPE:\n return createFiberFromProfiler(pendingProps, mode, lanes, key);\n\n case REACT_SUSPENSE_TYPE:\n return createFiberFromSuspense(pendingProps, mode, lanes, key);\n\n case REACT_SUSPENSE_LIST_TYPE:\n return createFiberFromSuspenseList(pendingProps, mode, lanes, key);\n\n case REACT_OFFSCREEN_TYPE:\n return createFiberFromOffscreen(pendingProps, mode, lanes, key);\n\n case REACT_LEGACY_HIDDEN_TYPE:\n\n // eslint-disable-next-line no-fallthrough\n\n case REACT_SCOPE_TYPE:\n\n // eslint-disable-next-line no-fallthrough\n\n case REACT_CACHE_TYPE:\n\n // eslint-disable-next-line no-fallthrough\n\n case REACT_TRACING_MARKER_TYPE:\n\n // eslint-disable-next-line no-fallthrough\n\n case REACT_DEBUG_TRACING_MODE_TYPE:\n\n // eslint-disable-next-line no-fallthrough\n\n default:\n {\n if (typeof type === 'object' && type !== null) {\n switch (type.$$typeof) {\n case REACT_PROVIDER_TYPE:\n fiberTag = ContextProvider;\n break getTag;\n\n case REACT_CONTEXT_TYPE:\n // This is a consumer\n fiberTag = ContextConsumer;\n break getTag;\n\n case REACT_FORWARD_REF_TYPE:\n fiberTag = ForwardRef;\n\n {\n resolvedType = resolveForwardRefForHotReloading(resolvedType);\n }\n\n break getTag;\n\n case REACT_MEMO_TYPE:\n fiberTag = MemoComponent;\n break getTag;\n\n case REACT_LAZY_TYPE:\n fiberTag = LazyComponent;\n resolvedType = null;\n break getTag;\n }\n }\n\n var info = '';\n\n {\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and \" + 'named imports.';\n }\n\n var ownerName = owner ? getComponentNameFromFiber(owner) : null;\n\n if (ownerName) {\n info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n }\n\n throw new Error('Element type is invalid: expected a string (for built-in ' + 'components) or a class/function (for composite components) ' + (\"but got: \" + (type == null ? type : typeof type) + \".\" + info));\n }\n }\n }\n\n var fiber = createFiber(fiberTag, pendingProps, key, mode);\n fiber.elementType = type;\n fiber.type = resolvedType;\n fiber.lanes = lanes;\n\n {\n fiber._debugOwner = owner;\n }\n\n return fiber;\n}\nfunction createFiberFromElement(element, mode, lanes) {\n var owner = null;\n\n {\n owner = element._owner;\n }\n\n var type = element.type;\n var key = element.key;\n var pendingProps = element.props;\n var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);\n\n {\n fiber._debugSource = element._source;\n fiber._debugOwner = element._owner;\n }\n\n return fiber;\n}\nfunction createFiberFromFragment(elements, mode, lanes, key) {\n var fiber = createFiber(Fragment, elements, key, mode);\n fiber.lanes = lanes;\n return fiber;\n}\n\nfunction createFiberFromProfiler(pendingProps, mode, lanes, key) {\n {\n if (typeof pendingProps.id !== 'string') {\n error('Profiler must specify an \"id\" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id);\n }\n }\n\n var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);\n fiber.elementType = REACT_PROFILER_TYPE;\n fiber.lanes = lanes;\n\n {\n fiber.stateNode = {\n effectDuration: 0,\n passiveEffectDuration: 0\n };\n }\n\n return fiber;\n}\n\nfunction createFiberFromSuspense(pendingProps, mode, lanes, key) {\n var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);\n fiber.elementType = REACT_SUSPENSE_TYPE;\n fiber.lanes = lanes;\n return fiber;\n}\nfunction createFiberFromSuspenseList(pendingProps, mode, lanes, key) {\n var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);\n fiber.elementType = REACT_SUSPENSE_LIST_TYPE;\n fiber.lanes = lanes;\n return fiber;\n}\nfunction createFiberFromOffscreen(pendingProps, mode, lanes, key) {\n var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);\n fiber.elementType = REACT_OFFSCREEN_TYPE;\n fiber.lanes = lanes;\n var primaryChildInstance = {\n isHidden: false\n };\n fiber.stateNode = primaryChildInstance;\n return fiber;\n}\nfunction createFiberFromText(content, mode, lanes) {\n var fiber = createFiber(HostText, content, null, mode);\n fiber.lanes = lanes;\n return fiber;\n}\nfunction createFiberFromHostInstanceForDeletion() {\n var fiber = createFiber(HostComponent, null, null, NoMode);\n fiber.elementType = 'DELETED';\n return fiber;\n}\nfunction createFiberFromDehydratedFragment(dehydratedNode) {\n var fiber = createFiber(DehydratedFragment, null, null, NoMode);\n fiber.stateNode = dehydratedNode;\n return fiber;\n}\nfunction createFiberFromPortal(portal, mode, lanes) {\n var pendingProps = portal.children !== null ? portal.children : [];\n var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);\n fiber.lanes = lanes;\n fiber.stateNode = {\n containerInfo: portal.containerInfo,\n pendingChildren: null,\n // Used by persistent updates\n implementation: portal.implementation\n };\n return fiber;\n} // Used for stashing WIP properties to replay failed work in DEV.\n\nfunction assignFiberPropertiesInDEV(target, source) {\n if (target === null) {\n // This Fiber's initial properties will always be overwritten.\n // We only use a Fiber to ensure the same hidden class so DEV isn't slow.\n target = createFiber(IndeterminateComponent, null, null, NoMode);\n } // This is intentionally written as a list of all properties.\n // We tried to use Object.assign() instead but this is called in\n // the hottest path, and Object.assign() was too slow:\n // https://github.com/facebook/react/issues/12502\n // This code is DEV-only so size is not a concern.\n\n\n target.tag = source.tag;\n target.key = source.key;\n target.elementType = source.elementType;\n target.type = source.type;\n target.stateNode = source.stateNode;\n target.return = source.return;\n target.child = source.child;\n target.sibling = source.sibling;\n target.index = source.index;\n target.ref = source.ref;\n target.pendingProps = source.pendingProps;\n target.memoizedProps = source.memoizedProps;\n target.updateQueue = source.updateQueue;\n target.memoizedState = source.memoizedState;\n target.dependencies = source.dependencies;\n target.mode = source.mode;\n target.flags = source.flags;\n target.subtreeFlags = source.subtreeFlags;\n target.deletions = source.deletions;\n target.lanes = source.lanes;\n target.childLanes = source.childLanes;\n target.alternate = source.alternate;\n\n {\n target.actualDuration = source.actualDuration;\n target.actualStartTime = source.actualStartTime;\n target.selfBaseDuration = source.selfBaseDuration;\n target.treeBaseDuration = source.treeBaseDuration;\n }\n\n target._debugSource = source._debugSource;\n target._debugOwner = source._debugOwner;\n target._debugNeedsRemount = source._debugNeedsRemount;\n target._debugHookTypes = source._debugHookTypes;\n return target;\n}\n\nfunction FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError) {\n this.tag = tag;\n this.containerInfo = containerInfo;\n this.pendingChildren = null;\n this.current = null;\n this.pingCache = null;\n this.finishedWork = null;\n this.timeoutHandle = noTimeout;\n this.context = null;\n this.pendingContext = null;\n this.callbackNode = null;\n this.callbackPriority = NoLane;\n this.eventTimes = createLaneMap(NoLanes);\n this.expirationTimes = createLaneMap(NoTimestamp);\n this.pendingLanes = NoLanes;\n this.suspendedLanes = NoLanes;\n this.pingedLanes = NoLanes;\n this.expiredLanes = NoLanes;\n this.mutableReadLanes = NoLanes;\n this.finishedLanes = NoLanes;\n this.entangledLanes = NoLanes;\n this.entanglements = createLaneMap(NoLanes);\n this.identifierPrefix = identifierPrefix;\n this.onRecoverableError = onRecoverableError;\n\n {\n this.mutableSourceEagerHydrationData = null;\n }\n\n {\n this.effectDuration = 0;\n this.passiveEffectDuration = 0;\n }\n\n {\n this.memoizedUpdaters = new Set();\n var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = [];\n\n for (var _i = 0; _i < TotalLanes; _i++) {\n pendingUpdatersLaneMap.push(new Set());\n }\n }\n\n {\n switch (tag) {\n case ConcurrentRoot:\n this._debugRootType = hydrate ? 'hydrateRoot()' : 'createRoot()';\n break;\n\n case LegacyRoot:\n this._debugRootType = hydrate ? 'hydrate()' : 'render()';\n break;\n }\n }\n}\n\nfunction createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, // TODO: We have several of these arguments that are conceptually part of the\n// host config, but because they are passed in at runtime, we have to thread\n// them through the root constructor. Perhaps we should put them all into a\n// single type, like a DynamicHostConfig that is defined by the renderer.\nidentifierPrefix, onRecoverableError, transitionCallbacks) {\n var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError);\n // stateNode is any.\n\n\n var uninitializedFiber = createHostRootFiber(tag, isStrictMode);\n root.current = uninitializedFiber;\n uninitializedFiber.stateNode = root;\n\n {\n var _initialState = {\n element: initialChildren,\n isDehydrated: hydrate,\n cache: null,\n // not enabled yet\n transitions: null,\n pendingSuspenseBoundaries: null\n };\n uninitializedFiber.memoizedState = _initialState;\n }\n\n initializeUpdateQueue(uninitializedFiber);\n return root;\n}\n\nvar ReactVersion = '18.2.0';\n\nfunction createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.\nimplementation) {\n var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n {\n checkKeyStringCoercion(key);\n }\n\n return {\n // This tag allow us to uniquely identify this as a React Portal\n $$typeof: REACT_PORTAL_TYPE,\n key: key == null ? null : '' + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\n\nvar didWarnAboutNestedUpdates;\nvar didWarnAboutFindNodeInStrictMode;\n\n{\n didWarnAboutNestedUpdates = false;\n didWarnAboutFindNodeInStrictMode = {};\n}\n\nfunction getContextForSubtree(parentComponent) {\n if (!parentComponent) {\n return emptyContextObject;\n }\n\n var fiber = get(parentComponent);\n var parentContext = findCurrentUnmaskedContext(fiber);\n\n if (fiber.tag === ClassComponent) {\n var Component = fiber.type;\n\n if (isContextProvider(Component)) {\n return processChildContext(fiber, Component, parentContext);\n }\n }\n\n return parentContext;\n}\n\nfunction findHostInstanceWithWarning(component, methodName) {\n {\n var fiber = get(component);\n\n if (fiber === undefined) {\n if (typeof component.render === 'function') {\n throw new Error('Unable to find node on an unmounted component.');\n } else {\n var keys = Object.keys(component).join(',');\n throw new Error(\"Argument appears to not be a ReactComponent. Keys: \" + keys);\n }\n }\n\n var hostFiber = findCurrentHostFiber(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n if (hostFiber.mode & StrictLegacyMode) {\n var componentName = getComponentNameFromFiber(fiber) || 'Component';\n\n if (!didWarnAboutFindNodeInStrictMode[componentName]) {\n didWarnAboutFindNodeInStrictMode[componentName] = true;\n var previousFiber = current;\n\n try {\n setCurrentFiber(hostFiber);\n\n if (fiber.mode & StrictLegacyMode) {\n error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName);\n } else {\n error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName);\n }\n } finally {\n // Ideally this should reset to previous but this shouldn't be called in\n // render and there's another warning for that anyway.\n if (previousFiber) {\n setCurrentFiber(previousFiber);\n } else {\n resetCurrentFiber();\n }\n }\n }\n }\n\n return hostFiber.stateNode;\n }\n}\n\nfunction createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {\n var hydrate = false;\n var initialChildren = null;\n return createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);\n}\nfunction createHydrationContainer(initialChildren, // TODO: Remove `callback` when we delete legacy mode.\ncallback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {\n var hydrate = true;\n var root = createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); // TODO: Move this to FiberRoot constructor\n\n root.context = getContextForSubtree(null); // Schedule the initial render. In a hydration root, this is different from\n // a regular update because the initial render must match was was rendered\n // on the server.\n // NOTE: This update intentionally doesn't have a payload. We're only using\n // the update to schedule work on the root fiber (and, for legacy roots, to\n // enqueue the callback if one is provided).\n\n var current = root.current;\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(current);\n var update = createUpdate(eventTime, lane);\n update.callback = callback !== undefined && callback !== null ? callback : null;\n enqueueUpdate(current, update, lane);\n scheduleInitialHydrationOnRoot(root, lane, eventTime);\n return root;\n}\nfunction updateContainer(element, container, parentComponent, callback) {\n {\n onScheduleRoot(container, element);\n }\n\n var current$1 = container.current;\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(current$1);\n\n {\n markRenderScheduled(lane);\n }\n\n var context = getContextForSubtree(parentComponent);\n\n if (container.context === null) {\n container.context = context;\n } else {\n container.pendingContext = context;\n }\n\n {\n if (isRendering && current !== null && !didWarnAboutNestedUpdates) {\n didWarnAboutNestedUpdates = true;\n\n error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\\n\\n' + 'Check the render method of %s.', getComponentNameFromFiber(current) || 'Unknown');\n }\n }\n\n var update = createUpdate(eventTime, lane); // Caution: React DevTools currently depends on this property\n // being called \"element\".\n\n update.payload = {\n element: element\n };\n callback = callback === undefined ? null : callback;\n\n if (callback !== null) {\n {\n if (typeof callback !== 'function') {\n error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);\n }\n }\n\n update.callback = callback;\n }\n\n var root = enqueueUpdate(current$1, update, lane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, current$1, lane, eventTime);\n entangleTransitions(root, current$1, lane);\n }\n\n return lane;\n}\nfunction getPublicRootInstance(container) {\n var containerFiber = container.current;\n\n if (!containerFiber.child) {\n return null;\n }\n\n switch (containerFiber.child.tag) {\n case HostComponent:\n return getPublicInstance(containerFiber.child.stateNode);\n\n default:\n return containerFiber.child.stateNode;\n }\n}\nfunction attemptSynchronousHydration$1(fiber) {\n switch (fiber.tag) {\n case HostRoot:\n {\n var root = fiber.stateNode;\n\n if (isRootDehydrated(root)) {\n // Flush the first scheduled \"update\".\n var lanes = getHighestPriorityPendingLanes(root);\n flushRoot(root, lanes);\n }\n\n break;\n }\n\n case SuspenseComponent:\n {\n flushSync(function () {\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n var eventTime = requestEventTime();\n scheduleUpdateOnFiber(root, fiber, SyncLane, eventTime);\n }\n }); // If we're still blocked after this, we need to increase\n // the priority of any promises resolving within this\n // boundary so that they next attempt also has higher pri.\n\n var retryLane = SyncLane;\n markRetryLaneIfNotHydrated(fiber, retryLane);\n break;\n }\n }\n}\n\nfunction markRetryLaneImpl(fiber, retryLane) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState !== null && suspenseState.dehydrated !== null) {\n suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);\n }\n} // Increases the priority of thenables when they resolve within this boundary.\n\n\nfunction markRetryLaneIfNotHydrated(fiber, retryLane) {\n markRetryLaneImpl(fiber, retryLane);\n var alternate = fiber.alternate;\n\n if (alternate) {\n markRetryLaneImpl(alternate, retryLane);\n }\n}\nfunction attemptContinuousHydration$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n // We ignore HostRoots here because we can't increase\n // their priority and they should not suspend on I/O,\n // since you have to wrap anything that might suspend in\n // Suspense.\n return;\n }\n\n var lane = SelectiveHydrationLane;\n var root = enqueueConcurrentRenderForLane(fiber, lane);\n\n if (root !== null) {\n var eventTime = requestEventTime();\n scheduleUpdateOnFiber(root, fiber, lane, eventTime);\n }\n\n markRetryLaneIfNotHydrated(fiber, lane);\n}\nfunction attemptHydrationAtCurrentPriority$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n // We ignore HostRoots here because we can't increase\n // their priority other than synchronously flush it.\n return;\n }\n\n var lane = requestUpdateLane(fiber);\n var root = enqueueConcurrentRenderForLane(fiber, lane);\n\n if (root !== null) {\n var eventTime = requestEventTime();\n scheduleUpdateOnFiber(root, fiber, lane, eventTime);\n }\n\n markRetryLaneIfNotHydrated(fiber, lane);\n}\nfunction findHostInstanceWithNoPortals(fiber) {\n var hostFiber = findCurrentHostFiberWithNoPortals(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n return hostFiber.stateNode;\n}\n\nvar shouldErrorImpl = function (fiber) {\n return null;\n};\n\nfunction shouldError(fiber) {\n return shouldErrorImpl(fiber);\n}\n\nvar shouldSuspendImpl = function (fiber) {\n return false;\n};\n\nfunction shouldSuspend(fiber) {\n return shouldSuspendImpl(fiber);\n}\nvar overrideHookState = null;\nvar overrideHookStateDeletePath = null;\nvar overrideHookStateRenamePath = null;\nvar overrideProps = null;\nvar overridePropsDeletePath = null;\nvar overridePropsRenamePath = null;\nvar scheduleUpdate = null;\nvar setErrorHandler = null;\nvar setSuspenseHandler = null;\n\n{\n var copyWithDeleteImpl = function (obj, path, index) {\n var key = path[index];\n var updated = isArray(obj) ? obj.slice() : assign({}, obj);\n\n if (index + 1 === path.length) {\n if (isArray(updated)) {\n updated.splice(key, 1);\n } else {\n delete updated[key];\n }\n\n return updated;\n } // $FlowFixMe number or string is fine here\n\n\n updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);\n return updated;\n };\n\n var copyWithDelete = function (obj, path) {\n return copyWithDeleteImpl(obj, path, 0);\n };\n\n var copyWithRenameImpl = function (obj, oldPath, newPath, index) {\n var oldKey = oldPath[index];\n var updated = isArray(obj) ? obj.slice() : assign({}, obj);\n\n if (index + 1 === oldPath.length) {\n var newKey = newPath[index]; // $FlowFixMe number or string is fine here\n\n updated[newKey] = updated[oldKey];\n\n if (isArray(updated)) {\n updated.splice(oldKey, 1);\n } else {\n delete updated[oldKey];\n }\n } else {\n // $FlowFixMe number or string is fine here\n updated[oldKey] = copyWithRenameImpl( // $FlowFixMe number or string is fine here\n obj[oldKey], oldPath, newPath, index + 1);\n }\n\n return updated;\n };\n\n var copyWithRename = function (obj, oldPath, newPath) {\n if (oldPath.length !== newPath.length) {\n warn('copyWithRename() expects paths of the same length');\n\n return;\n } else {\n for (var i = 0; i < newPath.length - 1; i++) {\n if (oldPath[i] !== newPath[i]) {\n warn('copyWithRename() expects paths to be the same except for the deepest key');\n\n return;\n }\n }\n }\n\n return copyWithRenameImpl(obj, oldPath, newPath, 0);\n };\n\n var copyWithSetImpl = function (obj, path, index, value) {\n if (index >= path.length) {\n return value;\n }\n\n var key = path[index];\n var updated = isArray(obj) ? obj.slice() : assign({}, obj); // $FlowFixMe number or string is fine here\n\n updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);\n return updated;\n };\n\n var copyWithSet = function (obj, path, value) {\n return copyWithSetImpl(obj, path, 0, value);\n };\n\n var findHook = function (fiber, id) {\n // For now, the \"id\" of stateful hooks is just the stateful hook index.\n // This may change in the future with e.g. nested hooks.\n var currentHook = fiber.memoizedState;\n\n while (currentHook !== null && id > 0) {\n currentHook = currentHook.next;\n id--;\n }\n\n return currentHook;\n }; // Support DevTools editable values for useState and useReducer.\n\n\n overrideHookState = function (fiber, id, path, value) {\n var hook = findHook(fiber, id);\n\n if (hook !== null) {\n var newState = copyWithSet(hook.memoizedState, path, value);\n hook.memoizedState = newState;\n hook.baseState = newState; // We aren't actually adding an update to the queue,\n // because there is no update we can add for useReducer hooks that won't trigger an error.\n // (There's no appropriate action type for DevTools overrides.)\n // As a result though, React will see the scheduled update as a noop and bailout.\n // Shallow cloning props works as a workaround for now to bypass the bailout check.\n\n fiber.memoizedProps = assign({}, fiber.memoizedProps);\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);\n }\n }\n };\n\n overrideHookStateDeletePath = function (fiber, id, path) {\n var hook = findHook(fiber, id);\n\n if (hook !== null) {\n var newState = copyWithDelete(hook.memoizedState, path);\n hook.memoizedState = newState;\n hook.baseState = newState; // We aren't actually adding an update to the queue,\n // because there is no update we can add for useReducer hooks that won't trigger an error.\n // (There's no appropriate action type for DevTools overrides.)\n // As a result though, React will see the scheduled update as a noop and bailout.\n // Shallow cloning props works as a workaround for now to bypass the bailout check.\n\n fiber.memoizedProps = assign({}, fiber.memoizedProps);\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);\n }\n }\n };\n\n overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) {\n var hook = findHook(fiber, id);\n\n if (hook !== null) {\n var newState = copyWithRename(hook.memoizedState, oldPath, newPath);\n hook.memoizedState = newState;\n hook.baseState = newState; // We aren't actually adding an update to the queue,\n // because there is no update we can add for useReducer hooks that won't trigger an error.\n // (There's no appropriate action type for DevTools overrides.)\n // As a result though, React will see the scheduled update as a noop and bailout.\n // Shallow cloning props works as a workaround for now to bypass the bailout check.\n\n fiber.memoizedProps = assign({}, fiber.memoizedProps);\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);\n }\n }\n }; // Support DevTools props for function components, forwardRef, memo, host components, etc.\n\n\n overrideProps = function (fiber, path, value) {\n fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);\n\n if (fiber.alternate) {\n fiber.alternate.pendingProps = fiber.pendingProps;\n }\n\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);\n }\n };\n\n overridePropsDeletePath = function (fiber, path) {\n fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);\n\n if (fiber.alternate) {\n fiber.alternate.pendingProps = fiber.pendingProps;\n }\n\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);\n }\n };\n\n overridePropsRenamePath = function (fiber, oldPath, newPath) {\n fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);\n\n if (fiber.alternate) {\n fiber.alternate.pendingProps = fiber.pendingProps;\n }\n\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);\n }\n };\n\n scheduleUpdate = function (fiber) {\n var root = enqueueConcurrentRenderForLane(fiber, SyncLane);\n\n if (root !== null) {\n scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);\n }\n };\n\n setErrorHandler = function (newShouldErrorImpl) {\n shouldErrorImpl = newShouldErrorImpl;\n };\n\n setSuspenseHandler = function (newShouldSuspendImpl) {\n shouldSuspendImpl = newShouldSuspendImpl;\n };\n}\n\nfunction findHostInstanceByFiber(fiber) {\n var hostFiber = findCurrentHostFiber(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n return hostFiber.stateNode;\n}\n\nfunction emptyFindFiberByHostInstance(instance) {\n return null;\n}\n\nfunction getCurrentFiberForDevTools() {\n return current;\n}\n\nfunction injectIntoDevTools(devToolsConfig) {\n var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n return injectInternals({\n bundleType: devToolsConfig.bundleType,\n version: devToolsConfig.version,\n rendererPackageName: devToolsConfig.rendererPackageName,\n rendererConfig: devToolsConfig.rendererConfig,\n overrideHookState: overrideHookState,\n overrideHookStateDeletePath: overrideHookStateDeletePath,\n overrideHookStateRenamePath: overrideHookStateRenamePath,\n overrideProps: overrideProps,\n overridePropsDeletePath: overridePropsDeletePath,\n overridePropsRenamePath: overridePropsRenamePath,\n setErrorHandler: setErrorHandler,\n setSuspenseHandler: setSuspenseHandler,\n scheduleUpdate: scheduleUpdate,\n currentDispatcherRef: ReactCurrentDispatcher,\n findHostInstanceByFiber: findHostInstanceByFiber,\n findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,\n // React Refresh\n findHostInstancesForRefresh: findHostInstancesForRefresh ,\n scheduleRefresh: scheduleRefresh ,\n scheduleRoot: scheduleRoot ,\n setRefreshHandler: setRefreshHandler ,\n // Enables DevTools to append owner stacks to error messages in DEV mode.\n getCurrentFiber: getCurrentFiberForDevTools ,\n // Enables DevTools to detect reconciler version rather than renderer version\n // which may not match for third party renderers.\n reconcilerVersion: ReactVersion\n });\n}\n\n/* global reportError */\n\nvar defaultOnRecoverableError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event,\n// emulating an uncaught JavaScript error.\nreportError : function (error) {\n // In older browsers and test environments, fallback to console.error.\n // eslint-disable-next-line react-internal/no-production-logging\n console['error'](error);\n};\n\nfunction ReactDOMRoot(internalRoot) {\n this._internalRoot = internalRoot;\n}\n\nReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function (children) {\n var root = this._internalRoot;\n\n if (root === null) {\n throw new Error('Cannot update an unmounted root.');\n }\n\n {\n if (typeof arguments[1] === 'function') {\n error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n } else if (isValidContainer(arguments[1])) {\n error('You passed a container to the second argument of root.render(...). ' + \"You don't need to pass it again since you already passed it to create the root.\");\n } else if (typeof arguments[1] !== 'undefined') {\n error('You passed a second argument to root.render(...) but it only accepts ' + 'one argument.');\n }\n\n var container = root.containerInfo;\n\n if (container.nodeType !== COMMENT_NODE) {\n var hostInstance = findHostInstanceWithNoPortals(root.current);\n\n if (hostInstance) {\n if (hostInstance.parentNode !== container) {\n error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + \"root.unmount() to empty a root's container.\");\n }\n }\n }\n }\n\n updateContainer(children, root, null, null);\n};\n\nReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function () {\n {\n if (typeof arguments[0] === 'function') {\n error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n }\n }\n\n var root = this._internalRoot;\n\n if (root !== null) {\n this._internalRoot = null;\n var container = root.containerInfo;\n\n {\n if (isAlreadyRendering()) {\n error('Attempted to synchronously unmount a root while React was already ' + 'rendering. React cannot finish unmounting the root until the ' + 'current render has completed, which may lead to a race condition.');\n }\n }\n\n flushSync(function () {\n updateContainer(null, root, null, null);\n });\n unmarkContainerAsRoot(container);\n }\n};\n\nfunction createRoot(container, options) {\n if (!isValidContainer(container)) {\n throw new Error('createRoot(...): Target container is not a DOM element.');\n }\n\n warnIfReactDOMContainerInDEV(container);\n var isStrictMode = false;\n var concurrentUpdatesByDefaultOverride = false;\n var identifierPrefix = '';\n var onRecoverableError = defaultOnRecoverableError;\n var transitionCallbacks = null;\n\n if (options !== null && options !== undefined) {\n {\n if (options.hydrate) {\n warn('hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.');\n } else {\n if (typeof options === 'object' && options !== null && options.$$typeof === REACT_ELEMENT_TYPE) {\n error('You passed a JSX element to createRoot. You probably meant to ' + 'call root.render instead. ' + 'Example usage:\\n\\n' + ' let root = createRoot(domContainer);\\n' + ' root.render(<App />);');\n }\n }\n }\n\n if (options.unstable_strictMode === true) {\n isStrictMode = true;\n }\n\n if (options.identifierPrefix !== undefined) {\n identifierPrefix = options.identifierPrefix;\n }\n\n if (options.onRecoverableError !== undefined) {\n onRecoverableError = options.onRecoverableError;\n }\n\n if (options.transitionCallbacks !== undefined) {\n transitionCallbacks = options.transitionCallbacks;\n }\n }\n\n var root = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);\n markContainerAsRoot(root.current, container);\n var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;\n listenToAllSupportedEvents(rootContainerElement);\n return new ReactDOMRoot(root);\n}\n\nfunction ReactDOMHydrationRoot(internalRoot) {\n this._internalRoot = internalRoot;\n}\n\nfunction scheduleHydration(target) {\n if (target) {\n queueExplicitHydrationTarget(target);\n }\n}\n\nReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration;\nfunction hydrateRoot(container, initialChildren, options) {\n if (!isValidContainer(container)) {\n throw new Error('hydrateRoot(...): Target container is not a DOM element.');\n }\n\n warnIfReactDOMContainerInDEV(container);\n\n {\n if (initialChildren === undefined) {\n error('Must provide initial children as second argument to hydrateRoot. ' + 'Example usage: hydrateRoot(domContainer, <App />)');\n }\n } // For now we reuse the whole bag of options since they contain\n // the hydration callbacks.\n\n\n var hydrationCallbacks = options != null ? options : null; // TODO: Delete this option\n\n var mutableSources = options != null && options.hydratedSources || null;\n var isStrictMode = false;\n var concurrentUpdatesByDefaultOverride = false;\n var identifierPrefix = '';\n var onRecoverableError = defaultOnRecoverableError;\n\n if (options !== null && options !== undefined) {\n if (options.unstable_strictMode === true) {\n isStrictMode = true;\n }\n\n if (options.identifierPrefix !== undefined) {\n identifierPrefix = options.identifierPrefix;\n }\n\n if (options.onRecoverableError !== undefined) {\n onRecoverableError = options.onRecoverableError;\n }\n }\n\n var root = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);\n markContainerAsRoot(root.current, container); // This can't be a comment node since hydration doesn't work on comment nodes anyway.\n\n listenToAllSupportedEvents(container);\n\n if (mutableSources) {\n for (var i = 0; i < mutableSources.length; i++) {\n var mutableSource = mutableSources[i];\n registerMutableSourceForHydration(root, mutableSource);\n }\n }\n\n return new ReactDOMHydrationRoot(root);\n}\nfunction isValidContainer(node) {\n return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers ));\n} // TODO: Remove this function which also includes comment nodes.\n// We only use it in places that are currently more relaxed.\n\nfunction isValidContainerLegacy(node) {\n return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));\n}\n\nfunction warnIfReactDOMContainerInDEV(container) {\n {\n if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {\n error('createRoot(): Creating roots directly with document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try using a container element created ' + 'for your app.');\n }\n\n if (isContainerMarkedAsRoot(container)) {\n if (container._reactRootContainer) {\n error('You are calling ReactDOMClient.createRoot() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.');\n } else {\n error('You are calling ReactDOMClient.createRoot() on a container that ' + 'has already been passed to createRoot() before. Instead, call ' + 'root.render() on the existing root instead if you want to update it.');\n }\n }\n }\n}\n\nvar ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;\nvar topLevelUpdateWarnings;\n\n{\n topLevelUpdateWarnings = function (container) {\n if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {\n var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current);\n\n if (hostInstance) {\n if (hostInstance.parentNode !== container) {\n error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');\n }\n }\n }\n\n var isRootRenderedBySomeReact = !!container._reactRootContainer;\n var rootEl = getReactRootElementInContainer(container);\n var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));\n\n if (hasNonRootReactChild && !isRootRenderedBySomeReact) {\n error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');\n }\n\n if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {\n error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');\n }\n };\n}\n\nfunction getReactRootElementInContainer(container) {\n if (!container) {\n return null;\n }\n\n if (container.nodeType === DOCUMENT_NODE) {\n return container.documentElement;\n } else {\n return container.firstChild;\n }\n}\n\nfunction noopOnRecoverableError() {// This isn't reachable because onRecoverableError isn't called in the\n // legacy API.\n}\n\nfunction legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) {\n if (isHydrationContainer) {\n if (typeof callback === 'function') {\n var originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(root);\n originalCallback.call(instance);\n };\n }\n\n var root = createHydrationContainer(initialChildren, callback, container, LegacyRoot, null, // hydrationCallbacks\n false, // isStrictMode\n false, // concurrentUpdatesByDefaultOverride,\n '', // identifierPrefix\n noopOnRecoverableError);\n container._reactRootContainer = root;\n markContainerAsRoot(root.current, container);\n var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;\n listenToAllSupportedEvents(rootContainerElement);\n flushSync();\n return root;\n } else {\n // First clear any existing content.\n var rootSibling;\n\n while (rootSibling = container.lastChild) {\n container.removeChild(rootSibling);\n }\n\n if (typeof callback === 'function') {\n var _originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(_root);\n\n _originalCallback.call(instance);\n };\n }\n\n var _root = createContainer(container, LegacyRoot, null, // hydrationCallbacks\n false, // isStrictMode\n false, // concurrentUpdatesByDefaultOverride,\n '', // identifierPrefix\n noopOnRecoverableError);\n\n container._reactRootContainer = _root;\n markContainerAsRoot(_root.current, container);\n\n var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;\n\n listenToAllSupportedEvents(_rootContainerElement); // Initial mount should not be batched.\n\n flushSync(function () {\n updateContainer(initialChildren, _root, parentComponent, callback);\n });\n return _root;\n }\n}\n\nfunction warnOnInvalidCallback$1(callback, callerName) {\n {\n if (callback !== null && typeof callback !== 'function') {\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n }\n}\n\nfunction legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {\n {\n topLevelUpdateWarnings(container);\n warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');\n }\n\n var maybeRoot = container._reactRootContainer;\n var root;\n\n if (!maybeRoot) {\n // Initial mount\n root = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate);\n } else {\n root = maybeRoot;\n\n if (typeof callback === 'function') {\n var originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(root);\n originalCallback.call(instance);\n };\n } // Update\n\n\n updateContainer(children, root, parentComponent, callback);\n }\n\n return getPublicRootInstance(root);\n}\n\nfunction findDOMNode(componentOrElement) {\n {\n var owner = ReactCurrentOwner$3.current;\n\n if (owner !== null && owner.stateNode !== null) {\n var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;\n\n if (!warnedAboutRefsInRender) {\n error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentNameFromType(owner.type) || 'A component');\n }\n\n owner.stateNode._warnedAboutRefsInRender = true;\n }\n }\n\n if (componentOrElement == null) {\n return null;\n }\n\n if (componentOrElement.nodeType === ELEMENT_NODE) {\n return componentOrElement;\n }\n\n {\n return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');\n }\n}\nfunction hydrate(element, container, callback) {\n {\n error('ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot ' + 'instead. Until you switch to the new API, your app will behave as ' + \"if it's running React 17. Learn \" + 'more: https://reactjs.org/link/switch-to-createroot');\n }\n\n if (!isValidContainerLegacy(container)) {\n throw new Error('Target container is not a DOM element.');\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. ' + 'Did you mean to call hydrateRoot(container, element)?');\n }\n } // TODO: throw or warn if we couldn't hydrate?\n\n\n return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);\n}\nfunction render(element, container, callback) {\n {\n error('ReactDOM.render is no longer supported in React 18. Use createRoot ' + 'instead. Until you switch to the new API, your app will behave as ' + \"if it's running React 17. Learn \" + 'more: https://reactjs.org/link/switch-to-createroot');\n }\n\n if (!isValidContainerLegacy(container)) {\n throw new Error('Target container is not a DOM element.');\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');\n }\n }\n\n return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);\n}\nfunction unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n {\n error('ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported ' + 'in React 18. Consider using a portal instead. Until you switch to ' + \"the createRoot API, your app will behave as if it's running React \" + '17. Learn more: https://reactjs.org/link/switch-to-createroot');\n }\n\n if (!isValidContainerLegacy(containerNode)) {\n throw new Error('Target container is not a DOM element.');\n }\n\n if (parentComponent == null || !has(parentComponent)) {\n throw new Error('parentComponent must be a valid React Component');\n }\n\n return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);\n}\nfunction unmountComponentAtNode(container) {\n if (!isValidContainerLegacy(container)) {\n throw new Error('unmountComponentAtNode(...): Target container is not a DOM element.');\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?');\n }\n }\n\n if (container._reactRootContainer) {\n {\n var rootEl = getReactRootElementInContainer(container);\n var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);\n\n if (renderedByDifferentReact) {\n error(\"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by another copy of React.');\n }\n } // Unmount should not be batched.\n\n\n flushSync(function () {\n legacyRenderSubtreeIntoContainer(null, null, container, false, function () {\n // $FlowFixMe This should probably use `delete container._reactRootContainer`\n container._reactRootContainer = null;\n unmarkContainerAsRoot(container);\n });\n }); // If you call unmountComponentAtNode twice in quick succession, you'll\n // get `true` twice. That's probably fine?\n\n return true;\n } else {\n {\n var _rootEl = getReactRootElementInContainer(container);\n\n var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl)); // Check if the container itself is a React root node.\n\n var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer;\n\n if (hasNonRootReactChild) {\n error(\"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');\n }\n }\n\n return false;\n }\n}\n\nsetAttemptSynchronousHydration(attemptSynchronousHydration$1);\nsetAttemptContinuousHydration(attemptContinuousHydration$1);\nsetAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);\nsetGetCurrentUpdatePriority(getCurrentUpdatePriority);\nsetAttemptHydrationAtPriority(runWithPriority);\n\n{\n if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype\n Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype\n Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {\n error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');\n }\n}\n\nsetRestoreImplementation(restoreControlledState$3);\nsetBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync);\n\nfunction createPortal$1(children, container) {\n var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (!isValidContainer(container)) {\n throw new Error('Target container is not a DOM element.');\n } // TODO: pass ReactDOM portal implementation as third argument\n // $FlowFixMe The Flow type is opaque but there's no way to actually create it.\n\n\n return createPortal(children, container, null, key);\n}\n\nfunction renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);\n}\n\nvar Internals = {\n usingClientEntryPoint: false,\n // Keep in sync with ReactTestUtils.js.\n // This is an array for better minification.\n Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1]\n};\n\nfunction createRoot$1(container, options) {\n {\n if (!Internals.usingClientEntryPoint && !false) {\n error('You are importing createRoot from \"react-dom\" which is not supported. ' + 'You should instead import it from \"react-dom/client\".');\n }\n }\n\n return createRoot(container, options);\n}\n\nfunction hydrateRoot$1(container, initialChildren, options) {\n {\n if (!Internals.usingClientEntryPoint && !false) {\n error('You are importing hydrateRoot from \"react-dom\" which is not supported. ' + 'You should instead import it from \"react-dom/client\".');\n }\n }\n\n return hydrateRoot(container, initialChildren, options);\n} // Overload the definition to the two valid signatures.\n// Warning, this opts-out of checking the function body.\n\n\n// eslint-disable-next-line no-redeclare\nfunction flushSync$1(fn) {\n {\n if (isAlreadyRendering()) {\n error('flushSync was called from inside a lifecycle method. React cannot ' + 'flush when React is already rendering. Consider moving this call to ' + 'a scheduler task or micro task.');\n }\n }\n\n return flushSync(fn);\n}\nvar foundDevTools = injectIntoDevTools({\n findFiberByHostInstance: getClosestInstanceFromNode,\n bundleType: 1 ,\n version: ReactVersion,\n rendererPackageName: 'react-dom'\n});\n\n{\n if (!foundDevTools && canUseDOM && window.top === window.self) {\n // If we're in Chrome or Firefox, provide a download link if not installed.\n if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {\n var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.\n\n if (/^(https?|file):$/.test(protocol)) {\n // eslint-disable-next-line react-internal/no-production-logging\n console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://reactjs.org/link/react-devtools' + (protocol === 'file:' ? '\\nYou might need to use a local HTTP server (instead of file://): ' + 'https://reactjs.org/link/react-devtools-faq' : ''), 'font-weight:bold');\n }\n }\n }\n}\n\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;\nexports.createPortal = createPortal$1;\nexports.createRoot = createRoot$1;\nexports.findDOMNode = findDOMNode;\nexports.flushSync = flushSync$1;\nexports.hydrate = hydrate;\nexports.hydrateRoot = hydrateRoot$1;\nexports.render = render;\nexports.unmountComponentAtNode = unmountComponentAtNode;\nexports.unstable_batchedUpdates = batchedUpdates$1;\nexports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleSt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dmFyIHByb3BzID0ge1xuICAgICAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIHdyaXRhYmxlOiB0cnVlXG4gICAgICB9OyAvLyAkRmxvd0ZpeE1lIEZsb3cgdGhpbmtzIGNvbnNvbGUgaXMgaW1tdXRhYmxlLlxuXG4gICAgICBPYmplY3QuZGVmaW5lUHJvcGVydGllcyhjb25zb2xlLCB7XG4gICAgICAgIGxvZzogYXNzaWduKHt9LCBwcm9wcywge1xuICAgICAgICAgIHZhbHVlOiBwcmV2TG9nXG4gICAgICAgIH0pLFxuICAgICAgICBpbmZvOiBhc3NpZ24oe30sIHByb3BzLCB7XG4gICAgICAgICAgdmFsdWU6IHByZXZJbmZvXG4gICAgICAgIH0pLFxuICAgICAgICB3YXJuOiBhc3NpZ24oe30sIHByb3BzLCB7XG4gICAgICAgICAgdmFsdWU6IHByZXZXYXJuXG4gICAgICAgIH0pLFxuICAgICAgICBlcnJvcjogYXNzaWduKHt9LCBwcm9wcywge1xuICAgICAgICAgIHZhbHVlOiBwcmV2RXJyb3JcbiAgICAgICAgfSksXG4gICAgICAgIGdyb3VwOiBhc3NpZ24oe30sIHByb3BzLCB7XG4gICAgICAgICAgdmFsdWU6IHByZXZHcm91cFxuICAgICAgICB9KSxcbiAgICAgICAgZ3JvdXBDb2xsYXBzZWQ6IGFzc2lnbih7fSwgcHJvcHMsIHtcbiAgICAgICAgICB2YWx1ZTogcHJldkdyb3VwQ29sbGFwc2VkXG4gICAgICAgIH0pLFxuICAgICAgICBncm91cEVuZDogYXNzaWduKHt9LCBwcm9wcywge1xuICAgICAgICAgIHZhbHVlOiBwcmV2R3JvdXBFbmRcbiAgICAgICAgfSlcbiAgICAgIH0pO1xuICAgICAgLyogZXNsaW50LWVuYWJsZSByZWFjdC1pbnRlcm5hbC9uby1wcm9kdWN0aW9uLWxvZ2dpbmcgKi9cbiAgICB9XG5cbiAgICBpZiAoZGlzYWJsZW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mVzW3NdLnJlcGxhY2UoJyBhdCBuZXcgJywgJyBhdCAnKTsgLy8gSWYgb3VyIGNvbXBvbmVudCBmcmFtZSBpcyBsYWJlbGVkIFwiPGFub255bW91cz5cIlxuICAgICAgICAgICAgICAgIC8vIGJ1dCB3ZSBoYXZlIGEgdXNlci1wcm92aWRlZCBcImRpc3BsYXlOYW1lXCJcbiAgICAgICAgICAgICAgICAvLyBzcGxpY2UgaXQgaW4gdG8gbWFrZSB0aGUgc3RhY2sgbW9yZSByZWFkYWJsZS5cblxuXG4gICAgICAgICAgICAgICAgaWYgKGZuLmRpc3BsYXlOYW1lICYmIF9mcmFtZS5pbmNsdWRlcygnPGFub255bW91cz4nKSkge1xuICAgICAgICAgICAgICAgICAgX2ZyYW1lID0gX2ZyYW1lLnJlcGxhY2UoJzxhbm9ueW1vdXM+JywgZm4uZGlzcGxheU5hbWUpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZm4gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50RnJhbWVDYWNoZS5zZXQoZm4sIF9mcmFtZSk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSAvLyBSZXR1cm4gdGhlIGxpbmUgd2UgZm91bmQuXG5cblxuICAgICAgICAgICAgICAgIHJldHVybiBfZnJhbWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gd2hpbGUgKHMgPj0gMSAmJiBjID49IDApO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9IGZpbmFsbHkge1xuICAgIHJlZW50cnkgPSBmYWxzZTtcblxuICAgIHtcbiAgICAgIFJlYWN0Q3VycmVudERpc3BhdGNoZXIuY3VycmVudCA9IHByZXZpb3VzRGlzcGF0Y2hlcjtcbiAgICAgIHJlZ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FRfVFlQRTpcbiAgICAgICAgdmFyIGNvbnRleHQgPSB0eXBlO1xuICAgICAgICByZXR1cm4gZ2V0Q29udGV4dE5hbWUoY29udGV4dCkgKyAnLkNvbnN1bWVyJztcblxuICAgICAgY2FzZSBSRUFDVF9QUk9WSURFUl9UWVBFOlxuICAgICAgICB2YXIgcHJvdmlkZXIgPSB0eXBlO1xuICAgICAgICByZXR1cm4gZ2V0Q29udGV4dE5hbWUocHJvdmlkZXIuX2NvbnRleHQpICsgJy5Qcm92aWRlcic7XG5cbiAgICAgIGNhc2UgUkVBQ1RfRk9SV0FSRF9SRUZfVFlQRTpcbiAgICAgICAgcmV0dXJuIGdldFdyYXBwZWROYW1lKHR5cGUsIHR5cGUucmVuZGVyLCAnRm9yd2FyZFJlZicpO1xuXG4gICAgICBjYXNlIFJFQUNUX01FTU9fVFlQRTpcbiAgICAgICAgdmFyIG91dGVyTmFtZSA9IHR5cGUuZGlzcGxheU5hbWUgfHwgbnVsbDtcblxuICAgICAgICBpZiAob3V0ZXJOYW1lICE9PSBudWxsKSB7XG4gICAgICAgICAgcmV0dXJuIG91dGVyTmFtZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBnZXRDb21wb25lbnROYW1lRnJvbVR5cGUodHlwZS50eXBlKSB8fCAnTWVtbyc7XG5cbiAgICAgIGNhc2UgUkVBQ1RfTEFaWV9UWVBFOlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIGxhenlDb21wb25lbnQgPSB0eXBlO1xuICAgICAgICAgIHZhciBwYXlsb2FkID0gbGF6eUNvbXBvbmVudC5fcGF5bG9hZDtcbiAgICAgICAgICB2YXIgaW5pdCA9IGxhenlDb21wb25lbnQuX2luaXQ7XG5cbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIGdldENvbXBvbmVudE5hbWVGcm9tVHlwZShpbml0KHBheWxvYWQpKTtcbiAgICAgICAgICB9IGNhdGNoICh4KSB7XG4gICAgICAgICAgICByZXR1cm4g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ICAgICAgICAgICovXG4zMjtcbnZhciBDYWxsYmFjayA9XG4vKiAgICAgICAgICAgICAgICAgICAgICovXG42NDtcbnZhciBEaWRDYXB0dXJlID1cbi8qICAgICAgICAgICAgICAgICAgICovXG4xMjg7XG52YXIgRm9yY2VDbGllbnRSZW5kZXIgPVxuLyogICAgICAgICAgICAqL1xuMjU2O1xudmFyIFJlZiA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICAgKi9cbjUxMjtcbnZhciBTbmFwc2hvdCA9XG4vKiAgICAgICAgICAgICAgICAgICAgICovXG4xMDI0O1xudmFyIFBhc3NpdmUgPVxuLyogICAgICAgICAgICAgICAgICAgICAgKi9cbjIwNDg7XG52YXIgSHlkcmF0aW5nID1cbi8qICAgICAgICAgICAgICAgICAgICAqL1xuNDA5NjtcbnZhciBWaXNpYmlsaXR5ID1cbi8qICAgICAgICAgICAgICAgICAgICovXG44MTkyO1xudmFyIFN0b3JlQ29uc2lzdGVuY3kgPVxuLyogICAgICAgICAgICAgKi9cbjE2Mzg0O1xudmFyIExpZmVjeWNsZUVmZmVjdE1hc2sgPSBQYXNzaXZlIHwgVXBkYXRlIHwgQ2FsbGJhY2sgfCBSZWYgfCBTbmFwc2hvdCB8IFN0b3JlQ29uc2lzdGVuY3k7IC8vIFVuaW9uIG9mIGFsbCBjb21taXQgZmxhZ3MgKGZsYWdzIHdpdGggdGhlIGxpZmV0aW1lIG9mIGEgcGFydGljdWxhciBjb21taXQpXG5cbnZhciBIb3N0RWZmZWN0TWFzayA9XG4vKiAgICAgICAgICAgICAgICovXG4zMjc2NzsgLy8gVGhlc2UgYXJlIG5vdCByZWFsbHkgc2lkZSBlZmZlY3RzLCBidXQgd2Ugc3RpbGwgcmV1c2UgdGhpcyBmaWVsZC5cblxudmFyIEluY29tcGxldGUgPVxuLyogICAgICAgICAgICAgICAgICAgKi9cbjMyNzY4O1xudmFyIFNob3VsZENhcHR1cmUgPVxuLyogICAgICAgICAgICAgICAgKi9cbjY1NTM2O1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xuICAgICAgLy8gd2hpY2ggY2hpbGQgYmVsb25ncyB0byB3aGljaCBzZXQuXG4gICAgICAvL1xuICAgICAgLy8gU2VhcmNoIHBhcmVudCBBJ3MgY2hpbGQgc2V0XG4gICAgICB2YXIgZGlkRmluZENoaWxkID0gZmFsc2U7XG4gICAgICB2YXIgX2NoaWxkID0gcGFyZW50QS5jaGlsZDtcblxuICAgICAgd2hpbGUgKF9jaGlsZCkge1xuICAgICAgICBpZiAoX2NoaWxkID09PSBhKSB7XG4gICAgICAgICAgZGlkRmluZENoaWxkID0gdHJ1ZTtcbiAgICAgICAgICBhID0gcGFyZW50QTtcbiAgICAgICAgICBiID0gcGFyZW50QjtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChfY2hpbGQgPT09IGIpIHtcbiAgICAgICAgICBkaWRGaW5kQ2hpbGQgPSB0cnVlO1xuICAgICAgICAgIGIgPSBwYXJlbnRBO1xuICAgICAgICAgIGEgPSBwYXJlbnRCO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgICAgX2NoaWxkID0gX2NoaWxkLnNpYmxpbmc7XG4gICAgICB9XG5cbiAgICAgIGlmICghZGlkRmluZENoaWxkKSB7XG4gICAgICAgIC8vIFNlYXJjaCBwYXJlbnQgQidzIGNoaWxkIHNldFxuICAgICAgICBfY2hpbGQgPSBwYXJlbnRCLmNoaWxkO1xuXG4gICAgICAgIHdoaWxlIChfY2hpbGQpIHtcbiAgICAgICAgICBpZiAoX2NoaWxkID09PSBhKSB7XG4gICAgICAgICAgICBkaWRGaW5kQ2hpbGQgPSB0cnVlO1xuICAgICAgICAgICAgYSA9IHBhcmVudEI7XG4gICAgICAgICAgICBiID0gcGFyZW50QTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChfY2hpbGQgPT09IGIpIHtcbiAgICAgICAgICAgIGRpZEZpbmRDaGlsZCA9IHRydWU7XG4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VvZiBpbmplY3RlZEhvb2sub25Db21taXRGaWJlclJvb3QgPT09ICdmdW5jdGlvbicpIHtcbiAgICB0cnkge1xuICAgICAgdmFyIGRpZEVycm9yID0gKHJvb3QuY3VycmVudC5mbGFncyAmIERpZENhcHR1cmUpID09PSBEaWRDYXB0dXJlO1xuXG4gICAgICBpZiAoZW5hYmxlUHJvZmlsZXJUaW1lcikge1xuICAgICAgICB2YXIgc2NoZWR1bGVyUHJpb3JpdHk7XG5cbiAgICAgICAgc3dpdGNoIChldmVudFByaW9yaXR5KSB7XG4gICAgICAgICAgY2FzZSBEaXNjcmV0ZUV2ZW50UHJpb3JpdHk6XG4gICAgICAgICAgICBzY2hlZHVsZXJQcmlvcml0eSA9IEltbWVkaWF0ZVByaW9yaXR5O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIENvbnRpbnVvdXNFdmVudFByaW9yaXR5OlxuICAgICAgICAgICAgc2NoZWR1bGVyUHJpb3JpdHkgPSBVc2VyQmxvY2tpbmdQcmlvcml0eTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSBEZWZhdWx0RXZlbnRQcmlvcml0eTpcbiAgICAgICAgICAgIHNjaGVkdWxlclByaW9yaXR5ID0gTm9ybWFsUHJpb3JpdHk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgSWRsZUV2ZW50UHJpb3JpdHk6XG4gICAgICAgICAgICBzY2hlZHVsZXJQcmlvcml0eSA9IElkbGVQcmlvcml0eTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHNjaGVkdWxlclByaW9yaXR5ID0gTm9ybWFsUHJpb3JpdHk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIGluamVjdGVkSG9vay5vbkNvbW1pdEZpYmVyUm9vdChyZW5kZXJlcklELCByb290LCBzY2hlZHVsZXJQcm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sejMyRmFsbGJhY2soeCkge1xuICB2YXIgYXNVaW50ID0geCA+Pj4gMDtcblxuICBpZiAoYXNVaW50ID09PSAwKSB7XG4gICAgcmV0dXJuIDMyO1xuICB9XG5cbiAgcmV0dXJuIDMxIC0gKGxvZyhhc1VpbnQpIC8gTE4yIHwgMCkgfCAwO1xufVxuXG4vLyBJZiB0aG9zZSB2YWx1ZXMgYXJlIGNoYW5nZWQgdGhhdCBwYWNrYWdlIHNob3VsZCBiZSByZWJ1aWx0IGFuZCByZWRlcGxveWVkLlxuXG52YXIgVG90YWxMYW5lcyA9IDMxO1xudmFyIE5vTGFuZXMgPVxuLyogICAgICAgICAgICAgICAgICAgICAgICAqL1xuMDtcbnZhciBOb0xhbmUgPVxuLyogICAgICAgICAgICAgICAgICAgICAgICAgICovXG4wO1xudmFyIFN5bmNMYW5lID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAgKi9cbjE7XG52YXIgSW5wdXRDb250aW51b3VzSHlkcmF0aW9uTGFuZSA9XG4vKiAgICAqL1xuMjtcbnZhciBJbnB1dENvbnRpbnVvdXNMYW5lID1cbi8qICAgICAgICAgICAgICovXG40O1xudmFyIERlZmF1bHRIeWRyYXRpb25MYW5lID1cbi8qICAgICAgICAgICAgKi9cbjg7XG52YXIgRGVmYXVsdExhbmUgPVxuLyogICAgICAgICAgICAgICAgICAgICAqL1xuMTY7XG52YXIgVHJhbnNpdGlvbkh5ZHJhdGlvbkxhbmUgPVxuLyogICAgICAgICAgICAgICAgKi9cbjMyO1xudmFyIFRyYW5zaXRpb25MYW5lcyA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgKi9cbjQxOTQyNDA7XG52YXIgVHJhbnNpdGlvbkxhbmUxID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAgKi9cbjY0O1xudmFyIFRyYW5zaXRpb25MYW5lMiA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICovXG4xMjg7XG52YXIgVHJhbnNpdGlvbkxhbmUzID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAgKi9cbjI1NjtcbnZhciBUcmFuc2l0aW9uTGFuZTQgPVxuLyogICAgICAgICAgICAgICAgICAgICAgICAqL1xuNTEyO1xudmFyIFRyYW5zaXRpb25MYW5lNSA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICovXG4xMDI0O1xudmFyIFRyYW5zaXRpb25MYW5lNiA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICovXG4yMDQ4O1xudmFyIFRyYW5zaXRpb25MYW5lNyA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICovXG40MDk2O1xudmFyIFRyYW5zaXRpb25MYW5lOCA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICovXG44MTkyO1xudmFyIFRyYW5zaXRpb25MYW5lOSA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICovXG4xNjM4NDtcbnZhciBUcmFuc2l0aW9uTGFuZTEwID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAqL1xuMzI3Njg7XG52YXIgVHJhbnNpdGlvbkxhbmUxMSA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgKi9cbjY1NTM2O1xudmFyIFRyYW5zaXRpb25MYW5lMTIgPVxuLyogICAgICAgICAgICAgICAgICAgICAgICovXG4xMzEwNzI7XG52YXIgVHJhbnNpdGlvbkxhbmUxMyA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgKi9cbjI2MjE0NDtcbnZhciBUcmFuc2l0aW9uTGFuZTE0ID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAqL1xuNTI0Mjg4O1xudmFyIFRyYW5zaXRpb25MYW5lMTUgPVxuLyogICAgICAgICAgICAgICAgICAgICAgICovXG4xMDQ4NTc2O1xudmFyIFRyYW5zaXRpb25MYW5lMTYgPVxuLyogICAgICAgICAgICAgICAgICAgICAgICovXG4yMDk3MTUyO1xudmFyIFJldHJ5TGFuZXMgPVxuLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgKi9cbjEzMDAyMzQyNDtcbnZhciBSZXRyeUxhbmUxID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuNDE5NDMwNDtcbnZhciBSZXRyeUxhbmUyID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuODM4ODYwODtcbnZhciBSZXRyeUxhbmUzID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuMTY3NzcyMTY7XG52YXIgUmV0cnlMYW5lNCA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi9cbjMzNTU0NDMyO1xudmFyIFJldHJ5TGFuZTUgPVxuLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICovXG42NzEwODg2NDtcbnZhciBTb21lUmV0cnlMYW5lID0gUmV0cnlMYW5lMTtcbnZhciBTZWxlY3RpdmVIeWRyYXRpb25MYW5lID1cbi8qICAgICAgICAgICovXG4xMzQyMTc3Mjg7XG52YXIgTm9uSWRsZUxhbmVzID1cbi8qICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuMjY4NDM1NDU1O1xudmFyIElkbGVIeWRyYXRpb25MYW5lID1cbi8qICAgICAgICAgICAgICAgKi9cbjI2ODQzNTQ1NjtcbnZhciBJZGxlTGFuZSA9XG4vKiAgICAgICAgICAgICAgICAgICAgICAgICovXG41MzY4NzA5MTI7XG52YXIgT2Zmc2NyZWVuTGFuZSA9XG4vKiAgICAgICAgICAgICAgICAgICAqL1xuMTA3Mzc0MTgyNDsgLy8gVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciB0aGUgZXhwZXJpbWVudGFsIHRpbWVsaW5lIChyZWFjdC1kZXZ0b29scy10aW1lbGluZSlcbi8vIEl0IHNob3VsZCBiZSBrZXB0IGluIHN5bmMgd2l0aCB0aGUgTGFuZXMgdmFsdWVzIGFib3ZlLlxuXG5mdW5jdGlvbiBnZXRMYWJlbEZvckxhbmUobGFuZSkge1xuICB7XG4gICAgaWYgKGxhbmUgJiBTeW5jTGFuZSkge1xuICAgICAgcmV0dXJuICdTeW5jJztcbiAgICB9XG5cbiAgICBpZiAobGFuZSAmIElucHV0Q29udGludW91c0h5ZHJhdGlvbkxhbmUpIHtcbiAgICAgIHJldHVybiAnSW5wdXRDb250aW51b3VzSHlkcmF0aW9uJztcbiAgICB9XG5cbiAgICBpZiAobGFuZSAmIElucHV0Q29udGludW91c0xhbmUpIHtcbiAgICAgIHJldHVybiAnSW5wdXRDb250aW51b3VzJztcbiAgICB9XG5cbiAgICBpZiAobGFuZSAmIERlZmF1bHRIeWRyYXRpb25MYW5lKSB7XG4gICAgICByZXR1cm4gJ0RlZmF1bHRIeWRyYXRpb24nO1xuICAgIH1cblxuICAgIGlmIChsYW5lICYgRGVmYXVsdExhbmUpIHtcbiAgICAgIHJldHVybiAnRGVmYXVsdCc7XG4gICAgfVxuXG4gICAgaWYgKGxhbmUgJiBUcmFuc2l0aW9uSHlkcmF0aW9uTGFuZSkge1xuICAgICAgcmV0dXJuICdUcmFuc2l0aW9uSHlkcmF0aW9uJztcbiAgICB9XG5cbiAgICBpZiAobGFuZSAmIFRyYW5zaXRpb25MYW5lcykge1xuICAgICAgcmV0dXJuICdUcmFuc2l0aW9uJztcbiAgICB9XG5cbiAgICBpZiAobGFuZSAmIFJldHJ5TGFuZXMpIHtcbiAgICAgIHJldHVybiAnUmV0cnknO1xuICAgIH1cblxuICAgIGlmIChsYW5lICYgU2VsZWN0aXZlSHlkcmF0aW9uTGFuZSkge1xuICAgICAgcmV0dXJuICdTZWxlY3RpdmVIeWRyYXRpb24nO1xuICAgIH1cblxuICAgIGlmIChsYW5lICYgSWRsZUh5ZHJhdGlvbkxhbmUpIHtcbiAgICAgIHJldHVybiAnSWRsZUh5ZHJhdGlvbic7XG4gICAgfVxuXG4gICAgaWYgKGxhbmUgJiBJZGxlTGFuZSkge1xuICAgICAgcmV0dXJuICdJZGxlJztcbiAgICB9XG5cbiAgICBpZiAobGFuZSAmIE9mZnNjcmVlbkxhbmUpIHtcbiAgIC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hdCBvZiBvdXIgY3VycmVudCBcInJvb3RDb250YWluZXJcIi5cbiAgICAgIC8vIElmIHdlIGZpbmQgdGhhdCBcInJvb3RDb250YWluZXJcIiwgd2UgZmluZCB0aGUgcGFyZW50IGZpYmVyXG4gICAgICAvLyBzdWItdHJlZSBmb3IgdGhhdCByb290IGFuZCBtYWtlIHRoYXQgb3VyIGFuY2VzdG9yIGluc3RhbmNlLlxuICAgICAgdmFyIG5vZGUgPSB0YXJnZXRJbnN0O1xuXG4gICAgICBtYWluTG9vcDogd2hpbGUgKHRydWUpIHtcbiAgICAgICAgaWYgKG5vZGUgPT09IG51bGwpIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbm9kZVRhZyA9IG5vZGUudGFnO1xuXG4gICAgICAgIGlmIChub2RlVGFnID09PSBIb3N0Um9vdCB8fCBub2RlVGFnID09PSBIb3N0UG9ydGFsKSB7XG4gICAgICAgICAgdmFyIGNvbnRhaW5lciA9IG5vZGUuc3RhdGVOb2RlLmNvbnRhaW5lckluZm87XG5cbiAgICAgICAgICBpZiAoaXNNYXRjaGluZ1Jvb3RDb250YWluZXIoY29udGFpbmVyLCB0YXJnZXRDb250YWluZXJOb2RlKSkge1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKG5vZGVUYWcgPT09IEhvc3RQb3J0YWwpIHtcbiAgICAgICAgICAgIC8vIFRoZSB0YXJnZXQgaXMgYSBwb3J0YWwsIGJ1dCBpdCdzIG5vdCB0aGUgcm9vdENvbnRhaW5lciB3ZSdyZSBsb29raW5nIGZvci5cbiAgICAgICAgICAgIC8vIE5vcm1hbGx5IHBvcnRhbHMgaGFuZGxlIHRoZWlyIG93biBldmVudHMgYWxsIHRoZSB3YXkgZG93biB0byB0aGUgcm9vdC5cbiAgICAgICAgICAgIC8vIFNvIHdlIHNob3VsZCBiZSBhYmxlIHRvIHN0b3Agbm93LiBIb3dldmVyLCB3ZSBkb24ndCBrbm93IGlmIHRoaXMgcG9ydGFsXG4gICAgICAgICAgICAvLyB3YXMgcGFydCBvZiAqb3VyKiByb290LlxuICAgICAgICAgICAgdmFyIGdyYW5kTm9kZSA9IG5vZGUucmV0dXJuO1xuXG4gICAgICAgICAgICB3aGlsZSAoZ3JhbmROb2RlICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgIHZhciBncmFuZFRhZyA9IGdyYW5kTm9kZS50YWc7XG5cbiAgICAgICAgICAgICAgaWYgKGdyYW5kVGFnID09PSBIb3N0Um9vdCB8fCBncmFuZFRhZyA9PT0gSG9zdFBvcnRhbCkge1xuICAgICAgICAgICAgICAgIHZhciBncmFuZENvbnRhaW5lciA9IGdyYW5kTm9kZS5zdGF0ZU5vZGUuY29udGFpbmVySW5mbztcblxuICAgICAgICAgICAgICAgIGlmIChpc01hdGNoaW5nUm9vdENvbnRhaW5lcihncmFuZENvbnRhaW5lciwgdGFyZ2V0Q29udGFpbmVyTm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgdGhlIHJvb3RDb250YWluZXIgd2UncmUgbG9va2luZyBmb3IgYW5kIHdlIGZvdW5kIGl0IGFzXG4gICAgICAgICAgICAgICAgICAvLyBhIHBhcmVudCBvZiB0aGUgUG9ydGFsLiBUaGF0IG1lYW5zIHdlIGNhbiBpZ25vcmUgaXQgYmVjYXVzZSB0aGVcbiAgICAgICAgICAgICAgICAgIC8vIFBvcnRhbCB3aWxsIGJ1YmJsZSB0aHJvdWdoIHRvIHVzLlxuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGdyYW5kTm9kZSA9IGdyYW5kTm9kZS5yZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSAvLyBOb3cgd2UgbmVlZCB0byBmaW5kIGl0J3MgY29ycmVzcG9uZGluZyBob3N0IGZpYmVyIGluIHRoZSBvdGhlclxuICAgICAgICAgIC8vIHRyZWUuIFRvIGRvIHRoaXMgd2UgY2FuIHVzZSBnZXRDbG9zZXN0SW5zdGFuY2VGcm9tTm9kZSwgYnV0IHdlXG4gICAgICAgICAgLy8gbmVlZCB0byB2YWxpZGF0ZSB0aGF0IHRoZSBmaWJlciBpcyBhIGhvc3QgaW5zdGFuY2UsIG90aGVyd2lzZVxuICAgICAgICAgIC8vIHdlIG5lZWQgdG8gdHJhdmVyc2UgdXAgdGhyb3VnaCB0aGUgRE9NIHRpbGwgd2UgZmluZCB0aGUgY29ycmVjdFxuICAgICAgICAgIC8vIG5vZGUgdGhhdCBpcyBmcm9tIHRoZSBvdGhlciB0cmVlLlxuXG5cbiAgICAgICAgICB3aGlsZSAoY29udGFpbmVyICE9PSBudWxsKSB7XG4gICAgICAgICAgICB2YXIgcGFyZW50Tm9kZSA9IGdldENsb3Nlc3RJbnN0YW5jZUZyb21Ob2RlKGNvbnRhaW5lcik7XG5cbiAgICAgICAgICAgIGlmIChwYXJlbnROb2RlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHBhcmVudFRhZyA9IHBhcmVudE5vZGUudGFnO1xuXG4gICAgICAgICAgICBpZiAocGFyZW50VGFnID09PSBIb3N0Q29tcG9uZW50IHx8IHBhcmVudFRhZyA9PT0gSG9zdFRleHQpIHtcbiAgICAgICAgICAgICAgbm9kZSA9IGFuY2VzdG9ySW5zdCA9IHBhcmVudE5vZGU7XG4gICAgICAgICAgICAgIGNvbnRpbnVlIG1haW5Mb29wO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb250YWluZXIgPSBjb250YWluZXIucGFyZW50Tm9kZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBub2RlID0gbm9kZS5yZXR1cm47XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgYmF0Y2hlZFVwZGF0ZXM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bW9kZSwgc28gd2Ugb3V0bGF3IG9ubHkgdGFnIGNvbWJvc1xuICAgIC8vIHdoZXJlIHRoZSBwYXJzaW5nIHJ1bGVzIGNhdXNlIGltcGxpY2l0IG9wZW5zIG9yIGNsb3NlcyB0byBiZSBhZGRlZC5cbiAgICAvLyBodHRwczovL2h0bWwuc3BlYy53aGF0d2cub3JnL211bHRpcGFnZS9zeW50YXguaHRtbCNwYXJzaW5nLW1haW4taW5ib2R5XG5cblxuICAgIHN3aXRjaCAodGFnKSB7XG4gICAgICBjYXNlICdoMSc6XG4gICAgICBjYXNlICdoMic6XG4gICAgICBjYXNlICdoMyc6XG4gICAgICBjYXNlICdoNCc6XG4gICAgICBjYXNlICdoNSc6XG4gICAgICBjYXNlICdoNic6XG4gICAgICAgIHJldHVybiBwYXJlbnRUYWcgIT09ICdoMScgJiYgcGFyZW50VGFnICE9PSAnaDInICYmIHBhcmVudFRhZyAhPT0gJ2gzJyAmJiBwYXJlbnRUYWcgIT09ICdoNCcgJiYgcGFyZW50VGFnICE9PSAnaDUnICYmIHBhcmVudFRhZyAhPT0gJ2g2JztcblxuICAgICAgY2FzZSAncnAnOlxuICAgICAgY2FzZSAncnQnOlxuICAgICAgICByZXR1cm4gaW1wbGllZEVuZFRhZ3MuaW5kZXhPZihwYXJlbnRUYWcpID09PSAtMTtcblxuICAgICAgY2FzZSAnYm9keSc6XG4gICAgICBjYXNlICdjYXB0aW9uJzpcbiAgICAgIGNhc2UgJ2NvbCc6XG4gICAgICBjYXNlICdjb2xncm91cCc6XG4gICAgICBjYXNlICdmcmFtZXNldCc6XG4gICAgICBjYXNlICdmcmFtZSc6XG4gICAgICBjYXNlICdoZWFkJzpcbiAgICAgIGNhc2UgJ2h0bWwnOlxuICAgICAgY2FzZSAndGJvZHknOlxuICAgICAgY2FzZSAndGQnOlxuICAgICAgY2FzZSAndGZvb3QnOlxuICAgICAgY2FzZSAndGgnOlxuICAgICAgY2FzZSAndGhlYWQnOlxuICAgICAgY2FzZS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zIG9mIGEgc3VzcGVuZGVkIG5vZGUuIFRoZSBtaXNtYXRjaCBtYXkgYmUgZHVlIHRvIHRoZSBtaXNzaW5nXG4gICAgICAvLyBkYXRhLCBzbyBpdCdzIHByb2JhYmx5IGEgZmFsc2UgcG9zaXRpdmUuXG4gICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgc3dpdGNoIChyZXR1cm5GaWJlci50YWcpIHtcbiAgICAgIGNhc2UgSG9zdFJvb3Q6XG4gICAgICAgIHtcbiAgICAgICAgICB2YXIgcGFyZW50Q29udGFpbmVyID0gcmV0dXJuRmliZXIuc3RhdGVOb2RlLmNvbnRhaW5lckluZm87XG5cbiAgICAgICAgICBzd2l0Y2ggKGZpYmVyLnRhZykge1xuICAgICAgICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICAgICAgICB2YXIgdHlwZSA9IGZpYmVyLnR5cGU7XG4gICAgICAgICAgICAgIHZhciBwcm9wcyA9IGZpYmVyLnBlbmRpbmdQcm9wcztcbiAgICAgICAgICAgICAgZGlkTm90RmluZEh5ZHJhdGFibGVJbnN0YW5jZVdpdGhpbkNvbnRhaW5lcihwYXJlbnRDb250YWluZXIsIHR5cGUpO1xuICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSBIb3N0VGV4dDpcbiAgICAgICAgICAgICAgdmFyIHRleHQgPSBmaWJlci5wZW5kaW5nUHJvcHM7XG4gICAgICAgICAgICAgIGRpZE5vdEZpbmRIeWRyYXRhYmxlVGV4dEluc3RhbmNlV2l0aGluQ29udGFpbmVyKHBhcmVudENvbnRhaW5lciwgdGV4dCk7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgICAge1xuICAgICAgICAgIHZhciBwYXJlbnRUeXBlID0gcmV0dXJuRmliZXIudHlwZTtcbiAgICAgICAgICB2YXIgcGFyZW50UHJvcHMgPSByZXR1cm5GaWJlci5tZW1vaXplZFByb3BzO1xuICAgICAgICAgIHZhciBwYXJlbnRJbnN0YW5jZSA9IHJldHVybkZpYmVyLnN0YXRlTm9kZTtcblxuICAgICAgICAgIHN3aXRjaCAoZmliZXIudGFnKSB7XG4gICAgICAgICAgICBjYXNlIEhvc3RDb21wb25lbnQ6XG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB2YXIgX3R5cGUgPSBmaWJlci50eXBlO1xuICAgICAgICAgICAgICAgIHZhciBfcHJvcHMgPSBmaWJlci5wZW5kaW5nUHJvcHM7XG4gICAgICAgICAgICAgICAgdmFyIGlzQ29uY3VycmVudE1vZGUgPSAocmV0dXJuRmliZXIubW9kZSAmIENvbmN1cnJlbnRNb2RlKSAhPT0gTm9Nb2RlO1xuICAgICAgICAgICAgICAgIGRpZE5vdEZpbmRIeWRyYXRhYmxlSW5zdGFuY2UocGFyZW50VHlwZSwgcGFyZW50UHJvcHMsIHBhcmVudEluc3RhbmNlLCBfdHlwZSwgX3Byb3BzLCAvLyBUT0RPOiBEZWxldGUgdGhpcyBhcmd1bWVudCB3aGVuIHdlIHJlbW92ZSB0aGUgbGVnYWN5IHJvb3QgQVBJLlxuICAgICAgICAgICAgICAgIGlzQ29uY3VycmVudE1vZGUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNhc2UgSG9zdFRleHQ6XG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB2YXIgX3RleHQgPSBmaWJlci5wZW5kaW5nUHJvcHM7XG5cbiAgICAgICAgICAgICAgICB2YXIgX2lzQ29uY3VycmVudE1vZGUgPSAocmV0dXJuRmliZXIubW9kZSAmIENvbmN1cnJlbnRNb2RlKSAhPT0gTm9Nb2RlO1xuXG4gICAgICAgICAgICAgICAgZGlkTm90RmluZEh5ZHJhdGFibGVUZXh0SW5zdGFuY2UocGFyZW50VHlwZSwgcGFyZW50UHJvcHMsIHBhcmVudEluc3RhbmNlLCBfdGV4dCwgLy8gVE9ETzogRGVsZXRlIHRoaXMgYXJndW1lbnQgd2hlbiB3ZSByZW1vdmUgdGhlIGxlZ2FjeSByb290IEFQSS5cbiAgICAgICAgICAgICAgICBfaXNDb25jdXJyZW50TW9kZSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIFN1c3BlbnNlQ29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIHN1c3BlbnNlU3RhdGUgPSByZXR1cm5GaWJlci5tZW1vaXplZFN0YXRlO1xuICAgICAgICAgIHZhciBfcGFyZW50SW5zdGFuY2UgPSBzdXNwZW5zZVN0YXRlLmRlaHlkcmF0ZWQ7XG4gICAgICAgICAgaWYgKF9wYXJlbnRJbnN0YW5jZSAhPT0gbnVsbCkgc3dpdGNoIChmaWJlci50YWcpIHtcbiAgICAgICAgICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgICAgICAgICAgdmFyIF90eXBlMiA9IGZpYmVyLnR5cGU7XG4gICAgICAgICAgICAgIHZhciBfcHJvcHMyID0gZmliZXIucGVuZGluZ1Byb3BzO1xuICAgICAgICAgICAgICBkaWROb3RGaW5kSHlkcmF0YWJsZUluc3RhbmNlV2l0aGluU3VzcGVuc2VJbnN0YW5jZShfcGFyZW50SW5zdGFuY2UsIF90eXBlMik7XG4gICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlIEhvc3RUZXh0OlxuICAgICAgICAgICAgICB2YXIgX3RleHQyID0gZmliZXIucGVuZGluZ1Byb3BzO1xuICAgICAgICAgICAgICBkaWROb3RGaW5kSHlkcmF0YWJsZVRleHRJbnN0YW5jZVdpdGhpblN1c3BlbnNlSW5zdGFuY2UoX3BhcmVudEluc3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BheWxvYWQ7XG4gICAgICAgIHZhciBwYXJ0aWFsU3RhdGU7XG5cbiAgICAgICAgaWYgKHR5cGVvZiBfcGF5bG9hZCA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgIC8vIFVwZGF0ZXIgZnVuY3Rpb25cbiAgICAgICAgICB7XG4gICAgICAgICAgICBlbnRlckRpc2FsbG93ZWRDb250ZXh0UmVhZEluREVWKCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcGFydGlhbFN0YXRlID0gX3BheWxvYWQuY2FsbChpbnN0YW5jZSwgcHJldlN0YXRlLCBuZXh0UHJvcHMpO1xuXG4gICAgICAgICAge1xuICAgICAgICAgICAgaWYgKCB3b3JrSW5Qcm9ncmVzcy5tb2RlICYgU3RyaWN0TGVnYWN5TW9kZSkge1xuICAgICAgICAgICAgICBzZXRJc1N0cmljdE1vZGVGb3JEZXZ0b29scyh0cnVlKTtcblxuICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIF9wYXlsb2FkLmNhbGwoaW5zdGFuY2UsIHByZXZTdGF0ZSwgbmV4dFByb3BzKTtcbiAgICAgICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgICAgICBzZXRJc1N0cmljdE1vZGVGb3JEZXZ0b29scyhmYWxzZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZXhpdERpc2FsbG93ZWRDb250ZXh0UmVhZEluREVWKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIFBhcnRpYWwgc3RhdGUgb2JqZWN0XG4gICAgICAgICAgcGFydGlhbFN0YXRlID0gX3BheWxvYWQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocGFydGlhbFN0YXRlID09PSBudWxsIHx8IHBhcnRpYWxTdGF0ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgLy8gTnVsbCBhbmQgdW5kZWZpbmVkI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gICAgICAgICAgfVxuXG4gICAgICAgIGNhc2UgUkVBQ1RfUE9SVEFMX1RZUEU6XG4gICAgICAgICAge1xuICAgICAgICAgICAgaWYgKG5ld0NoaWxkLmtleSA9PT0ga2V5KSB7XG4gICAgICAgICAgICAgIHJldHVybiB1cGRhdGVQb3J0YWwocmV0dXJuRmliZXIsIG9sZEZpYmVyLCBuZXdDaGlsZCwgbGFuZXMpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgIGNhc2UgUkVBQ1RfTEFaWV9UWVBFOlxuICAgICAgICAgIHtcbiAgICAgICAgICAgIHZhciBwYXlsb2FkID0gbmV3Q2hpbGQuX3BheWxvYWQ7XG4gICAgICAgICAgICB2YXIgaW5pdCA9IG5ld0NoaWxkLl9pbml0O1xuICAgICAgICAgICAgcmV0dXJuIHVwZGF0ZVNsb3QocmV0dXJuRmliZXIsIG9sZEZpYmVyLCBpbml0KHBheWxvYWQpLCBsYW5lcyk7XG4gICAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoaXNBcnJheShuZXdDaGlsZCkgfHwgZ2V0SXRlcmF0b3JGbihuZXdDaGlsZCkpIHtcbiAgICAgICAgaWYgKGtleSAhPT0gbnVsbCkge1xuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHVwZGF0ZUZyYWdtZW50KHJldHVybkZpYmVyLCBvbGRGaWJlciwgbmV3Q2hpbGQsIGxhbmVzLCBudWxsKTtcbiAgICAgIH1cblxuICAgICAgdGhyb3dPbkludmFsaWRPYmplY3RUeXBlKHJldHVybkZpYmVyLCBuZXdDaGlsZCk7XG4gICAgfVxuXG4gICAge1xuICAgICAgaWYgKHR5cGVvZiBuZXdDaGlsZCA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICB3YXJuT25GdW5jdGlvblR5cG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AgICB7XG4gICAgICBpZiAodHlwZW9mIG5ld0NoaWxkID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIHdhcm5PbkZ1bmN0aW9uVHlwZShyZXR1cm5GaWJlcik7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIG51bGw7XG4gIH1cbiAgLyoqXG4gICAqIFdhcm5zIGlmIHRoZXJlIGlzIGEgZHVwbGljYXRlIG9yIG1pc3Npbmcga2V5XG4gICAqL1xuXG5cbiAgZnVuY3Rpb24gd2Fybk9uSW52YWxpZEtleShjaGlsZCwga25vd25LZXlzLCByZXR1cm5GaWJlcikge1xuICAgIHtcbiAgICAgIGlmICh0eXBlb2YgY2hpbGQgIT09ICdvYmplY3QnIHx8IGNoaWxkID09PSBudWxsKSB7XG4gICAgICAgIHJldHVybiBrbm93bktleXM7XG4gICAgICB9XG5cbiAgICAgIHN3aXRjaCAoY2hpbGQuJCR0eXBlb2YpIHtcbiAgICAgICAgY2FzZSBSRUFDVF9FTEVNRU5UX1RZUEU6XG4gICAgICAgIGNhc2UgUkVBQ1RfUE9SVEFMX1RZUEU6XG4gICAgICAgICAgd2FybkZvck1pc3NpbmdLZXkoY2hpbGQsIHJldHVybkZpYmVyKTtcbiAgICAgICAgICB2YXIga2V5ID0gY2hpbGQua2V5O1xuXG4gICAgICAgICAgaWYgKHR5cGVvZiBrZXkgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoa25vd25LZXlzID09PSBudWxsKSB7XG4gICAgICAgICAgICBrbm93bktleXMgPSBuZXcgU2V0KCk7XG4gICAgICAgICAgICBrbm93bktleXMuYWRkKGtleSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoIWtub3duS2V5cy5oYXMoa2V5KSkge1xuICAgICAgICAgICAga25vd25LZXlzLmFkZChrZXkpO1xuICAgICAgICAgICAgYnJlYWs7X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XG4gICAgICBjYXNlICdiYWNrd2FyZHMnOlxuICAgICAgICB7XG4gICAgICAgICAgLy8gV2UncmUgZ29pbmcgdG8gZmluZCB0aGUgZmlyc3Qgcm93IHRoYXQgaGFzIGV4aXN0aW5nIGNvbnRlbnQuXG4gICAgICAgICAgLy8gQXQgdGhlIHNhbWUgdGltZSB3ZSdyZSBnb2luZyB0byByZXZlcnNlIHRoZSBsaXN0IG9mIGV2ZXJ5dGhpbmdcbiAgICAgICAgICAvLyB3ZSBwYXNzIGluIHRoZSBtZWFudGltZS4gVGhhdCdzIGdvaW5nIHRvIGJlIG91ciB0YWlsIGluIHJldmVyc2VcbiAgICAgICAgICAvLyBvcmRlci5cbiAgICAgICAgICB2YXIgX3RhaWwgPSBudWxsO1xuICAgICAgICAgIHZhciByb3cgPSB3b3JrSW5Qcm9ncmVzcy5jaGlsZDtcbiAgICAgICAgICB3b3JrSW5Qcm9ncmVzcy5jaGlsZCA9IG51bGw7XG5cbiAgICAgICAgICB3aGlsZSAocm93ICE9PSBudWxsKSB7XG4gICAgICAgICAgICB2YXIgY3VycmVudFJvdyA9IHJvdy5hbHRlcm5hdGU7IC8vIE5ldyByb3dzIGNhbid0IGJlIGNvbnRlbnQgcm93cy5cblxuICAgICAgICAgICAgaWYgKGN1cnJlbnRSb3cgIT09IG51bGwgJiYgZmluZEZpcnN0U3VzcGVuZGVkKGN1cnJlbnRSb3cpID09PSBudWxsKSB7XG4gICAgICAgICAgICAgIC8vIFRoaXMgaXMgdGhlIGJlZ2lubmluZyBvZiB0aGUgbWFpbiBjb250ZW50LlxuICAgICAgICAgICAgICB3b3JrSW5Qcm9ncmVzcy5jaGlsZCA9IHJvdztcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBuZXh0Um93ID0gcm93LnNpYmxpbmc7XG4gICAgICAgICAgICByb3cuc2libGluZyA9IF90YWlsO1xuICAgICAgICAgICAgX3RhaWwgPSByb3c7XG4g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udG8gdGhlIHN0YWNrLlxuICBzd2l0Y2ggKHdvcmtJblByb2dyZXNzLnRhZykge1xuICAgIGNhc2UgSG9zdFJvb3Q6XG4gICAgICBwdXNoSG9zdFJvb3RDb250ZXh0KHdvcmtJblByb2dyZXNzKTtcbiAgICAgIHZhciByb290ID0gd29ya0luUHJvZ3Jlc3Muc3RhdGVOb2RlO1xuXG4gICAgICByZXNldEh5ZHJhdGlvblN0YXRlKCk7XG4gICAgICBicmVhaztcblxuICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgIHB1c2hIb3N0Q29udGV4dCh3b3JrSW5Qcm9ncmVzcyk7XG4gICAgICBicmVhaztcblxuICAgIGNhc2UgQ2xhc3NDb21wb25lbnQ6XG4gICAgICB7XG4gICAgICAgIHZhciBDb21wb25lbnQgPSB3b3JrSW5Qcm9ncmVzcy50eXBlO1xuXG4gICAgICAgIGlmIChpc0NvbnRleHRQcm92aWRlcihDb21wb25lbnQpKSB7XG4gICAgICAgICAgcHVzaENvbnRleHRQcm92aWRlcih3b3JrSW5Qcm9ncmVzcyk7XG4gICAgICAgIH1cblxuICAgICAgICBicmVhaztcbiAgICAgIH1cblxuICAgIGNhc2UgSG9zdFBvcnRhbDpcbiAgICAgIHB1c2hIb3N0Q29udGFpbmVyKHdvcmtJblByb2dyZXNzLCB3b3JrSW5Qcm9ncmVzcy5zdGF0ZU5vZGUuY29udGFpbmVySW5mbyk7XG4gICAgICBicmVhaztcblxuICAgIGNhc2UgQ29udGV4dFByb3ZpZGVyOlxuICAgICAge1xuICAgICAgICB2YXIgbmV3VmFsdWUgPSB3b3JrSW5Qcm9ncmVzcy5tZW1vaXplZFByb3BzLnZhbHVlO1xuICAgICAgICB2YXIgY29udGV4dCA9IHdvcmtJblByb2dyZXNzLnR5cGUuX2NvbnRleHQ7XG4gICAgICAgIHB1c2hQcm92aWRlcih3b3JrSW5Qcm9ncmVzcywgY29udGV4dCwgbmV3VmFsdWUpO1xuICAgICAgICBicmVhaztcbi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iYgY2hpbGRDb250ZXh0VHlwZXMgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHBvcENvbnRleHQoaW50ZXJydXB0ZWRXb3JrKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuXG4gICAgY2FzZSBIb3N0Um9vdDpcbiAgICAgIHtcbiAgICAgICAgdmFyIHJvb3QgPSBpbnRlcnJ1cHRlZFdvcmsuc3RhdGVOb2RlO1xuICAgICAgICBwb3BIb3N0Q29udGFpbmVyKGludGVycnVwdGVkV29yayk7XG4gICAgICAgIHBvcFRvcExldmVsQ29udGV4dE9iamVjdChpbnRlcnJ1cHRlZFdvcmspO1xuICAgICAgICByZXNldFdvcmtJblByb2dyZXNzVmVyc2lvbnMoKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG5cbiAgICBjYXNlIEhvc3RDb21wb25lbnQ6XG4gICAgICB7XG4gICAgICAgIHBvcEhvc3RDb250ZXh0KGludGVycnVwdGVkV29yayk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuXG4gICAgY2FzZSBIb3N0UG9ydGFsOlxuICAgICAgcG9wSG9zdENvbnRhaW5lcihpbnRlcnJ1cHRlZFdvcmspO1xuICAgICAgYnJlYWs7XG5cbiAgICBjYXNlIFN1c3BlbnNlQ29tcG9uZW50OlxuICAgICAgcG9wU3VzcGVuc2VDb250ZXh0KGludGVycnVwdGVkV29yayk7XG4gICAgICBicmVhaztcblxuICAgIGNhc2UgU3VzcGVuc2VMaXN0Q29tcG9uZW50OlxuICAgICAgcG9wU3VzcGVuc2VDb250ZXh0KGludGVycnVwdGVkV29yayk7XG4gICAgICBicmVhaztcblxuICAgIGNhc2UgQ29udGV4dFByb3ZpZGVyOlxuICAgICAgdmFyIGNvbnRleHQgPSBpbnRlcnJ1cHRlZFdvcmsudHlwZS5fY29udGV4dDtcbiAgICAgIHBvcFByb3ZpZGVyKGNvbnRleHQsIGludGVycnVwdGVkV29yayk7XG4gICAgIC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m9yZVVwZGF0ZTtcblxuICAgICAgICAgICAgICBpZiAoc25hcHNob3QgPT09IHVuZGVmaW5lZCAmJiAhZGlkV2FyblNldC5oYXMoZmluaXNoZWRXb3JrLnR5cGUpKSB7XG4gICAgICAgICAgICAgICAgZGlkV2FyblNldC5hZGQoZmluaXNoZWRXb3JrLnR5cGUpO1xuXG4gICAgICAgICAgICAgICAgZXJyb3IoJyVzLmdldFNuYXBzaG90QmVmb3JlVXBkYXRlKCk6IEEgc25hcHNob3QgdmFsdWUgKG9yIG51bGwpICcgKyAnbXVzdCBiZSByZXR1cm5lZC4gWW91IGhhdmUgcmV0dXJuZWQgdW5kZWZpbmVkLicsIGdldENvbXBvbmVudE5hbWVGcm9tRmliZXIoZmluaXNoZWRXb3JrKSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaW5zdGFuY2UuX19yZWFjdEludGVybmFsU25hcHNob3RCZWZvcmVVcGRhdGUgPSBzbmFwc2hvdDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIEhvc3RSb290OlxuICAgICAgICB7XG4gICAgICAgICAge1xuICAgICAgICAgICAgdmFyIHJvb3QgPSBmaW5pc2hlZFdvcmsuc3RhdGVOb2RlO1xuICAgICAgICAgICAgY2xlYXJDb250YWluZXIocm9vdC5jb250YWluZXJJbmZvKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIEhvc3RDb21wb25lbnQ6XG4gICAgICBjYXNlIEhvc3RUZXh0OlxuICAgICAgY2FzZSBIb3N0UG9ydGFsOlxuICAgICAgY2FzZSBJbmNvbXBsZXRlQ2xhc3NDb21wb25lbnQ6XG4gICAgICAgIC8vIE5vdGhpbmcgdG8gZG8gZm9yIHRoZXNlIGNvbXBvbmVudCB0eXBlc1xuICAgICAgICBicmVhaztcblxuICAgICAgZGVmYXV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25lbnRQYXNzaXZlRWZmZWN0VW5tb3VudFN0YXJ0ZWQoZmluaXNoZWRXb3JrKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoKGZsYWdzICYgTGF5b3V0KSAhPT0gTm9GbGFncyQxKSB7XG4gICAgICAgICAgICAgIG1hcmtDb21wb25lbnRMYXlvdXRFZmZlY3RVbm1vdW50U3RhcnRlZChmaW5pc2hlZFdvcmspO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGlmICgoZmxhZ3MgJiBJbnNlcnRpb24pICE9PSBOb0ZsYWdzJDEpIHtcbiAgICAgICAgICAgICAgc2V0SXNSdW5uaW5nSW5zZXJ0aW9uRWZmZWN0KHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHNhZmVseUNhbGxEZXN0cm95KGZpbmlzaGVkV29yaywgbmVhcmVzdE1vdW50ZWRBbmNlc3RvciwgZGVzdHJveSk7XG5cbiAgICAgICAgICB7XG4gICAgICAgICAgICBpZiAoKGZsYWdzICYgSW5zZXJ0aW9uKSAhPT0gTm9GbGFncyQxKSB7XG4gICAgICAgICAgICAgIHNldElzUnVubmluZ0luc2VydGlvbkVmZmVjdChmYWxzZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAge1xuICAgICAgICAgICAgaWYgKChmbGFncyAmIFBhc3NpdmUkMSkgIT09IE5vRmxhZ3MkMSkge1xuICAgICAgICAgICAgICBtYXJrQ29tcG9uZW50UGFzc2l2ZUVmZmVjdFVubW91bnRTdG9wcGVkKCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKChmbGFncyAmIExheW91dCkgIT09IE5vRmxhZ3MkMSkge1xuICAgICAgICAgICAgICBtYXJrQ29tcG9uZW50TGF5b3V0RWZmZWN0VW5tb3VudFN0b3BwZWQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAg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GbGFncyQxKSB7XG4gICAgICAgICAgICBzZXRJc1J1bm5pbmdJbnNlcnRpb25FZmZlY3QodHJ1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZWZmZWN0LmRlc3Ryb3kgPSBjcmVhdGUoKTtcblxuICAgICAgICB7XG4gICAgICAgICAgaWYgKChmbGFncyAmIEluc2VydGlvbikgIT09IE5vRmxhZ3MkMSkge1xuICAgICAgICAgICAgc2V0SXNSdW5uaW5nSW5zZXJ0aW9uRWZmZWN0KGZhbHNlKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB7XG4gICAgICAgICAgaWYgKChmbGFncyAmIFBhc3NpdmUkMSkgIT09IE5vRmxhZ3MkMSkge1xuICAgICAgICAgICAgbWFya0NvbXBvbmVudFBhc3NpdmVFZmZlY3RNb3VudFN0b3BwZWQoKTtcbiAgICAgICAgICB9IGVsc2UgaWYgKChmbGFncyAmIExheW91dCkgIT09IE5vRmxhZ3MkMSkge1xuICAgICAgICAgICAgbWFya0NvbXBvbmVudExheW91dEVmZmVjdE1vdW50U3RvcHBlZCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHtcbiAgICAgICAgICB2YXIgZGVzdHJveSA9IGVmZmVjdC5kZXN0cm95O1xuXG4gICAgICAgICAgaWYgKGRlc3Ryb3kgIT09IHVuZGVmaW5lZCAmJiB0eXBlb2YgZGVzdHJveSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgdmFyIGhvb2tOYW1lID0gdm9pZCAwO1xuXG4gICAgICAgICAgICBpZiAoKGVmZmVjdC50YWcgJiBMYXlvdXQpICE9PSBOb0ZsYWdzKSB7XG4gICAgICAgICAgICAgIGhvb2tOYW1lID0gJ3VzZUxheW91dEVmZmVjdCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKChlZmZlY3QudGFnICYgSW5zZXJ0aW9uKSAhPT0gTm9GbGFncykge1xuICAgICAgICAg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vZmlsZXIsIHdlJ2xsIGJ1YmJsZSBmdXJ0aGVyIHVwLlxuXG5cbiAgICAgICAgICAgIHZhciBwYXJlbnRGaWJlciA9IGZpbmlzaGVkV29yay5yZXR1cm47XG5cbiAgICAgICAgICAgIG91dGVyOiB3aGlsZSAocGFyZW50RmliZXIgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgc3dpdGNoIChwYXJlbnRGaWJlci50YWcpIHtcbiAgICAgICAgICAgICAgICBjYXNlIEhvc3RSb290OlxuICAgICAgICAgICAgICAgICAgdmFyIHJvb3QgPSBwYXJlbnRGaWJlci5zdGF0ZU5vZGU7XG4gICAgICAgICAgICAgICAgICByb290LnBhc3NpdmVFZmZlY3REdXJhdGlvbiArPSBwYXNzaXZlRWZmZWN0RHVyYXRpb247XG4gICAgICAgICAgICAgICAgICBicmVhayBvdXRlcjtcblxuICAgICAgICAgICAgICAgIGNhc2UgUHJvZmlsZXI6XG4gICAgICAgICAgICAgICAgICB2YXIgcGFyZW50U3RhdGVOb2RlID0gcGFyZW50RmliZXIuc3RhdGVOb2RlO1xuICAgICAgICAgICAgICAgICAgcGFyZW50U3RhdGVOb2RlLnBhc3NpdmVFZmZlY3REdXJhdGlvbiArPSBwYXNzaXZlRWZmZWN0RHVyYXRpb247XG4gICAgICAgICAgICAgICAgICBicmVhayBvdXRlcjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHBhcmVudEZpYmVyID0gcGFyZW50RmliZXIucmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG5cbmZ1bmN0aW9uIGNvbW1pdExheW91dEVmZmVjdE9uRmliZXIoZmluaXNoZWRSb290LCBjdXJyZW50LCBmaW5pc2hlZFdvcmssIGNvbW1pdHRlZExhbmVzKSB7XG4gIGlmICgoZmluaXNoZWRXb3JrLmZsYWdzICYgTGF5b3V0TWFzaykgIT09IE5vRm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AgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgY29tbWl0SG9va0VmZmVjdExpc3RNb3VudChMYXlvdXQgfCBIYXNFZmZlY3QsIGZpbmlzaGVkV29yayk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgY2FzZSBDbGFzc0NvbXBvbmVudDpcbiAgICAgICAge1xuICAgICAgICAgIHZhciBpbnN0YW5jZSA9IGZpbmlzaGVkV29yay5zdGF0ZU5vZGU7XG5cbiAgICAgICAgICBpZiAoZmluaXNoZWRXb3JrLmZsYWdzICYgVXBkYXRlKSB7XG4gICAgICAgICAgICBpZiAoIW9mZnNjcmVlblN1YnRyZWVXYXNIaWRkZW4pIHtcbiAgICAgICAgICAgICAgaWYgKGN1cnJlbnQgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAvLyBXZSBjb3VsZCB1cGRhdGUgaW5zdGFuY2UgcHJvcHMgYW5kIHN0YXRlIGhlcmUsXG4gICAgICAgICAgICAgICAgLy8gYnV0IGluc3RlYWQgd2UgcmVseSBvbiB0aGVtIGJlaW5nIHNldCBkdXJpbmcgbGFzdCByZW5kZXIuXG4gICAgICAgICAgICAgICAgLy8gVE9ETzogcmV2aXNpdCB0aGlzIHdoZW4gd2UgaW1wbGVtZW50IHJlc3VtaW5nLlxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgIGlmIChmaW5pc2hlZFdvcmsudHlwZSA9PT0gZmluaXNoZWRXb3JrLmVsZW1lbnRUeXBlICYmICFkaWRXYXJuQWJvdXRSZWFzc2lnbmluZ1Byb3BzKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnN0YW5jZS5wcm9wcyAhPT0gZmluaXNoZWRXb3JrLm1lbW9pemVkUHJvcHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICBlcnJvcignRXhwZWN0ZWQgJXMgcH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mVjdFRpbWVyKCk7XG4gICAgICAgICAgICAgICAgICAgIGluc3RhbmNlLmNvbXBvbmVudERpZE1vdW50KCk7XG4gICAgICAgICAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgICAgICAgICByZWNvcmRMYXlvdXRFZmZlY3REdXJhdGlvbihmaW5pc2hlZFdvcmspO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBpbnN0YW5jZS5jb21wb25lbnREaWRNb3VudCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgcHJldlByb3BzID0gZmluaXNoZWRXb3JrLmVsZW1lbnRUeXBlID09PSBmaW5pc2hlZFdvcmsudHlwZSA/IGN1cnJlbnQubWVtb2l6ZWRQcm9wcyA6IHJlc29sdmVEZWZhdWx0UHJvcHMoZmluaXNoZWRXb3JrLnR5cGUsIGN1cnJlbnQubWVtb2l6ZWRQcm9wcyk7XG4gICAgICAgICAgICAgICAgdmFyIHByZXZTdGF0ZSA9IGN1cnJlbnQubWVtb2l6ZWRTdGF0ZTsgLy8gV2UgY291bGQgdXBkYXRlIGluc3RhbmNlIHByb3BzIGFuZCBzdGF0ZSBoZXJlLFxuICAgICAgICAgICAgICAgIC8vIGJ1dCBpbnN0ZWFkIHdlIHJlbHkgb24gdGhlbSBiZWluZyBzZXQgZHVyaW5nIGxhc3QgcmVuZGVyLlxuICAgICAgICAgICAgICAgIC8vIFRPRE86IHJldmlzaXQgdGhpcyB3aGVuIHdlIGltcGxlbWVudCByZXN1bWluZy5cblxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgIGlmIChmaW5pc2hlZFdvcmsudHlwZSA9PT0gZmluaXNoZWRXb3JrLmVsZW1lbnRUeXBlICYmICFkaWRXYXJuQWJvdXRSZWFzc2lnbmluZ1Byb3BzKSB7XG4gICAgICAgICA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G5cbiAgICAgICAgICAgICAgICBpZiAoIGZpbmlzaGVkV29yay5tb2RlICYgUHJvZmlsZU1vZGUpIHtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0TGF5b3V0RWZmZWN0VGltZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgaW5zdGFuY2UuY29tcG9uZW50RGlkVXBkYXRlKHByZXZQcm9wcywgcHJldlN0YXRlLCBpbnN0YW5jZS5fX3JlYWN0SW50ZXJuYWxTbmFwc2hvdEJlZm9yZVVwZGF0ZSk7XG4gICAgICAgICAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgICAgICAgICByZWNvcmRMYXlvdXRFZmZlY3REdXJhdGlvbihmaW5pc2hlZFdvcmspO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBpbnN0YW5jZS5jb21wb25lbnREaWRVcGRhdGUocHJldlByb3BzLCBwcmV2U3RhdGUsIGluc3RhbmNlLl9fcmVhY3RJbnRlcm5hbFNuYXBzaG90QmVmb3JlVXBkYXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IC8vIFRPRE86IEkgdGhpbmsgdGhpcyBpcyBub3cgYWx3YXlzIG5vbi1udWxsIGJ5IHRoZSB0aW1lIGl0IHJlYWNoZXMgdGhlXG4gICAgICAgICAgLy8gY29tbWl0IHBoYXNlLiBDb25zaWRlciByZW1vdmluZyB0aGUgdHlwZSBjaGVjay5cblxuXG4gICAgICAgICAgdmFyIHVwZGF0ZVF1ZXVlID0gZmluaXNoZWRXb3JrLnVwZGF0ZVF1ZXVlO1xuXG4gICAgICAgICAgaWYgKHVwZGF0ZVF1ZXVlICE9PSBudWxsKSB7XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGlmIChmaW5pc2hlZFdvcmsudH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gICAgICAgICAgICAgX2luc3RhbmNlID0gZ2V0UHVibGljSW5zdGFuY2UoZmluaXNoZWRXb3JrLmNoaWxkLnN0YXRlTm9kZSk7XG4gICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIGNhc2UgQ2xhc3NDb21wb25lbnQ6XG4gICAgICAgICAgICAgICAgICBfaW5zdGFuY2UgPSBmaW5pc2hlZFdvcmsuY2hpbGQuc3RhdGVOb2RlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29tbWl0VXBkYXRlUXVldWUoZmluaXNoZWRXb3JrLCBfdXBkYXRlUXVldWUsIF9pbnN0YW5jZSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIF9pbnN0YW5jZTIgPSBmaW5pc2hlZFdvcmsuc3RhdGVOb2RlOyAvLyBSZW5kZXJlcnMgbWF5IHNjaGVkdWxlIHdvcmsgdG8gYmUgZG9uZSBhZnRlciBob3N0IGNvbXBvbmVudHMgYXJlIG1vdW50ZWRcbiAgICAgICAgICAvLyAoZWcgRE9NIHJlbmRlcmVyIG1heSBzY2hlZHVsZSBhdXRvLWZvY3VzIGZvciBpbnB1dHMgYW5kIGZvcm0gY29udHJvbHMpLlxuICAgICAgICAgIC8vIFRoZXNlIGVmZmVjdHMgc2hvdWxkIG9ubHkgYmUgY29tbWl0dGVkIHdoZW4gY29tcG9uZW50cyBhcmUgZmlyc3QgbW91bnRlZCxcbiAgICAgICAgICAvLyBha2Egd2hlbiB0aGVyZSBpcyBubyBjdXJyZW50L2FsdGVybmF0ZS5cblxuICAgICAgICAgIGlmIChjdXJyZW50ID09PSBudWxsICYmIGZpbmlzaGVkV29yay5mbGFncyAmIFVwZGF0ZSkge1xuICAgICAgICAgICAgdmFyIHR5cGUgPSBmaW5pc2hlZFdvcmsudHlwZTtcbiAgICAgICAgICAgIHZhciBwcm9wcyA9IGZpbmlzaGVkV29yay5tZW1vaXplZFByb3BzO1xuICAgICAgICAgICAgY29tbWl0TW91bnQoX2luc3RhbmNlMiwgdHlwZSwgcHJvcHMpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgIGNhc2UgSG9zdFRleHQ6XG4gICAgICAgIHtcbiAgICAgICAgICAvLyBXZSBoYXZlIG5vIGxpZmUtY3ljbGVzIGFzc29jaWF0ZWQgd2l0aCB0ZXh0LlxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgIGNhc2UgSG9zdFBvcnRhbDpcbiAgICAgICAge1xuICAgICAgICAgIC8vIFdlIGhhdmUgbm8gbGlmZS1jeWNsZXMgYXNzb2NpYXRlZCB3aXRoIHBvcnRhbHMuXG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgY2FzZSBQcm9maWxlcjpcbiAgICAgICAge1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIHZhciBfZmluaXNoZWRXb3JrJG1lbW9pemUyID0gZmluaXNoZWRXb3JrLm1lbW9pemVkUHJvcHMsXG4gICAgICAgICAgICAgICAgb25Db21taXQgPSBfZmluaXNoZWRXb3JrJG1lbW9pemUyLm9uQ29tbWl0LFxuICAgICAgICAgICAgICAgIG9uUmVuZGVyID0gX2ZpbmlzaGVkV29yayRtZW1vaXplMi5vblJlbmRlcjtcbiAgICAgICAgICAgIHZhciBlZmZlY3REdXJhdGlvbiA9IGZpbmlzaGVkV29yay5zdGF0ZU5vZGUuZWZmZWN0RHVyYXRpb247XG4gICAgICAgICAgICB2YXIgY29tbWl0VGltZSA9IGdldENvbW1pdFRpbWUoKTtcbiAgICAgICAgICAgIHZhciBwaGFzZSA9IGN1cnJlbnQgPT09IG51bGwgPyAnbW91bnQnIDogJ3Vw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G4gICAgICAgICAgICAgIGVucXVldWVQZW5kaW5nUGFzc2l2ZVByb2ZpbGVyRWZmZWN0KGZpbmlzaGVkV29yayk7IC8vIFByb3BhZ2F0ZSBsYXlvdXQgZWZmZWN0IGR1cmF0aW9ucyB0byB0aGUgbmV4dCBuZWFyZXN0IFByb2ZpbGVyIGFuY2VzdG9yLlxuICAgICAgICAgICAgICAvLyBEbyBub3QgcmVzZXQgdGhlc2UgdmFsdWVzIHVudGlsIHRoZSBuZXh0IHJlbmRlciBzbyBEZXZUb29scyBoYXMgYSBjaGFuY2UgdG8gcmVhZCB0aGVtIGZpcnN0LlxuXG4gICAgICAgICAgICAgIHZhciBwYXJlbnRGaWJlciA9IGZpbmlzaGVkV29yay5yZXR1cm47XG5cbiAgICAgICAgICAgICAgb3V0ZXI6IHdoaWxlIChwYXJlbnRGaWJlciAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAocGFyZW50RmliZXIudGFnKSB7XG4gICAgICAgICAgICAgICAgICBjYXNlIEhvc3RSb290OlxuICAgICAgICAgICAgICAgICAgICB2YXIgcm9vdCA9IHBhcmVudEZpYmVyLnN0YXRlTm9kZTtcbiAgICAgICAgICAgICAgICAgICAgcm9vdC5lZmZlY3REdXJhdGlvbiArPSBlZmZlY3REdXJhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWsgb3V0ZXI7XG5cbiAgICAgICAgICAgICAgICAgIGNhc2UgUHJvZmlsZXI6XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJlbnRTdGF0ZU5vZGUgPSBwYXJlbnRGaWJlci5zdGF0ZU5vZGU7XG4gICAgICAgICAgICAgICAgICAgIHBhcmVudFN0YXRlTm9kZS5lZmZlY3REdXJhdGlvbiArPSBlZmZlY3REdXJhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWsgb3V0ZXI7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcGFyZW50RmliZXIgPS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lYXJMYXlvdXRFZmZlY3RzT25GaWJlcihub2RlKSB7XG4gIC8vIFR1cm4gb24gbGF5b3V0IGVmZmVjdHMgaW4gYSB0cmVlIHRoYXQgcHJldmlvdXNseSBkaXNhcHBlYXJlZC5cbiAgLy8gVE9ETyAoT2Zmc2NyZWVuKSBDaGVjazogZmxhZ3MgJiBMYXlvdXRTdGF0aWNcbiAgc3dpdGNoIChub2RlLnRhZykge1xuICAgIGNhc2UgRnVuY3Rpb25Db21wb25lbnQ6XG4gICAgY2FzZSBGb3J3YXJkUmVmOlxuICAgIGNhc2UgU2ltcGxlTWVtb0NvbXBvbmVudDpcbiAgICAgIHtcbiAgICAgICAgaWYgKCBub2RlLm1vZGUgJiBQcm9maWxlTW9kZSkge1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBzdGFydExheW91dEVmZmVjdFRpbWVyKCk7XG4gICAgICAgICAgICBzYWZlbHlDYWxsQ29tbWl0SG9va0xheW91dEVmZmVjdExpc3RNb3VudChub2RlLCBub2RlLnJldHVybik7XG4gICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgIHJlY29yZExheW91dEVmZmVjdER1cmF0aW9uKG5vZGUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzYWZlbHlDYWxsQ29tbWl0SG9va0xheW91dEVmZmVjdExpc3RNb3VudChub2RlLCBub2RlLnJldHVybik7XG4gICAgICAgIH1cblxuICAgICAgICBicmVhaztcbiAgICAgIH1cblxuICAgIGNhc2UgQ2xhc3NDb21wb25lbnQ6XG4gICAgICB7XG4gICAgICAgIHZhciBpbnN0YW5jZSA9IG5vZGUuc3RhdGVOb2RlO1xuXG4gICAgICAgIGlmICh0eXBlb2YgaW5zdGFuY2UuY29tcG9uZW50RGlkTW91bnQgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICBzYWZlbHlDYWxsQ29tcG9uZW50RGlkTW91bnQobm9kZSwgbm9kZS5yZXR1cm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nN0YW5jZShub2RlLnN0YXRlTm9kZSwgbm9kZS5tZW1vaXplZFByb3BzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgY2FwdHVyZUNvbW1pdFBoYXNlRXJyb3IoZmluaXNoZWRXb3JrLCBmaW5pc2hlZFdvcmsucmV0dXJuLCBlcnJvcik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKG5vZGUudGFnID09PSBIb3N0VGV4dCkge1xuICAgICAgICBpZiAoaG9zdFN1YnRyZWVSb290ID09PSBudWxsKSB7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHZhciBfaW5zdGFuY2UzID0gbm9kZS5zdGF0ZU5vZGU7XG5cbiAgICAgICAgICAgIGlmIChpc0hpZGRlbikge1xuICAgICAgICAgICAgICBoaWRlVGV4dEluc3RhbmNlKF9pbnN0YW5jZTMpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdW5oaWRlVGV4dEluc3RhbmNlKF9pbnN0YW5jZTMsIG5vZGUubWVtb2l6ZWRQcm9wcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIGNhcHR1cmVDb21taXRQaGFzZUVycm9yKGZpbmlzaGVkV29yaywgZmluaXNoZWRXb3JrLnJldHVybiwgZXJyb3IpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmICgobm9kZS50YWcgPT09IE9mZnNjcmVlbkNvbXBvbmVudCB8fCBub2RlLnRhZyA9PT0gTGVnYWN5SGlkZGVuQ29tcG9uZW50KSAmJiBub2RlLm1lbW9pemVkU3RhdGUgIT09IG51bGwgJiYgbm9kZSAhPT0gZmluaXNoZWRXb3JrKSA7IGVsc2UgaWYgKG5vZGUuY2hpbGQgIT09IG51bGwpIHtcbiAgICAgICAgbm9kZS5jaGlsZC5yZXR1cm4gPSBub2RlO1xuICAgICAgICBub2RlID0gbm9kZS5jaGlsZDtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIGlmIChub2RlID09PSBmaW5pc2hlZFdvcmspIHtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgICB3aGlsZSAobm9kZS5zaWJsaW5nID09PSBudWxsKSB7XG4gICAgICAgIGlmIChub2RlLnJldHVybiA9PT0gbnVsbCB8fCBub2RlLnJldHVybiA9PT0gZmluaXNoZWRXb3JrKSB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhvc3RTdWJ0cmVlUm9vdCA9PT0gbm9kZSkge1xuICAgICAgICAgIGhvc3RTdWJ0cmVlUm9vdCA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICBub2RlID0gbm9kZS5yZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGlmIChob3N0U3VidHJlZVJvb3QgPT09IG5vZGUpIHtcbiAgICAgICAgaG9zdFN1YnRyZWVSb290ID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgbm9kZS5zaWJsaW5nLnJldHVybiA9IG5vZGUucmV0dXJuO1xuICAgICAgbm9kZSA9IG5vZGUuc2libGluZztcbiAgICB9XG4gIH1cbn1cblxuZnVuY3Rpb24gY29tbWl0QXR0YWNoUmVmKGZpbmlzaGVkV29yaykge1xuICB2YXIgcmVmID0gZmluaXNoZWRXb3JrLnJlZjtcblxuICBpZiAocmVmICE9PSBudWxsKSB7XG4gICAgdmFyIGluc3RhbmNlID0gZmluaXNoZWRXb3JrLnN0YXRlTm9kZTtcbiAgICB2YXIgaW5zdGFuY2VUb1VzZTtcblxuICAgIHN3aXRjaCAoZmluaXNoZWRXb3JrLnRhZykge1xuICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICBpbnN0YW5jZVRvVXNlID0gZ2V0UHVibGljSW5zdGFuY2UoaW5z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N0YWNrIHRvIGluZGljYXRlIHRoYXQgbmVzdGVkIGNoaWxkcmVuIGRvbid0XG4gICAgICAgIC8vIG5lZWQgdG8gYmUgcmVtb3ZlZC5cbiAgICAgICAge1xuICAgICAgICAgIHZhciBwcmV2SG9zdFBhcmVudCA9IGhvc3RQYXJlbnQ7XG4gICAgICAgICAgdmFyIHByZXZIb3N0UGFyZW50SXNDb250YWluZXIgPSBob3N0UGFyZW50SXNDb250YWluZXI7XG4gICAgICAgICAgaG9zdFBhcmVudCA9IG51bGw7XG4gICAgICAgICAgcmVjdXJzaXZlbHlUcmF2ZXJzZURlbGV0aW9uRWZmZWN0cyhmaW5pc2hlZFJvb3QsIG5lYXJlc3RNb3VudGVkQW5jZXN0b3IsIGRlbGV0ZWRGaWJlcik7XG4gICAgICAgICAgaG9zdFBhcmVudCA9IHByZXZIb3N0UGFyZW50O1xuICAgICAgICAgIGhvc3RQYXJlbnRJc0NvbnRhaW5lciA9IHByZXZIb3N0UGFyZW50SXNDb250YWluZXI7XG5cbiAgICAgICAgICBpZiAoaG9zdFBhcmVudCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgLy8gTm93IHRoYXQgYWxsIHRoZSBjaGlsZCBlZmZlY3RzIGhhdmUgdW5tb3VudGVkLCB3ZSBjYW4gcmVtb3ZlIHRoZVxuICAgICAgICAgICAgLy8gbm9kZSBmcm9tIHRoZSB0cmVlLlxuICAgICAgICAgICAgaWYgKGhvc3RQYXJlbnRJc0NvbnRhaW5lcikge1xuICAgICAgICAgICAgICByZW1vdmVDaGlsZEZyb21Db250YWluZXIoaG9zdFBhcmVudCwgZGVsZXRlZEZpYmVyLnN0YXRlTm9kZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZW1vdmVDaGlsZChob3N0UGFyZW50LCBkZWxldGVkRmliZXIuc3RhdGVOb2RlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICBjYXNlIERlaHlkcmF0ZWRGcmFnbWVudDpcbiAgICAgIHtcbiAgICAgICAgLy8gRGVsZXRlIHRoZSBkZWh5ZHJhdGVkIHN1c3BlbnNlIGJvdW5kYXJ5IGFuZCBhbGwgb2YgaXRzIGNvbnRlbnQuXG5cblxuICAgICAgICB7XG4gICAgICAgICAgaWYgKGhvc3RQYXJlbnQgIT09IG51bGwpIHtcbiAgICAgICAgICAgIGlmIChob3N0UGFyZW50SXNDb250YWluZXIpIHtcbiAgICAgICAgICAgICAgY2xlYXJTdXNwZW5zZUJvdW5kYXJ5RnJvbUNvbnRhaW5lcihob3N0UGFyZW50LCBkZWxldGVkRmliZXIuc3RhdGVOb2RlKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNsZWFyU3VzcGVuc2VCb3VuZGFyeShob3N0UGFyZW50LCBkZWxldGVkRmliZXIuc3RhdGVOb2RlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICBjYXNlIEhvc3RQb3J0YWw6XG4gICAgICB7XG4gICAgICAgIHtcbiAgICAgICAgICAvLyBXaGVuIHdlIGdvIGludG8gYSBwb3J0YWwsIGl0IGJlY29tZXMgdGhlIHBhcmVudCB0byByZW1vdmUgZnJvbS5cbiAgICAgICAgICB2YXIgX3ByZXZIb3N0UGFyZW50ID0gaG9zdFBhcmVudDtcbiAgICAgICAgICB2YXIgX3ByZXZIb3N0UGFyZW50SXNDb250YWluZXIgPSBob3N0UGFyZW50SXNDb250YWluZXI7XG4gICAgICAgICAgaG9zdFBhcmVudCA9IGRlbGV0ZWRGaWJlci5zdGF0ZU5vZGUuY29udGFpbmVySW5mbztcbiAgICAgICAgICBob3N0UGFyZW50SXNDb250YWluZXIgPSB0cnVlO1xuICAgICAgICAgIHJlY3Vyc2l2ZWx5VHJhdmVyc2VEZWxldGlvbkVmZmVjdHMoZmluaXNoZWRSb290LCBuZWFyZXN0TW91bnRlZEFuY2VzdG9yLCBkZWxldGVkRmliZXIpO1xuICAgICAgICAgIGhvc3RQYXJlbnQgPSBfcHJldkhvc3RQYXJlbnQ7XG4gICAgICAgICAgaG9zdFBhcmVudElzQ29udGFpbmVyID0gX3ByZXZIb3N0UGFyZW50SXNDb250YWluZXI7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICBjYXNlIEZ1bmN0aW9uQ29tcG9uZW50OlxuICAgIGNhc2UgRm9yd2FyZFJlZjpcbiAgICBjYXNlIE1lbW9Db21wb25lbnQ6XG4gICAgY2FzZSBTaW1wbGVNZW1vQ29tcG9uZW50OlxuICAgICAge1xuICAgICAgICBpZiAoIW9mZnNjcmVlblN1YnRyZWVXYXNIaWRkZW4pIHtcbiAgICAgICAgICB2YXIgdXBkYXRlUXVldWUgPSBkZWxldGVkRmliZXIudXBkYXRlUXVldWU7XG5cbiAgICAgICAgICBpZiAodXBkYXRlUXVldWUgIT09IG51bGwpIHtcbiAgICAgICAgICAgIHZhciBsYXN0RWZmZWN0ID0gdXBkYXRlUXVldWUubGFzdEVmZmVjdDtcblxuICAgICAgICAgICAgaWYgKGxhc3RFZmZlY3QgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgdmFyIGZpcnN0RWZmZWN0ID0gbGFzdEVmZmVjdC5uZXh0O1xuICAgICAgICAgICAgICB2YXIgZWZmZWN0ID0gZmlyc3RFZmZlY3Q7XG5cbiAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIHZhciBfZWZmZWN0ID0gZWZmZWN0LFxuICAgICAgICAgICAgICAgICAgICBkZXN0cm95ID0gX2VmZmVjdC5kZXN0cm95LFxuICAgICAgICAgICAgICAgICAgICB0YWcgPSBfZWZmZWN0LnRhZztcblxuICAgICAgICAgICAgICAgIGlmIChkZXN0cm95ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgIGlmICgodGFnICYgSW5zZXJ0aW9uKSAhPT0gTm9GbGFncyQxKSB7XG4gICAgICAgICAgICAgICAgICAgIHNhZmVseUNhbGxEZXN0cm95KGRlbGV0ZWRGaWJlciwgbmVhcmVzdE1vdW50ZWRBbmNlc3RvciwgZGVzdHJveSk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCh0YWcgJiBMYXlvdXQpICE9PSBOb0ZsYWdzJDEpIHtcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgIG1hcmtDb21wb25lbnRMYXlvdXRFZmZlY3RVbm1vdW50U3RhcnRlZChkZWxldGVkRmliZXIpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCBkZWxldGVkRmliZXIubW9kZSAmIFByb2ZpbGVNb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgc3RhcnRMYXlvdXRFZmZlY3RUaW1lcigpO1xuICAgICAgICAgICAgICAgICAgICAgIHNhZmVseUNhbGxEZXN0cm95KGRlbGV0ZWRGaWJlciwgbmVhcmVzdE1vdW50ZWRBbmNlc3RvciwgZGVzdHJveSk7XG4gICAgICAgICAgICAgICAgICAgICAgcmVjb3JkTGF5b3V0RWZmZWN0RHVyYXRpb24oZGVsZXRlZEZpYmVyKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICBzYWZlbHlDYWxsRGVzdHJveShkZWxldGVkRmliZXIsIG5lYXJlc3RNb3VudGVkQW5jZXN0b3IsIGRlc3Ryb3kpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgIG1hcmtDb21wb25lbnRMYXlvdXRFZmZlY3RVbm1vdW50U3RvcHBlZCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAg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dvcmsucmV0dXJuLCBlcnJvcik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJlY29yZExheW91dEVmZmVjdER1cmF0aW9uKGZpbmlzaGVkV29yayk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGNvbW1pdEhvb2tFZmZlY3RMaXN0VW5tb3VudChMYXlvdXQgfCBIYXNFZmZlY3QsIGZpbmlzaGVkV29yaywgZmluaXNoZWRXb3JrLnJldHVybik7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICBjYXB0dXJlQ29tbWl0UGhhc2VFcnJvcihmaW5pc2hlZFdvcmssIGZpbmlzaGVkV29yay5yZXR1cm4sIGVycm9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICBjYXNlIENsYXNzQ29tcG9uZW50OlxuICAgICAge1xuICAgICAgICByZWN1cnNpdmVseVRyYXZlcnNlTXV0YXRpb25FZmZlY3RzKHJvb3QsIGZpbmlzaGVkV29yayk7XG4gICAgICAgIGNvbW1pdFJlY29uY2lsaWF0aW9uRWZmZWN0cyhmaW5pc2hlZFdvcmspO1xuXG4gICAgICAgIGlmIChmbGFncyAmIFJlZikge1xuICAgICAgICAgIGlmIChjdXJyZW50ICE9PSBudWxsKSB7XG4gICAgICAgICAgICBzYWZlbHlEZXRhY2hSZWYoY3VycmVudCwgY3VycmVudC5yZXR1cm4pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgIHtcbiAgICAgICAgcmVjdXJzaXZlbHlUcmF2ZXJzZU11dGF0aW9uRWZmZWN0cyhyb290LCBmaW5pc2hlZFdvcmspO1xuICAgICAgICBjb21taXRSZWNvbmNpbGlhdGlvbkVmZmVjdHMoZmluaXNoZWRXb3JrKTtcblxuICAgICAgICBpZiAoZmxhZ3MgJiBSZWYpIHtcbiAgICAgICAgICBpZiAoY3VycmVudCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgc2FmZWx5RGV0YWNoUmVmKGN1cnJlbnQsIGN1cnJlbnQucmV0dXJuKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB7XG4gICAgICAgICAgLy8gVE9ETzogQ29udGVudFJlc2V0IGdldHMgY2xlYXJlZCBieSB0aGUgY2hpbGRyZW4gZHVyaW5nIHRoZSBjb21taXRcbiAgICAgICAgICAvLyBwaGFzZS4gVGhpcyBpcyBhIHJlZmFjdG9yIGhhemFyZCBiZWNhdXNlIGl0IG1lYW5zIHdlIG11c3QgcmVhZFxuICAgICAgICAgIC8vIGZsYWdzIHRoZSBmbGFncyBhZnRlciBgY29tbWl0UmVjb25jaWxpYXRpb25FZmZlY3RzYCBoYXMgYWxyZWFkeSBydW47XG4gICAgICAgICAgLy8gdGhlIG9yZGVyIG1hdHRlcnMuIFdlIHNob3VsZCByZWZhY3RvciBzbyB0aGF0IENvbnRlbnRSZXNldCBkb2VzIG5vdFxuICAgICAgICAgIC8vIHJlbHkgb24gbXV0YXRpbmcgdGhlIGZsYWcgZHVyaW5nIGNvbW1pdC4gTGlrZSBieSBzZXR0aW5nIGEgZmxhZ1xuICAgICAgICAgIC8vIGR1cmluZyB0aGUgcmVuZGVyIHBoYXNlIGluc3RlYWQuXG4gICAgICAgICAgaWYgKGZpbmlzaGVkV29yay5mbGFncyAmIENvbnRlbnRSZXNldCkge1xuICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gZmluaXNoZWRXb3JrLnN0YXRlTm9kZTtcblxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgcmVzZXRUZXh0Q29udGVudChpbnN0YW5jZSk7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICBjYXB0d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pZiAodXBkYXRlUGF5bG9hZCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICBjb21taXRVcGRhdGUoX2luc3RhbmNlNCwgdXBkYXRlUGF5bG9hZCwgdHlwZSwgb2xkUHJvcHMsIG5ld1Byb3BzLCBmaW5pc2hlZFdvcmspO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICBjYXB0dXJlQ29tbWl0UGhhc2VFcnJvcihmaW5pc2hlZFdvcmssIGZpbmlzaGVkV29yay5yZXR1cm4sIGVycm9yKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICBjYXNlIEhvc3RUZXh0OlxuICAgICAge1xuICAgICAgICByZWN1cnNpdmVseVRyYXZlcnNlTXV0YXRpb25FZmZlY3RzKHJvb3QsIGZpbmlzaGVkV29yayk7XG4gICAgICAgIGNvbW1pdFJlY29uY2lsaWF0aW9uRWZmZWN0cyhmaW5pc2hlZFdvcmspO1xuXG4gICAgICAgIGlmIChmbGFncyAmIFVwZGF0ZSkge1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGlmIChmaW5pc2hlZFdvcmsuc3RhdGVOb2RlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVGhpcyBzaG91bGQgaGF2ZSBhIHRleHQgbm9kZSBpbml0aWFsaXplZC4gVGhpcyBlcnJvciBpcyBsaWtlbHkgJyArICdjYXVzZWQgYnkgYSBidWcgaW4gUmVhY3QuIFBsZWFzZSBmaWxlIGFuIGlzc3VlLicpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgdGV4dEluc3RhbmNlID0gZmluaXNoZWRXb3JrLnN0YXRlTm9kZTtcbiAgICAgICAgICAgIHZhciBuZXdUZXh0ID0gZmluaXNoZWRXb3JrLm1lbW9pemVkUHJvcHM7IC8vIEZvciBoeWRyYXRpb24gd2UgcmV1c2UgdGhlIHVwZGF0ZSBwYXRoIGJ1dCB3ZSB0cmVhdCB0aGUgb2xkUHJvcHNcbiAgICAgICAgICAgIC8vIGFzIHRoZSBuZXdQcm9wcy4gVGhlIHVwZGF0ZVBheWxvYWQgd2lsbCBjb250YWluIHRoZSByZWFsIGNoYW5nZSBpblxuICAgICAgICAgICAgLy8gdGhpcyBjYXNlLlxuXG4gICAgICAgICAgICB2YXIgb2xkVGV4dCA9IGN1cnJlbnQgIT09IG51bGwgPyBjdXJyZW50Lm1lbW9pemVkUHJvcHMgOiBuZXdUZXh0O1xuXG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBjb21taXRUZXh0VXBkYXRlKHRleHRJbnN0YW5jZSwgb2xkVGV4dCwgbmV3VGV4dCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICBjYXB0dXJlQ29tbWl0UGhhc2VFcnJvcihmaW5pc2hlZFdvcmssIGZpbmlzaGVkV29yay5yZXR1cm4sIGVycm9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICBjYXNlIEhvc3RSb290OlxuICAgICAge1xuICAgICAgICByZWN1cnNpdmVseVRyYXZlcnNlTXV0YXRpb25FZmZlY3RzKHJvb3QsIGZpbmlzaGVkV29yayk7XG4gICAgICAgIGNvbW1pdFJlY29uY2lsaWF0aW9uRWZmZWN0cyhmaW5pc2hlZFdvcmspO1xuXG4gICAgICAgIGlmIChmbGFncyAmIFVwZGF0ZSkge1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGlmIChjdXJyZW50ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgIHZhciBwcmV2Um9vdFN0YXRlID0gY3VycmVudC5tZW1vaXplZFN0YXRlO1xuXG4gICAgICAgICAgICAgIGlmIChwcmV2Um9vdFN0YXRlLmlzRGVoeWRyYXRlZCkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICBjb21taXRIeWRyYXRlZENvbnRhaW5lcihyb290LmNvbnRhaW5lckluZm8pO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICBjYXB0dXJlQ29tbWl0UGhhc2VFcnJvcihmaW5pc2hlZFdvcmssIGZpbmlzaGVkV29yay5yZXR1cm4sIGVycm9yKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICBjYXNlIEhvc3RQb3J0YWw6XG4gICAgICB7XG4gICAgICAgIHJlY3Vyc2l2ZWx5VHJhdmVyc2VNdXRhdGlvbkVmZmVjdHMocm9vdCwgZmluaXNoZWRXb3JrKTtcbiAgICAgICAgY29tbWl0UmVjb25jaWxpYXRpb25FZmZlY3RzKGZpbmlzaGVkV29yayk7XG5cbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgY2FzZSBTdXNwZW5zZUNvbXBvbmVudDpcbiAgICAgIHtcbiAgICAgICAgcmVjdXJzaXZlbHlUcmF2ZXJzZU11dGF0aW9uRWZmZWN0cyhyb290LCBmaW5pc2hlZFdvcmspO1xuICAgICAgICBjb21taXRSZWNvbmNpbGlhdGlvbkVmZmVjdHMoZmluaXNoZWRXb3JrKTtcbiAgICAgICAgdmFyIG9mZnNjcmVlbkZpYmVyID0gZmluaXNoZWRXb3JrLmNoaWxkO1xuXG4gICAgICAgIGlmIChvZmZzY3JlZW5GaWJlci5mbGFncyAmIFZpc2liaWxpdHkpIHtcbiAgICAgICAgICB2YXIgb2Zmc2NyZWVuSW5zdGFuY2UgPSBvZmZz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uKSBDaGVjazogZmxhZ3MgJiAoUmVmU3RhdGljIHwgTGF5b3V0U3RhdGljKVxuXG4gICAgc3dpdGNoIChmaWJlci50YWcpIHtcbiAgICAgIGNhc2UgRnVuY3Rpb25Db21wb25lbnQ6XG4gICAgICBjYXNlIEZvcndhcmRSZWY6XG4gICAgICBjYXNlIE1lbW9Db21wb25lbnQ6XG4gICAgICBjYXNlIFNpbXBsZU1lbW9Db21wb25lbnQ6XG4gICAgICAgIHtcbiAgICAgICAgICBpZiAoIGZpYmVyLm1vZGUgJiBQcm9maWxlTW9kZSkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgc3RhcnRMYXlvdXRFZmZlY3RUaW1lcigpO1xuICAgICAgICAgICAgICBjb21taXRIb29rRWZmZWN0TGlzdFVubW91bnQoTGF5b3V0LCBmaWJlciwgZmliZXIucmV0dXJuKTtcbiAgICAgICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgICAgIHJlY29yZExheW91dEVmZmVjdER1cmF0aW9uKGZpYmVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29tbWl0SG9va0VmZmVjdExpc3RVbm1vdW50KExheW91dCwgZmliZXIsIGZpYmVyLnJldHVybik7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgY2FzZSBDbGFzc0NvbXBvbmVudDpcbiAgICAgICAge1xuICAgICAgICAgIC8vIFRPRE8gKE9mZnNjcmVlbikgQ2hlY2s6IGZsYWdzICYgUmVmU3RhdGljXG4gICAgICAgICAgc2FmZWx5RGV0YWNoUmVmKGZpYmVyLCBmaWJlci5yZXR1cm4pO1xuICAgICAgICAgIHZhciBpbnN0YW5jZSA9IGZpYmVyLnN0YXRlTm9kZTtcblxuICAgICAgICAgIGlmICh0eXBlb2YgaW5zdGFuY2UuY29tcG9uZW50V2lsbFVubW91bnQgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIHNhZmVseUNhbGxDb21wb25lbnRXaWxsVW5tb3VudChmaWJlciwgZmliZXIucmV0dXJuLCBpbnN0YW5jZSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgc2FmZWx5RGV0YWNoUmVmKGZpYmVyLCBmaWJlci5yZXR1cm4pO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgIGNhc2UgT2Zmc2NyZWVuQ29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgLy8gQ2hlY2sgaWYgdGhpcyBpcyBhXG4gICAgICAgICAgdmFyIGlzSGlkZGVuID0gZmliZXIubWVtb2l6ZWRTdGF0ZSAhPT0gbnVsbDtcblxuICAgICAgICAgIGlmIChpc0hpZGRlbikge1xuICAgICAgICAgICAgLy8gTmVzdGVkIE9mZnNjcmVlbiB0cmVlIGlzIGFscmVhZHkgaGlkZGVuLiBEb24ndCBkaXNhcHBlYXJcbiAgICAgICAgICAgIC8vIGl0cyBlZmZlY3RzLlxuICAgICAgICAgICAgZGlzYXBwZWFyTGF5b3V0RWZmZWN0c19jb21wbGV0ZShzdWJ0cmVlUm9vdCk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgIH0gLy8gVE9ETyAoT2Zmc2NyZWVuKSBDaGVjazogc3VidHJlZUZsYWdzICYgTGF5b3V0U3RhdGljXG5cblxuICAgIGlmIChmaXJzdENoaWxkICE9PSBudWxsKSB7XG4gICAgICBmaXJzdENoaWxkLnJldHVybiA9IGZpYmVyO1xuICAgICAgbmV4dEVmZmVjdCA9IGZpcnN0Q2hpbGQ7XG4gICAgfSBlbHNlIHtcbiAgICAgIGRpc2FwcGVhckxheW91dEVmZmVjdHNfY29tcGxld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BicmVhaztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIENsYXNzQ29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIGluc3RhbmNlID0gZmliZXIuc3RhdGVOb2RlO1xuXG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGluc3RhbmNlLmNvbXBvbmVudERpZE1vdW50KCk7XG4gICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIGNhcHR1cmVDb21taXRQaGFzZUVycm9yKGZpYmVyLCBmaWJlci5yZXR1cm4sIGVycm9yKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgIH1cbiAgfVxufVxuXG5mdW5jdGlvbiBpbnZva2VQYXNzaXZlRWZmZWN0TW91bnRJbkRFVihmaWJlcikge1xuICB7XG4gICAgLy8gV2UgZG9uJ3QgbmVlZCB0byByZS1jaGVjayBTdHJpY3RFZmZlY3RzTW9kZSBoZXJlLlxuICAgIC8vIFRoaXMgZnVuY3Rpb24gaXMgb25seSBjYWxsZWQgaWYgdGhhdCBjaGVjayBoYXMgYWxyZWFkeSBwYXNzZWQuXG4gICAgc3dpdGNoIChmaWJlci50YWcpIHtcbiAgICAgIGNhc2UgRnVuY3Rpb25Db21wb25lbnQ6XG4gICAgICBjYXNlIEZvcndhcmRSZWY6XG4gICAgICBjYXNlIFNpbXBsZU1lbW9Db21wb25lbnQ6XG4gICAgICAgIHtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgY29tbWl0SG9va0VmZmVjdExpc3RNb3VudChQYXNzaXZlJDEgfCBIYXNFZmZlY3QsIGZpYmVyKTtcbiAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgY2FwdHVyZUNvbW1pdFBoYXNlRXJyb3IoZmliZXIsIGZpYmVyLnJldHVybiwgZXJyb3IpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuICB9XG59XG5cbmZ1bmN0aW9uIGludm9rZUxheW91dEVmZmVjdFVubW91bnRJbkRFVihmaWJlcikge1xuICB7XG4gICAgLy8gV2UgZG9uJ3QgbmVlZCB0byByZS1jaGVjayBTdHJpY3RFZmZlY3RzTW9kZSBoZXJlLlxuICAgIC8vIFRoaXMgZnVuY3Rpb24gaXMgb25seSBjYWxsZWQgaWYgdGhhdCBjaGVjayBoYXMgYWxyZWFkeSBwYXNzZWQuXG4gICAgc3dpdGNoIChmaWJlci50YWcpIHtcbiAgICAgIGNhc2UgRnVuY3Rpb25Db21wb25lbnQ6XG4gICAgICBjYXNlIEZvcndhcmRSZWY6XG4gICAgICBjYXNlIFNpbXBsZU1lbW9Db21wb25lbnQ6XG4gICAgICAgIHtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgY29tbWl0SG9va0VmZmVjdExpc3RVbm1vdW50KExheW91dCB8IEhhc0VmZmVjdCwgZmliZXIsIGZpYmVyLnJldHVybik7XG4gICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIGNhcHR1cmVDb21taXRQaGFzZUVycm9yKGZpYmVyLCBmaWJlci5yZXR1cm4sIGVycm9yKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIENsYXNzQ29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIGluc3RhbmNlID0gZmliZXIuc3RhdGVOb2RlO1xuXG4gICAgICAgICAgaWYgKHR5cGVvZiBpbnN0YW5jZS5jb21wb25lbnRXaWxsVW5tb3VudCA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgc2FmZWx5Q2FsbENvbXBvbmVudFdpbGxVbm1vdW50KGZpYmVyLCBmaWJlci5yZXR1cm4sIGluc3RhbmNlKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgIH1cb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0byByZWFjaCByb290IGZpcnN0LicpO1xuICAgICAgfVxuXG4gICAgICBub2RlID0gbm9kZS5yZXR1cm47XG4gICAgfVxuICB9XG59XG5cbmZ1bmN0aW9uIGZpbmRDaGlsZEhvc3RJbnN0YW5jZXNGb3JGaWJlclNoYWxsb3dseShmaWJlciwgaG9zdEluc3RhbmNlcykge1xuICB7XG4gICAgdmFyIG5vZGUgPSBmaWJlcjtcbiAgICB2YXIgZm91bmRIb3N0SW5zdGFuY2VzID0gZmFsc2U7XG5cbiAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgaWYgKG5vZGUudGFnID09PSBIb3N0Q29tcG9uZW50KSB7XG4gICAgICAgIC8vIFdlIGdvdCBhIG1hdGNoLlxuICAgICAgICBmb3VuZEhvc3RJbnN0YW5jZXMgPSB0cnVlO1xuICAgICAgICBob3N0SW5zdGFuY2VzLmFkZChub2RlLnN0YXRlTm9kZSk7IC8vIFRoZXJlIG1heSBzdGlsbCBiZSBtb3JlLCBzbyBrZWVwIHNlYXJjaGluZy5cbiAgICAgIH0gZWxzZSBpZiAobm9kZS5jaGlsZCAhPT0gbnVsbCkge1xuICAgICAgICBub2RlLmNoaWxkLnJldHVybiA9IG5vZGU7XG4gICAgICAgIG5vZGUgPSBub2RlLmNoaWxkO1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgaWYgKG5vZGUgPT09IGZpYmVyKSB7XG4gICAgICAgIHJldHVybiBmb3VuZEhvc3RJbnN0YW5jZXM7XG4gICAgICB9XG5cbiAgICAgIHdoaWxlIChub2RlLnNpYmxpbmcgPT09IG51bGwpIHtcbiAgICAgICAgaWYgKG5vZGUucmV0dXJuID09PSBudWxsIHx8IG5vZGUucmV0dXJuID09PSBmaWJlcikge1xuICAgICAgICAgIHJldHVybiBmb3VuZEhvc3RJbnN0YW5jZXM7XG4gICAgICAgIH1cblxuICAgICAgICBub2RlID0gbm9kZS5yZXR1cm47XG4gICAgICB9XG5cbiAgICAgIG5vZGU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gICAgICAgICAgICBjYXNlIFJFQUNUX0ZPUldBUkRfUkVGX1RZUEU6XG4gICAgICAgICAgICAgICAgZmliZXJUYWcgPSBGb3J3YXJkUmVmO1xuXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZWRUeXBlID0gcmVzb2x2ZUZvcndhcmRSZWZGb3JIb3RSZWxvYWRpbmcocmVzb2x2ZWRUeXBlKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBicmVhayBnZXRUYWc7XG5cbiAgICAgICAgICAgICAgY2FzZSBSRUFDVF9NRU1PX1RZUEU6XG4gICAgICAgICAgICAgICAgZmliZXJUYWcgPSBNZW1vQ29tcG9uZW50O1xuICAgICAgICAgICAgICAgIGJyZWFrIGdldFRhZztcblxuICAgICAgICAgICAgICBjYXNlIFJFQUNUX0xBWllfVFlQRTpcbiAgICAgICAgICAgICAgICBmaWJlclRhZyA9IExhenlDb21wb25lbnQ7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZWRUeXBlID0gbnVsbDtcbiAgICAgICAgICAgICAgICBicmVhayBnZXRUYWc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdmFyIGluZm8gPSAnJztcblxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGlmICh0eXBlID09PSB1bmRlZmluZWQgfHwgdHlwZW9mIHR5cGUgPT09ICdvYmplY3QnICYmIHR5cGUgIT09IG51bGwgJiYgT2JqZWN0LmtleXModHlwZSkubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgIGluZm8gKz0gJyBZb3UgbGlrZWx5IGZvcmdvdCB0byBleHBvcnQgeW91ciBjb21wb25lbnQgZnJvbSB0aGUgZmlsZSAnICsgXCJpdCdzIGRlZmluZWQgaW4sIG9yIHlvdSBtaWdodCBoYXZlIG1peGVkIHVwIGRlZmF1bHQgYW5kIFwiICsgJ25hbWVkIGltcG9ydHMuJztcbiAgICAgICAgICAg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XG4gICAgICAgIG9yaWdpbmFsQ2FsbGJhY2suY2FsbChpbnN0YW5jZSk7XG4gICAgICB9O1xuICAgIH1cblxuICAgIHZhciByb290ID0gY3JlYXRlSHlkcmF0aW9uQ29udGFpbmVyKGluaXRpYWxDaGlsZHJlbiwgY2FsbGJhY2ssIGNvbnRhaW5lciwgTGVnYWN5Um9vdCwgbnVsbCwgLy8gaHlkcmF0aW9uQ2FsbGJhY2tzXG4gICAgZmFsc2UsIC8vIGlzU3RyaWN0TW9kZVxuICAgIGZhbHNlLCAvLyBjb25jdXJyZW50VXBkYXRlc0J5RGVmYXVsdE92ZXJyaWRlLFxuICAgICcnLCAvLyBpZGVudGlmaWVyUHJlZml4XG4gICAgbm9vcE9uUmVjb3ZlcmFibGVFcnJvcik7XG4gICAgY29udGFpbmVyLl9yZWFjdFJvb3RDb250YWluZXIgPSByb290O1xuICAgIG1hcmtDb250YWluZXJBc1Jvb3Qocm9vdC5jdXJyZW50LCBjb250YWluZXIpO1xuICAgIHZhciByb290Q29udGFpbmVyRWxlbWVudCA9IGNvbnRhaW5lci5ub2RlVHlwZSA9PT0gQ09NTUVOVF9OT0RFID8gY29udGFpbmVyLnBhcmVudE5vZGUgOiBjb250YWluZXI7XG4gICAgbGlzdGVuVG9BbGxTdXBwb3J0ZWRFdmVudHMocm9vdENvbnRhaW5lckVsZW1lbnQpO1xuICAgIGZsdXNoU3luYygpO1xuICAgIHJldHVybiByb290O1xuICB9IGVsc2Uge1xuICAgIC8vIEZpcnN0IGNsZWFyIGFueSBleGlzdGluZyBjb250ZW50LlxuICAgIHZhciByb290U2libGluZztcblxuICAgIHdoaWxlIChyb290U2libGluZyA9IGNvbnRhaW5lci5sYXN0Q2hpbGQpIHtcbiAgICAgIGNvbnRhaW5lci5yZW1vdmVDaGlsZChyb290U2libGluZyk7XG4gICAgfVxuXG4gICAgaWYgKHR5cGVvZiBjYWxsYmFjayA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgdmFyIF9vcmlna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dGVzJDE7XG5leHBvcnRzLnVuc3RhYmxlX3JlbmRlclN1YnRyZWVJbnRvQ29udGFpbmVyID0gcmVuZGVyU3VidHJlZUludG9Db250YWluZXI7XG5leHBvcnRzLnZlcnNpb24gPSBSZWFjdFZlcnNpb247XG4gICAgICAgICAgLyogZ2xvYmFsIF9fUkVBQ1RfREVWVE9PTFNfR0xPQkFMX0hPT0tfXyAqL1xuaWYgKFxuICB0eXBlb2YgX19SRUFDVF9ERVZUT09MU19HTE9CQUxfSE9PS19fICE9PSAndW5kZWZpbmVkJyAmJlxuICB0eXBlb2YgX19SRUFDVF9ERVZUT09MU19HTE9CQUxfSE9PS19fLnJlZ2lzdGVySW50ZXJuYWxNb2R1bGVTdG9wID09PVxuICAgICdmdW5jdGlvbidcbikge1xuICBfX1JFQUNUX0RFVlRPT0xTX0dMT0JBTF9IT09LX18ucmVnaXN0ZXJJbnRlcm5hbE1vZHVsZVN0b3AobmV3IEVycm9yKCkpO1xufVxuICAgICAgICBcbiAgfSkoKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js\n")); /***/ }), /***/ "./node_modules/react-dom/client.js": /*!******************************************!*\ !*** ./node_modules/react-dom/client.js ***! \******************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\n\nvar m = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\nif (false) {} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n//# sourceURL=[module]\n//# sour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HNlO1xuICAgIH1cbiAgfTtcbiAgZXhwb3J0cy5oeWRyYXRlUm9vdCA9IGZ1bmN0aW9uKGMsIGgsIG8pIHtcbiAgICBpLnVzaW5nQ2xpZW50RW50cnlQb2ludCA9IHRydWU7XG4gICAgdHJ5IHtcbiAgICAgIHJldHVybiBtLmh5ZHJhdGVSb290KGMsIGgsIG8pO1xuICAgIH0gZmluYWxseSB7XG4gICAgICBpLnVzaW5nQ2xpZW50RW50cnlQb2ludCA9IGZhbHNlO1xuICAgIH1cbiAgfTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/react-dom/client.js\n")); /***/ }), /***/ "./node_modules/react-dom/index.js": /*!*****************************************!*\ !*** ./node_modules/react-dom/index.js ***! \*****************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (true) {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-dom.development.js */ \"./node_modules/react-dom/cjs/react-dom.development.js\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJza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biBkdXJpbmcgaW5qZWN0aW9uLlxuICBjaGVja0RDRSgpO1xuICBtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vY2pzL3JlYWN0LWRvbS5wcm9kdWN0aW9uLm1pbi5qcycpO1xufSBlbHNlIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9yZWFjdC1kb20uZGV2ZWxvcG1lbnQuanMnKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/react-dom/index.js\n")); /***/ }), /***/ "./node_modules/react/cjs/react.development.js": /*!*****************************************************!*\ !*** ./node_modules/react/cjs/react.development.js ***! \*****************************************************/ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("/* module decorator */ module = __webpack_require__.nmd(module);\n/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.2.0';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner\n};\n\n{\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\n}\n\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n {\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 printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar assign = Object.assign;\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = key.replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\n}\n/**\n * Generate a key string that identifies a element within a set.\n *\n * @param {*} element A element that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getElementKey(element, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof element === 'object' && element !== null && element.key != null) {\n // Explicit key\n {\n checkKeyStringCoercion(element.key);\n }\n\n return escape('' + element.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n var _child = children;\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows:\n\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\n\n if (isArray(mappedChild)) {\n var escapedChildKey = '';\n\n if (childKey != null) {\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\n }\n\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n {\n // The `if` statement here prevents auto-disabling of the safe\n // coercion ESLint rule, so we must manually disable it below.\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\n checkKeyStringCoercion(mappedChild.key);\n }\n }\n\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\n // eslint-disable-next-line react-internal/safe-string-coercion\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\n }\n\n array.push(mappedChild);\n }\n\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getElementKey(child, i);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var iterableChildren = children;\n\n {\n // Warn about using Maps as children\n if (iteratorFn === iterableChildren.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(iterableChildren);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getElementKey(child, ii++);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else if (type === 'object') {\n // eslint-disable-next-line react-internal/safe-string-coercion\n var childrenString = String(children);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n }\n\n return subtreeCount;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n var count = 0;\n mapIntoArray(children, result, '', '', function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n var n = 0;\n mapChildren(children, function () {\n n++; // Don't return anything\n });\n return n;\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n mapChildren(children, function () {\n forEachFunc.apply(this, arguments); // Don't return anything.\n }, forEachContext);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n throw new Error('React.Children.only expected to receive a single React element child.');\n }\n\n return children;\n}\n\nfunction createContext(defaultValue) {\n // TODO: Second argument used to be an optional `calculateChangedBits`\n // function. Warn to reserve for future use?\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null,\n // Add these to use same hidden class in VM as ServerContext\n _defaultValue: null,\n _globalName: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n var hasWarnedAboutDisplayNameOnConsumer = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n },\n displayName: {\n get: function () {\n return context.displayName;\n },\n set: function (displayName) {\n if (!hasWarnedAboutDisplayNameOnConsumer) {\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\n\n hasWarnedAboutDisplayNameOnConsumer = true;\n }\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\n\nfunction lazyInitializer(payload) {\n if (payload._status === Uninitialized) {\n var ctor = payload._result;\n var thenable = ctor(); // Transition to the next state.\n // This might throw either because it's missing or throws. If so, we treat it\n // as still uninitialized and try again next time. Which is the same as what\n // happens if the ctor or any wrappers processing the ctor throws. This might\n // end up fixing it if the resolution was a concurrency bug.\n\n thenable.then(function (moduleObject) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var resolved = payload;\n resolved._status = Resolved;\n resolved._result = moduleObject;\n }\n }, function (error) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var rejected = payload;\n rejected._status = Rejected;\n rejected._result = error;\n }\n });\n\n if (payload._status === Uninitialized) {\n // In case, we're still uninitialized, then we're waiting for the thenable\n // to resolve. Set it as pending in the meantime.\n var pending = payload;\n pending._status = Pending;\n pending._result = thenable;\n }\n }\n\n if (payload._status === Resolved) {\n var moduleObject = payload._result;\n\n {\n if (moduleObject === undefined) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\n }\n }\n\n {\n if (!('default' in moduleObject)) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\n }\n }\n\n return moduleObject.default;\n } else {\n throw payload._result;\n }\n}\n\nfunction lazy(ctor) {\n var payload = {\n // We use these fields to store the result.\n _status: Uninitialized,\n _result: ctor\n };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: payload,\n _init: lazyInitializer\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes; // $FlowFixMe\n\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n var elementType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.forwardRef((props, ref) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!render.name && !render.displayName) {\n render.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n var elementType = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.memo((props) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!type.name && !type.displayName) {\n type.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n {\n if (dispatcher === null) {\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n } // Will result in a null access error if accessed outside render phase. We\n // intentionally don't throw our own error because this is in a hot path.\n // Also helps ensure this is inlined.\n\n\n return dispatcher;\n}\nfunction useContext(Context) {\n var dispatcher = resolveDispatcher();\n\n {\n // TODO: add a more generic warning for invalid values.\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useInsertionEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useInsertionEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\nfunction useTransition() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useTransition();\n}\nfunction useDeferredValue(value) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDeferredValue(value);\n}\nfunction useId() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useId();\n}\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher$1.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher$1.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n setExtraStackFrame(stack);\n } else {\n setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n {\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\nfunction startTransition(scope, options) {\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = {};\n var currentTransition = ReactCurrentBatchConfig.transition;\n\n {\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\n }\n\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nvar didWarnAboutMessageChannel = false;\nvar enqueueTaskImpl = null;\nfunction enqueueTask(task) {\n if (enqueueTaskImpl === null) {\n try {\n // read require off the module object to get around the bundlers.\n // we don't want them to detect a require and bundle a Node polyfill.\n var requireString = ('require' + Math.random()).slice(0, 7);\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\n // version of setImmediate, bypassing fake timers if any.\n\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\n } catch (_err) {\n // we're in a browser\n // we can't use regular timers because they may still be faked\n // so we try MessageChannel+postMessage instead\n enqueueTaskImpl = function (callback) {\n {\n if (didWarnAboutMessageChannel === false) {\n didWarnAboutMessageChannel = true;\n\n if (typeof MessageChannel === 'undefined') {\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\n }\n }\n }\n\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(undefined);\n };\n }\n }\n\n return enqueueTaskImpl(task);\n}\n\nvar actScopeDepth = 0;\nvar didWarnNoAwaitAct = false;\nfunction act(callback) {\n {\n // `act` calls can be nested, so we track the depth. This represents the\n // number of `act` scopes on the stack.\n var prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n\n if (ReactCurrentActQueue.current === null) {\n // This is the outermost `act` scope. Initialize the queue. The reconciler\n // will detect the queue and use it instead of Scheduler.\n ReactCurrentActQueue.current = [];\n }\n\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\n var result;\n\n try {\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\n // set to `true` while the given callback is executed, not for updates\n // triggered during an async event, because this is how the legacy\n // implementation of `act` behaved.\n ReactCurrentActQueue.isBatchingLegacy = true;\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\n // which flushed updates immediately after the scope function exits, even\n // if it's an async function.\n\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\n flushActQueue(queue);\n }\n }\n } catch (error) {\n popActScope(prevActScopeDepth);\n throw error;\n } finally {\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\n }\n\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\n // for it to resolve before exiting the current scope.\n\n var wasAwaited = false;\n var thenable = {\n then: function (resolve, reject) {\n wasAwaited = true;\n thenableResult.then(function (returnValue) {\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // We've exited the outermost act scope. Recursively flush the\n // queue until there's no remaining work.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }, function (error) {\n // The callback threw an error.\n popActScope(prevActScopeDepth);\n reject(error);\n });\n }\n };\n\n {\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\n // eslint-disable-next-line no-undef\n Promise.resolve().then(function () {}).then(function () {\n if (!wasAwaited) {\n didWarnNoAwaitAct = true;\n\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\n }\n });\n }\n }\n\n return thenable;\n } else {\n var returnValue = result; // The callback is not an async function. Exit the current scope\n // immediately, without awaiting.\n\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // Exiting the outermost act scope. Flush the queue.\n var _queue = ReactCurrentActQueue.current;\n\n if (_queue !== null) {\n flushActQueue(_queue);\n ReactCurrentActQueue.current = null;\n } // Return a thenable. If the user awaits it, we'll flush again in\n // case additional work was scheduled by a microtask.\n\n\n var _thenable = {\n then: function (resolve, reject) {\n // Confirm we haven't re-entered another `act` scope, in case\n // the user does something weird like await the thenable\n // multiple times.\n if (ReactCurrentActQueue.current === null) {\n // Recursively flush the queue until there's no remaining work.\n ReactCurrentActQueue.current = [];\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }\n };\n return _thenable;\n } else {\n // Since we're inside a nested `act` scope, the returned thenable\n // immediately resolves. The outer scope will flush the queue.\n var _thenable2 = {\n then: function (resolve, reject) {\n resolve(returnValue);\n }\n };\n return _thenable2;\n }\n }\n }\n}\n\nfunction popActScope(prevActScopeDepth) {\n {\n if (prevActScopeDepth !== actScopeDepth - 1) {\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\n }\n\n actScopeDepth = prevActScopeDepth;\n }\n}\n\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n if (queue.length === 0) {\n // No additional work was scheduled. Finish.\n ReactCurrentActQueue.current = null;\n resolve(returnValue);\n } else {\n // Keep flushing work until there's none left.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n }\n });\n } catch (error) {\n reject(error);\n }\n } else {\n resolve(returnValue);\n }\n }\n}\n\nvar isFlushing = false;\n\nfunction flushActQueue(queue) {\n {\n if (!isFlushing) {\n // Prevent re-entrance.\n isFlushing = true;\n var i = 0;\n\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(true);\n } while (callback !== null);\n }\n\n queue.length = 0;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n queue = queue.slice(i + 1);\n throw error;\n } finally {\n isFlushing = false;\n }\n }\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.startTransition = startTransition;\nexports.unstable_act = act;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useDeferredValue = useDeferredValue;\nexports.useEffect = useEffect;\nexports.useId = useId;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useInsertionEffect = useInsertionEffect;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.useSyncExternalStore = useSyncExternalStore;\nexports.useTransition = useTransition;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'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lLnJlbmRlciwgJ0ZvcndhcmRSZWYnKTtcblxuICAgICAgY2FzZSBSRUFDVF9NRU1PX1RZUEU6XG4gICAgICAgIHZhciBvdXRlck5hbWUgPSB0eXBlLmRpc3BsYXlOYW1lIHx8IG51bGw7XG5cbiAgICAgICAgaWYgKG91dGVyTmFtZSAhPT0gbnVsbCkge1xuICAgICAgICAgIHJldHVybiBvdXRlck5hbWU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZ2V0Q29tcG9uZW50TmFtZUZyb21UeXBlKHR5cGUudHlwZSkgfHwgJ01lbW8nO1xuXG4gICAgICBjYXNlIFJFQUNUX0xBWllfVFlQRTpcbiAgICAgICAge1xuICAgICAgICAgIHZhciBsYXp5Q29tcG9uZW50ID0gdHlwZTtcbiAgICAgICAgICB2YXIgcGF5bG9hZCA9IGxhenlDb21wb25lbnQuX3BheWxvYWQ7XG4gICAgICAgICAgdmFyIGluaXQgPSBsYXp5Q29tcG9uZW50Ll9pbml0O1xuXG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJldHVybiBnZXRDb21wb25lbnROYW1lRnJvbVR5cGUoaW5pdChwYXlsb2FkKSk7XG4gICAgICAgICAgfSBjYXRjaCAoeCkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1mYWxsdGhyb3VnaFxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBudWxsO1xufVxuXG52YXIgaGFzT3duUHJvcGVydHkgPSBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O1xuXG52YXIgUkVTRVJWRURfUFJPUFMgPSB7XG4gIGtleTogdHJ1ZSxcbiAgcmVmOiB0cnVlLFxuICBfX3NlbGY6IHRydWUsXG4gIF9fc291cmNlOiB0cnVlXG59O1xudmFyIHNwZWNpYWxQcm9wS2V5V2FybmluZ1Nob3duLCBzcGVja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gdmFyIHRoZW5hYmxlID0ge1xuICAgICAgICB0aGVuOiBmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgd2FzQXdhaXRlZCA9IHRydWU7XG4gICAgICAgICAgdGhlbmFibGVSZXN1bHQudGhlbihmdW5jdGlvbiAocmV0dXJuVmFsdWUpIHtcbiAgICAgICAgICAgIHBvcEFjdFNjb3BlKHByZXZBY3RTY29wZURlcHRoKTtcblxuICAgICAgICAgICAgaWYgKGFjdFNjb3BlRGVwdGggPT09IDApIHtcbiAgICAgICAgICAgICAgLy8gV2UndmUgZXhpdGVkIHRoZSBvdXRlcm1vc3QgYWN0IHNjb3BlLiBSZWN1cnNpdmVseSBmbHVzaCB0aGVcbiAgICAgICAgICAgICAgLy8gcXVldWUgdW50aWwgdGhlcmUncyBubyByZW1haW5pbmcgd29yay5cbiAgICAgICAgICAgICAgcmVjdXJzaXZlbHlGbHVzaEFzeW5jQWN0V29yayhyZXR1cm5WYWx1ZSwgcmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmV0dXJuVmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sIGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgLy8gVGhlIGNhbGxiYWNrIHRocmV3IGFuIGVycm9yLlxuICAgICAgICAgICAgcG9wQWN0U2NvcGUocHJldkFjdFNjb3BlRGVwdGgpO1xuICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfTtcblxuICAgICAge1xuICAgICAgICBpZiAoIWRpZFdhcm5Ob0F3YWl0QWN0ICYmIHR5cGVvZiBQcm9taXNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bmRlZlxuICAgICAgICAgIFByb21pc2UucmVzb2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9IHVzZUlkO1xuZXhwb3J0cy51c2VJbXBlcmF0aXZlSGFuZGxlID0gdXNlSW1wZXJhdGl2ZUhhbmRsZTtcbmV4cG9ydHMudXNlSW5zZXJ0aW9uRWZmZWN0ID0gdXNlSW5zZXJ0aW9uRWZmZWN0O1xuZXhwb3J0cy51c2VMYXlvdXRFZmZlY3QgPSB1c2VMYXlvdXRFZmZlY3Q7XG5leHBvcnRzLnVzZU1lbW8gPSB1c2VNZW1vO1xuZXhwb3J0cy51c2VSZWR1Y2VyID0gdXNlUmVkdWNlcjtcbmV4cG9ydHMudXNlUmVmID0gdXNlUmVmO1xuZXhwb3J0cy51c2VTdGF0ZSA9IHVzZVN0YXRlO1xuZXhwb3J0cy51c2VTeW5jRXh0ZXJuYWxTdG9yZSA9IHVzZVN5bmNFeHRlcm5hbFN0b3JlO1xuZXhwb3J0cy51c2VUcmFuc2l0aW9uID0gdXNlVHJhbnNpdGlvbjtcbmV4cG9ydHMudmVyc2lvbiA9IFJlYWN0VmVyc2lvbjtcbiAgICAgICAgICAvKiBnbG9iYWwgX19SRUFDVF9ERVZUT09MU19HTE9CQUxfSE9PS19fICovXG5pZiAoXG4gIHR5cGVvZiBfX1JFQUNUX0RFVlRPT0xTX0dMT0JBTF9IT09LX18gIT09ICd1bmRlZmluZWQnICYmXG4gIHR5cGVvZiBfX1JFQUNUX0RFVlRPT0xTX0dMT0JBTF9IT09LX18ucmVnaXN0ZXJJbnRlcm5hbE1vZHVsZVN0b3AgPT09XG4gICAgJ2Z1bmN0aW9uJ1xuKSB7XG4gIF9fUkVBQ1RfREVWVE9PTFNfR0xPQkFMX0hPT0tfXy5yZWdpc3RlckludGVybmFsTW9kdWxlU3RvcChuZXcgRXJyb3IoKSk7XG59XG4gICAgICAgIFxuICB9KSgpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/react/cjs/react.development.js\n")); /***/ }), /***/ "./node_modules/react/index.js": /*!*************************************!*\ !*** ./node_modules/react/index.js ***! \*************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react.development.js */ \"./node_modules/react/cjs/react.development.js\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvcmVhY3QvaW5kZXguanMuanMiLCJtYXBwaW5ncyI6IkFBQWE7O0FBRWIsSUFBSSxLQUFxQyxFQUFFLEVBRTFDLENBQUM7QUFDRixFQUFFLHVIQUFzRDtBQUN4RCIsInNvdXJjZXMiOlsid2VicGFjazovL19OX0UvLi9ub2RlX21vZHVsZXMvcmVhY3QvaW5kZXguanM/MWZiMiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gJ3Byb2R1Y3Rpb24nKSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvcmVhY3QucHJvZHVjdGlvbi5taW4uanMnKTtcbn0gZWxzZSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvcmVhY3QuZGV2ZWxvcG1lbnQuanMnKTtcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/react/index.js\n")); /***/ }), /***/ "./node_modules/scheduler/cjs/scheduler.development.js": /*!*************************************************************!*\ !*** ./node_modules/scheduler/cjs/scheduler.development.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("/**\n * @license React\n * scheduler.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var enableSchedulerDebugging = false;\nvar enableProfiling = false;\nvar frameYieldMs = 5;\n\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n siftUp(heap, node, index);\n}\nfunction peek(heap) {\n return heap.length === 0 ? null : heap[0];\n}\nfunction pop(heap) {\n if (heap.length === 0) {\n return null;\n }\n\n var first = heap[0];\n var last = heap.pop();\n\n if (last !== first) {\n heap[0] = last;\n siftDown(heap, last, 0);\n }\n\n return first;\n}\n\nfunction siftUp(heap, node, i) {\n var index = i;\n\n while (index > 0) {\n var parentIndex = index - 1 >>> 1;\n var parent = heap[parentIndex];\n\n if (compare(parent, node) > 0) {\n // The parent is larger. Swap positions.\n heap[parentIndex] = node;\n heap[index] = parent;\n index = parentIndex;\n } else {\n // The parent is smaller. Exit.\n return;\n }\n }\n}\n\nfunction siftDown(heap, node, i) {\n var index = i;\n var length = heap.length;\n var halfLength = length >>> 1;\n\n while (index < halfLength) {\n var leftIndex = (index + 1) * 2 - 1;\n var left = heap[leftIndex];\n var rightIndex = leftIndex + 1;\n var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.\n\n if (compare(left, node) < 0) {\n if (rightIndex < length && compare(right, left) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n heap[index] = left;\n heap[leftIndex] = node;\n index = leftIndex;\n }\n } else if (rightIndex < length && compare(right, node) < 0) {\n heap[index] = right;\n heap[rightIndex] = node;\n index = rightIndex;\n } else {\n // Neither child is smaller. Exit.\n return;\n }\n }\n}\n\nfunction compare(a, b) {\n // Compare sort index first, then task id.\n var diff = a.sortIndex - b.sortIndex;\n return diff !== 0 ? diff : a.id - b.id;\n}\n\n// TODO: Use symbols?\nvar ImmediatePriority = 1;\nvar UserBlockingPriority = 2;\nvar NormalPriority = 3;\nvar LowPriority = 4;\nvar IdlePriority = 5;\n\nfunction markTaskErrored(task, ms) {\n}\n\n/* eslint-disable no-var */\n\nvar hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';\n\nif (hasPerformanceNow) {\n var localPerformance = performance;\n\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date;\n var initialTime = localDate.now();\n\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n} // Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\n\n\nvar maxSigned31BitInt = 1073741823; // Times out immediately\n\nvar IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out\n\nvar USER_BLOCKING_PRIORITY_TIMEOUT = 250;\nvar NORMAL_PRIORITY_TIMEOUT = 5000;\nvar LOW_PRIORITY_TIMEOUT = 10000; // Never times out\n\nvar IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap\n\nvar taskQueue = [];\nvar timerQueue = []; // Incrementing id counter. Used to maintain insertion order.\n\nvar taskIdCounter = 1; // Pausing the scheduler is useful for debugging.\nvar currentTask = null;\nvar currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.\n\nvar isPerformingWork = false;\nvar isHostCallbackScheduled = false;\nvar isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them.\n\nvar localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;\nvar localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null;\nvar localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom\n\nvar isInputPending = typeof navigator !== 'undefined' && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;\n\nfunction advanceTimers(currentTime) {\n // Check for tasks that are no longer delayed and add them to the queue.\n var timer = peek(timerQueue);\n\n while (timer !== null) {\n if (timer.callback === null) {\n // Timer was cancelled.\n pop(timerQueue);\n } else if (timer.startTime <= currentTime) {\n // Timer fired. Transfer to the task queue.\n pop(timerQueue);\n timer.sortIndex = timer.expirationTime;\n push(taskQueue, timer);\n } else {\n // Remaining timers are pending.\n return;\n }\n\n timer = peek(timerQueue);\n }\n}\n\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = false;\n advanceTimers(currentTime);\n\n if (!isHostCallbackScheduled) {\n if (peek(taskQueue) !== null) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n } else {\n var firstTimer = peek(timerQueue);\n\n if (firstTimer !== null) {\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n }\n }\n}\n\nfunction flushWork(hasTimeRemaining, initialTime) {\n\n\n isHostCallbackScheduled = false;\n\n if (isHostTimeoutScheduled) {\n // We scheduled a timeout but it's no longer needed. Cancel it.\n isHostTimeoutScheduled = false;\n cancelHostTimeout();\n }\n\n isPerformingWork = true;\n var previousPriorityLevel = currentPriorityLevel;\n\n try {\n if (enableProfiling) {\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } catch (error) {\n if (currentTask !== null) {\n var currentTime = exports.unstable_now();\n markTaskErrored(currentTask, currentTime);\n currentTask.isQueued = false;\n }\n\n throw error;\n }\n } else {\n // No catch in prod code path.\n return workLoop(hasTimeRemaining, initialTime);\n }\n } finally {\n currentTask = null;\n currentPriorityLevel = previousPriorityLevel;\n isPerformingWork = false;\n }\n}\n\nfunction workLoop(hasTimeRemaining, initialTime) {\n var currentTime = initialTime;\n advanceTimers(currentTime);\n currentTask = peek(taskQueue);\n\n while (currentTask !== null && !(enableSchedulerDebugging )) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n // This currentTask hasn't expired, and we've reached the deadline.\n break;\n }\n\n var callback = currentTask.callback;\n\n if (typeof callback === 'function') {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n\n var continuationCallback = callback(didUserCallbackTimeout);\n currentTime = exports.unstable_now();\n\n if (typeof continuationCallback === 'function') {\n currentTask.callback = continuationCallback;\n } else {\n\n if (currentTask === peek(taskQueue)) {\n pop(taskQueue);\n }\n }\n\n advanceTimers(currentTime);\n } else {\n pop(taskQueue);\n }\n\n currentTask = peek(taskQueue);\n } // Return whether there's additional work\n\n\n if (currentTask !== null) {\n return true;\n } else {\n var firstTimer = peek(timerQueue);\n\n if (firstTimer !== null) {\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n\n return false;\n }\n}\n\nfunction unstable_runWithPriority(priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case ImmediatePriority:\n case UserBlockingPriority:\n case NormalPriority:\n case LowPriority:\n case IdlePriority:\n break;\n\n default:\n priorityLevel = NormalPriority;\n }\n\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n}\n\nfunction unstable_next(eventHandler) {\n var priorityLevel;\n\n switch (currentPriorityLevel) {\n case ImmediatePriority:\n case UserBlockingPriority:\n case NormalPriority:\n // Shift down to normal priority\n priorityLevel = NormalPriority;\n break;\n\n default:\n // Anything lower than normal priority should remain at the current level.\n priorityLevel = currentPriorityLevel;\n break;\n }\n\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n}\n\nfunction unstable_wrapCallback(callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n // This is a fork of runWithPriority, inlined for performance.\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n}\n\nfunction unstable_scheduleCallback(priorityLevel, callback, options) {\n var currentTime = exports.unstable_now();\n var startTime;\n\n if (typeof options === 'object' && options !== null) {\n var delay = options.delay;\n\n if (typeof delay === 'number' && delay > 0) {\n startTime = currentTime + delay;\n } else {\n startTime = currentTime;\n }\n } else {\n startTime = currentTime;\n }\n\n var timeout;\n\n switch (priorityLevel) {\n case ImmediatePriority:\n timeout = IMMEDIATE_PRIORITY_TIMEOUT;\n break;\n\n case UserBlockingPriority:\n timeout = USER_BLOCKING_PRIORITY_TIMEOUT;\n break;\n\n case IdlePriority:\n timeout = IDLE_PRIORITY_TIMEOUT;\n break;\n\n case LowPriority:\n timeout = LOW_PRIORITY_TIMEOUT;\n break;\n\n case NormalPriority:\n default:\n timeout = NORMAL_PRIORITY_TIMEOUT;\n break;\n }\n\n var expirationTime = startTime + timeout;\n var newTask = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: startTime,\n expirationTime: expirationTime,\n sortIndex: -1\n };\n\n if (startTime > currentTime) {\n // This is a delayed task.\n newTask.sortIndex = startTime;\n push(timerQueue, newTask);\n\n if (peek(taskQueue) === null && newTask === peek(timerQueue)) {\n // All tasks are delayed, and this is the task with the earliest delay.\n if (isHostTimeoutScheduled) {\n // Cancel an existing timeout.\n cancelHostTimeout();\n } else {\n isHostTimeoutScheduled = true;\n } // Schedule a timeout.\n\n\n requestHostTimeout(handleTimeout, startTime - currentTime);\n }\n } else {\n newTask.sortIndex = expirationTime;\n push(taskQueue, newTask);\n // wait until the next time we yield.\n\n\n if (!isHostCallbackScheduled && !isPerformingWork) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n }\n }\n\n return newTask;\n}\n\nfunction unstable_pauseExecution() {\n}\n\nfunction unstable_continueExecution() {\n\n if (!isHostCallbackScheduled && !isPerformingWork) {\n isHostCallbackScheduled = true;\n requestHostCallback(flushWork);\n }\n}\n\nfunction unstable_getFirstCallbackNode() {\n return peek(taskQueue);\n}\n\nfunction unstable_cancelCallback(task) {\n // remove from the queue because you can't remove arbitrary nodes from an\n // array based heap, only the first one.)\n\n\n task.callback = null;\n}\n\nfunction unstable_getCurrentPriorityLevel() {\n return currentPriorityLevel;\n}\n\nvar isMessageLoopRunning = false;\nvar scheduledHostCallback = null;\nvar taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main\n// thread, like user events. By default, it yields multiple times per frame.\n// It does not attempt to align with frame boundaries, since most tasks don't\n// need to be frame aligned; for those that do, use requestAnimationFrame.\n\nvar frameInterval = frameYieldMs;\nvar startTime = -1;\n\nfunction shouldYieldToHost() {\n var timeElapsed = exports.unstable_now() - startTime;\n\n if (timeElapsed < frameInterval) {\n // The main thread has only been blocked for a really short amount of time;\n // smaller than a single frame. Don't yield yet.\n return false;\n } // The main thread has been blocked for a non-negligible amount of time. We\n\n\n return true;\n}\n\nfunction requestPaint() {\n\n}\n\nfunction forceFrameRate(fps) {\n if (fps < 0 || fps > 125) {\n // Using console['error'] to evade Babel and ESLint\n console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');\n return;\n }\n\n if (fps > 0) {\n frameInterval = Math.floor(1000 / fps);\n } else {\n // reset the framerate\n frameInterval = frameYieldMs;\n }\n}\n\nvar performWorkUntilDeadline = function () {\n if (scheduledHostCallback !== null) {\n var currentTime = exports.unstable_now(); // Keep track of the start time so we can measure how long the main thread\n // has been blocked.\n\n startTime = currentTime;\n var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the\n // error can be observed.\n //\n // Intentionally not using a try-catch, since that makes some debugging\n // techniques harder. Instead, if `scheduledHostCallback` errors, then\n // `hasMoreWork` will remain true, and we'll continue the work loop.\n\n var hasMoreWork = true;\n\n try {\n hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);\n } finally {\n if (hasMoreWork) {\n // If there's more work, schedule the next message event at the end\n // of the preceding one.\n schedulePerformWorkUntilDeadline();\n } else {\n isMessageLoopRunning = false;\n scheduledHostCallback = null;\n }\n }\n } else {\n isMessageLoopRunning = false;\n } // Yielding to the browser will give it a chance to paint, so we can\n};\n\nvar schedulePerformWorkUntilDeadline;\n\nif (typeof localSetImmediate === 'function') {\n // Node.js and old IE.\n // There's a few reasons for why we prefer setImmediate.\n //\n // Unlike MessageChannel, it doesn't prevent a Node.js process from exiting.\n // (Even though this is a DOM fork of the Scheduler, you could get here\n // with a mix of Node.js 15+, which has a MessageChannel, and jsdom.)\n // https://github.com/facebook/react/issues/20756\n //\n // But also, it runs earlier which is the semantic we want.\n // If other browsers ever implement it, it's better to use it.\n // Although both of these would be inferior to native scheduling.\n schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\n} else if (typeof MessageChannel !== 'undefined') {\n // DOM and Worker environments.\n // We prefer MessageChannel because of the 4ms setTimeout clamping.\n var channel = new MessageChannel();\n var port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n} else {\n // We should only fallback here in non-browser environments.\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\n}\n\nfunction requestHostCallback(callback) {\n scheduledHostCallback = callback;\n\n if (!isMessageLoopRunning) {\n isMessageLoopRunning = true;\n schedulePerformWorkUntilDeadline();\n }\n}\n\nfunction requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n}\n\nfunction cancelHostTimeout() {\n localClearTimeout(taskTimeoutID);\n taskTimeoutID = -1;\n}\n\nvar unstable_requestPaint = requestPaint;\nvar unstable_Profiling = null;\n\nexports.unstable_IdlePriority = IdlePriority;\nexports.unstable_ImmediatePriority = ImmediatePriority;\nexports.unstable_LowPriority = LowPriority;\nexports.unstable_NormalPriority = NormalPriority;\nexports.unstable_Profiling = unstable_Profiling;\nexports.unstable_UserBlockingPriority = UserBlockingPriority;\nexports.unstable_cancelCallback = unstable_cancelCallback;\nexports.unstable_continueExecution = unstable_continueExecution;\nexports.unstable_forceFrameRate = forceFrameRate;\nexports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;\nexports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;\nexports.unstable_next = unstable_next;\nexports.unstable_pauseExecution = unstable_pauseExecution;\nexports.unstable_requestPaint = unstable_requestPaint;\nexports.unstable_runWithPriority = unstable_runWithPriority;\nexports.unstable_scheduleCallback = unstable_scheduleCallback;\nexports.unstable_shouldYield = shouldYieldToHost;\nexports.unstable_wrapCallback = unstable_wrapCallback;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvc2NoZWR1bGVyL2Nqcy9zY2hlZHVsZXIuZGV2ZWxvcG1lbnQuanMuanMiLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVhOztBQUViLElBQUksSUFBcUM7QUFDekM7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO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RlZmluZWQnICYmXG4gIHR5cGVvZiBfX1JFQUNUX0RFVlRPT0xTX0dMT0JBTF9IT09LX18ucmVnaXN0ZXJJbnRlcm5hbE1vZHVsZVN0b3AgPT09XG4gICAgJ2Z1bmN0aW9uJ1xuKSB7XG4gIF9fUkVBQ1RfREVWVE9PTFNfR0xPQkFMX0hPT0tfXy5yZWdpc3RlckludGVybmFsTW9kdWxlU3RvcChuZXcgRXJyb3IoKSk7XG59XG4gICAgICAgIFxuICB9KSgpO1xufVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/scheduler/cjs/scheduler.development.js\n")); /***/ }), /***/ "./node_modules/scheduler/index.js": /*!*****************************************!*\ !*** ./node_modules/scheduler/index.js ***! \*****************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/scheduler.development.js */ \"./node_modules/scheduler/cjs/scheduler.development.js\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvc2NoZWR1bGVyL2luZGV4LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFhOztBQUViLElBQUksS0FBcUMsRUFBRSxFQUUxQyxDQUFDO0FBQ0YsRUFBRSxtSUFBMEQ7QUFDNUQiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vbm9kZV9tb2R1bGVzL3NjaGVkdWxlci9pbmRleC5qcz9jN2NjIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcblxuaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSAncHJvZHVjdGlvbicpIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2Nqcy9zY2hlZHVsZXIucHJvZHVjdGlvbi5taW4uanMnKTtcbn0gZWxzZSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvc2NoZWR1bGVyLmRldmVsb3BtZW50LmpzJyk7XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/scheduler/index.js\n")); /***/ }), /***/ "?506d": /*!******************************************!*\ !*** ./utils/resolve-rewrites (ignored) ***! \******************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { /* (ignored) */ /***/ }), /***/ "./node_modules/tslib/tslib.es6.mjs": /*!******************************************!*\ !*** ./node_modules/tslib/tslib.es6.mjs ***! \******************************************/ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"__addDisposableResource\": function() { return /* binding */ __addDisposableResource; },\n/* harmony export */ \"__assign\": function() { return /* binding */ __assign; },\n/* harmony export */ \"__asyncDelegator\": function() { return /* binding */ __asyncDelegator; },\n/* harmony export */ \"__asyncGenerator\": function() { return /* binding */ __asyncGenerator; },\n/* harmony export */ \"__asyncValues\": function() { return /* binding */ __asyncValues; },\n/* harmony export */ \"__await\": function() { return /* binding */ __await; },\n/* harmony export */ \"__awaiter\": function() { return /* binding */ __awaiter; },\n/* harmony export */ \"__classPrivateFieldGet\": function() { return /* binding */ __classPrivateFieldGet; },\n/* harmony export */ \"__classPrivateFieldIn\": function() { return /* binding */ __classPrivateFieldIn; },\n/* harmony export */ \"__classPrivateFieldSet\": function() { return /* binding */ __classPrivateFieldSet; },\n/* harmony export */ \"__createBinding\": function() { return /* binding */ __createBinding; },\n/* harmony export */ \"__decorate\": function() { return /* binding */ __decorate; },\n/* harmony export */ \"__disposeResources\": function() { return /* binding */ __disposeResources; },\n/* harmony export */ \"__esDecorate\": function() { return /* binding */ __esDecorate; },\n/* harmony export */ \"__exportStar\": function() { return /* binding */ __exportStar; },\n/* harmony export */ \"__extends\": function() { return /* binding */ __extends; },\n/* harmony export */ \"__generator\": function() { return /* binding */ __generator; },\n/* harmony export */ \"__importDefault\": function() { return /* binding */ __importDefault; },\n/* harmony export */ \"__importStar\": function() { return /* binding */ __importStar; },\n/* harmony export */ \"__makeTemplateObject\": function() { return /* binding */ __makeTemplateObject; },\n/* harmony export */ \"__metadata\": function() { return /* binding */ __metadata; },\n/* harmony export */ \"__param\": function() { return /* binding */ __param; },\n/* harmony export */ \"__propKey\": function() { return /* binding */ __propKey; },\n/* harmony export */ \"__read\": function() { return /* binding */ __read; },\n/* harmony export */ \"__rest\": function() { return /* binding */ __rest; },\n/* harmony export */ \"__runInitializers\": function() { return /* binding */ __runInitializers; },\n/* harmony export */ \"__setFunctionName\": function() { return /* binding */ __setFunctionName; },\n/* harmony export */ \"__spread\": function() { return /* binding */ __spread; },\n/* harmony export */ \"__spreadArray\": function() { return /* binding */ __spreadArray; },\n/* harmony export */ \"__spreadArrays\": function() { return /* binding */ __spreadArrays; },\n/* harmony export */ \"__values\": function() { return /* binding */ __values; }\n/* harmony export */ });\n/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nfunction __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nvar __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nfunction __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nfunction __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nfunction __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nfunction __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nfunction __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nfunction __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nfunction __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nfunction __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nfunction __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nfunction __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nvar __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nfunction __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nfunction __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nfunction __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nfunction __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nfunction __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nfunction __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nfunction __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nfunction __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nfunction __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nfunction __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nfunction __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nfunction __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nfunction __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nfunction __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nfunction __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nfunction __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvdHNsaWIvdHNsaWIuZXM2Lm1qcy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7QUFDQTs7QUF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YXRvcixcbiAgX19hc3luY1ZhbHVlcyxcbiAgX19tYWtlVGVtcGxhdGVPYmplY3QsXG4gIF9faW1wb3J0U3RhcixcbiAgX19pbXBvcnREZWZhdWx0LFxuICBfX2NsYXNzUHJpdmF0ZUZpZWxkR2V0LFxuICBfX2NsYXNzUHJpdmF0ZUZpZWxkU2V0LFxuICBfX2NsYXNzUHJpdmF0ZUZpZWxkSW4sXG4gIF9fYWRkRGlzcG9zYWJsZVJlc291cmNlLFxuICBfX2Rpc3Bvc2VSZXNvdXJjZXMsXG59O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/tslib/tslib.es6.mjs\n")); /***/ }) }, /******/ function(__webpack_require__) { // webpackRuntimeModules /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); } /******/ var __webpack_exports__ = (__webpack_exec__("./node_modules/next/dist/client/next-dev.js")); /******/ _N_E = __webpack_exports__; /******/ } ]);