| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | /******/ (() => { // webpackBootstrap |
| 2 | 2 | /******/ var __webpack_modules__ = ({ |
| 3 | 3 | |
| 4 | 4 | /***/ "../app/assets/js/loader/commands/close.js": |
| @@ -1109,9 +1109,9 @@ | ||
| 1109 | 1109 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1110 | 1110 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1111 | 1111 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1112 | 1112 | var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js")); |
| 1113 | -var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "@reduxjs/toolkit"); | |
| 1113 | +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js"); | |
| 1114 | 1114 | var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js")); |
| 1115 | 1115 | var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); |
| 1116 | 1116 | var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); |
| 1117 | 1117 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } |
| @@ -2047,8 +2047,145 @@ | ||
| 2047 | 2047 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2048 | 2048 | |
| 2049 | 2049 | /***/ }), |
| 2050 | 2050 | |
| 2051 | +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js": | |
| 2052 | +/*!********************************************************************!*\ | |
| 2053 | + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! | |
| 2054 | + \********************************************************************/ | |
| 2055 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 2056 | + | |
| 2057 | +"use strict"; | |
| 2058 | +__webpack_require__.r(__webpack_exports__); | |
| 2059 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2060 | +/* harmony export */ "default": () => (/* binding */ _defineProperty) | |
| 2061 | +/* harmony export */ }); | |
| 2062 | +/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"); | |
| 2063 | + | |
| 2064 | +function _defineProperty(e, r, t) { | |
| 2065 | + return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r)) in e ? Object.defineProperty(e, r, { | |
| 2066 | + value: t, | |
| 2067 | + enumerable: !0, | |
| 2068 | + configurable: !0, | |
| 2069 | + writable: !0 | |
| 2070 | + }) : e[r] = t, e; | |
| 2071 | +} | |
| 2072 | + | |
| 2073 | + | |
| 2074 | +/***/ }), | |
| 2075 | + | |
| 2076 | +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js": | |
| 2077 | +/*!*******************************************************************!*\ | |
| 2078 | + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***! | |
| 2079 | + \*******************************************************************/ | |
| 2080 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 2081 | + | |
| 2082 | +"use strict"; | |
| 2083 | +__webpack_require__.r(__webpack_exports__); | |
| 2084 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2085 | +/* harmony export */ "default": () => (/* binding */ _objectSpread2) | |
| 2086 | +/* harmony export */ }); | |
| 2087 | +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js"); | |
| 2088 | + | |
| 2089 | +function ownKeys(e, r) { | |
| 2090 | + var t = Object.keys(e); | |
| 2091 | + if (Object.getOwnPropertySymbols) { | |
| 2092 | + var o = Object.getOwnPropertySymbols(e); | |
| 2093 | + r && (o = o.filter(function (r) { | |
| 2094 | + return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 2095 | + })), t.push.apply(t, o); | |
| 2096 | + } | |
| 2097 | + return t; | |
| 2098 | +} | |
| 2099 | +function _objectSpread2(e) { | |
| 2100 | + for (var r = 1; r < arguments.length; r++) { | |
| 2101 | + var t = null != arguments[r] ? arguments[r] : {}; | |
| 2102 | + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { | |
| 2103 | + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e, r, t[r]); | |
| 2104 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { | |
| 2105 | + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 2106 | + }); | |
| 2107 | + } | |
| 2108 | + return e; | |
| 2109 | +} | |
| 2110 | + | |
| 2111 | + | |
| 2112 | +/***/ }), | |
| 2113 | + | |
| 2114 | +/***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js": | |
| 2115 | +/*!*****************************************************************!*\ | |
| 2116 | + !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***! | |
| 2117 | + \*****************************************************************/ | |
| 2118 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 2119 | + | |
| 2120 | +"use strict"; | |
| 2121 | +__webpack_require__.r(__webpack_exports__); | |
| 2122 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2123 | +/* harmony export */ "default": () => (/* binding */ toPrimitive) | |
| 2124 | +/* harmony export */ }); | |
| 2125 | +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js"); | |
| 2126 | + | |
| 2127 | +function toPrimitive(t, r) { | |
| 2128 | + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t; | |
| 2129 | + var e = t[Symbol.toPrimitive]; | |
| 2130 | + if (void 0 !== e) { | |
| 2131 | + var i = e.call(t, r || "default"); | |
| 2132 | + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i; | |
| 2133 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 2134 | + } | |
| 2135 | + return ("string" === r ? String : Number)(t); | |
| 2136 | +} | |
| 2137 | + | |
| 2138 | + | |
| 2139 | +/***/ }), | |
| 2140 | + | |
| 2141 | +/***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js": | |
| 2142 | +/*!*******************************************************************!*\ | |
| 2143 | + !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***! | |
| 2144 | + \*******************************************************************/ | |
| 2145 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 2146 | + | |
| 2147 | +"use strict"; | |
| 2148 | +__webpack_require__.r(__webpack_exports__); | |
| 2149 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2150 | +/* harmony export */ "default": () => (/* binding */ toPropertyKey) | |
| 2151 | +/* harmony export */ }); | |
| 2152 | +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js"); | |
| 2153 | +/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"); | |
| 2154 | + | |
| 2155 | + | |
| 2156 | +function toPropertyKey(t) { | |
| 2157 | + var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string"); | |
| 2158 | + return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : i + ""; | |
| 2159 | +} | |
| 2160 | + | |
| 2161 | + | |
| 2162 | +/***/ }), | |
| 2163 | + | |
| 2164 | +/***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js": | |
| 2165 | +/*!************************************************************!*\ | |
| 2166 | + !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***! | |
| 2167 | + \************************************************************/ | |
| 2168 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 2169 | + | |
| 2170 | +"use strict"; | |
| 2171 | +__webpack_require__.r(__webpack_exports__); | |
| 2172 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2173 | +/* harmony export */ "default": () => (/* binding */ _typeof) | |
| 2174 | +/* harmony export */ }); | |
| 2175 | +function _typeof(o) { | |
| 2176 | + "@babel/helpers - typeof"; | |
| 2177 | + | |
| 2178 | + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 2179 | + return typeof o; | |
| 2180 | + } : function (o) { | |
| 2181 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 2182 | + }, _typeof(o); | |
| 2183 | +} | |
| 2184 | + | |
| 2185 | + | |
| 2186 | +/***/ }), | |
| 2187 | + | |
| 2051 | 2188 | /***/ "../node_modules/@babel/runtime/helpers/get.js": |
| 2052 | 2189 | /*!*****************************************************!*\ |
| 2053 | 2190 | !*** ../node_modules/@babel/runtime/helpers/get.js ***! |
| 2054 | 2191 | \*****************************************************/ |
| @@ -2379,17 +2516,3215 @@ | ||
| 2379 | 2516 | module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2380 | 2517 | |
| 2381 | 2518 | /***/ }), |
| 2382 | 2519 | |
| 2383 | -/***/ "@reduxjs/toolkit": | |
| 2520 | +/***/ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js": | |
| 2521 | +/*!******************************************************************!*\ | |
| 2522 | + !*** ../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js ***! | |
| 2523 | + \******************************************************************/ | |
| 2524 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 2525 | + | |
| 2526 | +"use strict"; | |
| 2527 | +__webpack_require__.r(__webpack_exports__); | |
| 2528 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 2529 | +/* harmony export */ EnhancerArray: () => (/* binding */ EnhancerArray), | |
| 2530 | +/* harmony export */ MiddlewareArray: () => (/* binding */ MiddlewareArray), | |
| 2531 | +/* harmony export */ SHOULD_AUTOBATCH: () => (/* binding */ SHOULD_AUTOBATCH), | |
| 2532 | +/* harmony export */ TaskAbortError: () => (/* binding */ TaskAbortError), | |
| 2533 | +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.__DO_NOT_USE__ActionTypes), | |
| 2534 | +/* harmony export */ addListener: () => (/* binding */ addListener), | |
| 2535 | +/* harmony export */ applyMiddleware: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.applyMiddleware), | |
| 2536 | +/* harmony export */ autoBatchEnhancer: () => (/* binding */ autoBatchEnhancer), | |
| 2537 | +/* harmony export */ bindActionCreators: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.bindActionCreators), | |
| 2538 | +/* harmony export */ clearAllListeners: () => (/* binding */ clearAllListeners), | |
| 2539 | +/* harmony export */ combineReducers: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.combineReducers), | |
| 2540 | +/* harmony export */ compose: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.compose), | |
| 2541 | +/* harmony export */ configureStore: () => (/* binding */ configureStore), | |
| 2542 | +/* harmony export */ createAction: () => (/* binding */ createAction), | |
| 2543 | +/* harmony export */ createActionCreatorInvariantMiddleware: () => (/* binding */ createActionCreatorInvariantMiddleware), | |
| 2544 | +/* harmony export */ createAsyncThunk: () => (/* binding */ createAsyncThunk), | |
| 2545 | +/* harmony export */ createDraftSafeSelector: () => (/* binding */ createDraftSafeSelector), | |
| 2546 | +/* harmony export */ createEntityAdapter: () => (/* binding */ createEntityAdapter), | |
| 2547 | +/* harmony export */ createImmutableStateInvariantMiddleware: () => (/* binding */ createImmutableStateInvariantMiddleware), | |
| 2548 | +/* harmony export */ createListenerMiddleware: () => (/* binding */ createListenerMiddleware), | |
| 2549 | +/* harmony export */ createNextState: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__["default"]), | |
| 2550 | +/* harmony export */ createReducer: () => (/* binding */ createReducer), | |
| 2551 | +/* harmony export */ createSelector: () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_2__.createSelector), | |
| 2552 | +/* harmony export */ createSerializableStateInvariantMiddleware: () => (/* binding */ createSerializableStateInvariantMiddleware), | |
| 2553 | +/* harmony export */ createSlice: () => (/* binding */ createSlice), | |
| 2554 | +/* harmony export */ createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.createStore), | |
| 2555 | +/* harmony export */ current: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__.current), | |
| 2556 | +/* harmony export */ findNonSerializableValue: () => (/* binding */ findNonSerializableValue), | |
| 2557 | +/* harmony export */ freeze: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__.freeze), | |
| 2558 | +/* harmony export */ getDefaultMiddleware: () => (/* binding */ getDefaultMiddleware), | |
| 2559 | +/* harmony export */ getType: () => (/* binding */ getType), | |
| 2560 | +/* harmony export */ isAction: () => (/* binding */ isAction), | |
| 2561 | +/* harmony export */ isActionCreator: () => (/* binding */ isActionCreator), | |
| 2562 | +/* harmony export */ isAllOf: () => (/* binding */ isAllOf), | |
| 2563 | +/* harmony export */ isAnyOf: () => (/* binding */ isAnyOf), | |
| 2564 | +/* harmony export */ isAsyncThunkAction: () => (/* binding */ isAsyncThunkAction), | |
| 2565 | +/* harmony export */ isDraft: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__.isDraft), | |
| 2566 | +/* harmony export */ isFluxStandardAction: () => (/* binding */ isFSA), | |
| 2567 | +/* harmony export */ isFulfilled: () => (/* binding */ isFulfilled), | |
| 2568 | +/* harmony export */ isImmutableDefault: () => (/* binding */ isImmutableDefault), | |
| 2569 | +/* harmony export */ isPending: () => (/* binding */ isPending), | |
| 2570 | +/* harmony export */ isPlain: () => (/* binding */ isPlain), | |
| 2571 | +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject), | |
| 2572 | +/* harmony export */ isRejected: () => (/* binding */ isRejected), | |
| 2573 | +/* harmony export */ isRejectedWithValue: () => (/* binding */ isRejectedWithValue), | |
| 2574 | +/* harmony export */ legacy_createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.legacy_createStore), | |
| 2575 | +/* harmony export */ miniSerializeError: () => (/* binding */ miniSerializeError), | |
| 2576 | +/* harmony export */ nanoid: () => (/* binding */ nanoid), | |
| 2577 | +/* harmony export */ original: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__.original), | |
| 2578 | +/* harmony export */ prepareAutoBatched: () => (/* binding */ prepareAutoBatched), | |
| 2579 | +/* harmony export */ removeListener: () => (/* binding */ removeListener), | |
| 2580 | +/* harmony export */ unwrapResult: () => (/* binding */ unwrapResult) | |
| 2581 | +/* harmony export */ }); | |
| 2582 | +/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! immer */ "../node_modules/immer/dist/immer.esm.mjs"); | |
| 2583 | +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js"); | |
| 2584 | +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js"); | |
| 2585 | +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js"); | |
| 2586 | +var __extends = (undefined && undefined.__extends) || (function () { | |
| 2587 | + var extendStatics = function (d, b) { | |
| 2588 | + extendStatics = Object.setPrototypeOf || | |
| 2589 | + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | |
| 2590 | + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | |
| 2591 | + return extendStatics(d, b); | |
| 2592 | + }; | |
| 2593 | + return function (d, b) { | |
| 2594 | + if (typeof b !== "function" && b !== null) | |
| 2595 | + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | |
| 2596 | + extendStatics(d, b); | |
| 2597 | + function __() { this.constructor = d; } | |
| 2598 | + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | |
| 2599 | + }; | |
| 2600 | +})(); | |
| 2601 | +var __generator = (undefined && undefined.__generator) || function (thisArg, body) { | |
| 2602 | + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | |
| 2603 | + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | |
| 2604 | + function verb(n) { return function (v) { return step([n, v]); }; } | |
| 2605 | + function step(op) { | |
| 2606 | + if (f) throw new TypeError("Generator is already executing."); | |
| 2607 | + while (_) try { | |
| 2608 | + 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; | |
| 2609 | + if (y = 0, t) op = [op[0] & 2, t.value]; | |
| 2610 | + switch (op[0]) { | |
| 2611 | + case 0: case 1: t = op; break; | |
| 2612 | + case 4: _.label++; return { value: op[1], done: false }; | |
| 2613 | + case 5: _.label++; y = op[1]; op = [0]; continue; | |
| 2614 | + case 7: op = _.ops.pop(); _.trys.pop(); continue; | |
| 2615 | + default: | |
| 2616 | + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | |
| 2617 | + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | |
| 2618 | + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | |
| 2619 | + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | |
| 2620 | + if (t[2]) _.ops.pop(); | |
| 2621 | + _.trys.pop(); continue; | |
| 2622 | + } | |
| 2623 | + op = body.call(thisArg, _); | |
| 2624 | + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | |
| 2625 | + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | |
| 2626 | + } | |
| 2627 | +}; | |
| 2628 | +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) { | |
| 2629 | + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | |
| 2630 | + to[j] = from[i]; | |
| 2631 | + return to; | |
| 2632 | +}; | |
| 2633 | +var __defProp = Object.defineProperty; | |
| 2634 | +var __defProps = Object.defineProperties; | |
| 2635 | +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | |
| 2636 | +var __getOwnPropSymbols = Object.getOwnPropertySymbols; | |
| 2637 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 2638 | +var __propIsEnum = Object.prototype.propertyIsEnumerable; | |
| 2639 | +var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; }; | |
| 2640 | +var __spreadValues = function (a, b) { | |
| 2641 | + for (var prop in b || (b = {})) | |
| 2642 | + if (__hasOwnProp.call(b, prop)) | |
| 2643 | + __defNormalProp(a, prop, b[prop]); | |
| 2644 | + if (__getOwnPropSymbols) | |
| 2645 | + for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) { | |
| 2646 | + var prop = _c[_i]; | |
| 2647 | + if (__propIsEnum.call(b, prop)) | |
| 2648 | + __defNormalProp(a, prop, b[prop]); | |
| 2649 | + } | |
| 2650 | + return a; | |
| 2651 | +}; | |
| 2652 | +var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); }; | |
| 2653 | +var __async = function (__this, __arguments, generator) { | |
| 2654 | + return new Promise(function (resolve, reject) { | |
| 2655 | + var fulfilled = function (value) { | |
| 2656 | + try { | |
| 2657 | + step(generator.next(value)); | |
| 2658 | + } | |
| 2659 | + catch (e) { | |
| 2660 | + reject(e); | |
| 2661 | + } | |
| 2662 | + }; | |
| 2663 | + var rejected = function (value) { | |
| 2664 | + try { | |
| 2665 | + step(generator.throw(value)); | |
| 2666 | + } | |
| 2667 | + catch (e) { | |
| 2668 | + reject(e); | |
| 2669 | + } | |
| 2670 | + }; | |
| 2671 | + var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); }; | |
| 2672 | + step((generator = generator.apply(__this, __arguments)).next()); | |
| 2673 | + }); | |
| 2674 | +}; | |
| 2675 | +// src/index.ts | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | +// src/createDraftSafeSelector.ts | |
| 2681 | + | |
| 2682 | + | |
| 2683 | +var createDraftSafeSelector = function () { | |
| 2684 | + var args = []; | |
| 2685 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2686 | + args[_i] = arguments[_i]; | |
| 2687 | + } | |
| 2688 | + var selector = reselect__WEBPACK_IMPORTED_MODULE_2__.createSelector.apply(void 0, args); | |
| 2689 | + var wrappedSelector = function (value) { | |
| 2690 | + var rest = []; | |
| 2691 | + for (var _i = 1; _i < arguments.length; _i++) { | |
| 2692 | + rest[_i - 1] = arguments[_i]; | |
| 2693 | + } | |
| 2694 | + return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_0__.current)(value) : value], rest)); | |
| 2695 | + }; | |
| 2696 | + return wrappedSelector; | |
| 2697 | +}; | |
| 2698 | +// src/configureStore.ts | |
| 2699 | + | |
| 2700 | +// src/devtoolsExtension.ts | |
| 2701 | + | |
| 2702 | +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () { | |
| 2703 | + if (arguments.length === 0) | |
| 2704 | + return void 0; | |
| 2705 | + if (typeof arguments[0] === "object") | |
| 2706 | + return redux__WEBPACK_IMPORTED_MODULE_1__.compose; | |
| 2707 | + return redux__WEBPACK_IMPORTED_MODULE_1__.compose.apply(null, arguments); | |
| 2708 | +}; | |
| 2709 | +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () { | |
| 2710 | + return function (noop2) { | |
| 2711 | + return noop2; | |
| 2712 | + }; | |
| 2713 | +}; | |
| 2714 | +// src/isPlainObject.ts | |
| 2715 | +function isPlainObject(value) { | |
| 2716 | + if (typeof value !== "object" || value === null) | |
| 2717 | + return false; | |
| 2718 | + var proto = Object.getPrototypeOf(value); | |
| 2719 | + if (proto === null) | |
| 2720 | + return true; | |
| 2721 | + var baseProto = proto; | |
| 2722 | + while (Object.getPrototypeOf(baseProto) !== null) { | |
| 2723 | + baseProto = Object.getPrototypeOf(baseProto); | |
| 2724 | + } | |
| 2725 | + return proto === baseProto; | |
| 2726 | +} | |
| 2727 | +// src/getDefaultMiddleware.ts | |
| 2728 | + | |
| 2729 | +// src/tsHelpers.ts | |
| 2730 | +var hasMatchFunction = function (v) { | |
| 2731 | + return v && typeof v.match === "function"; | |
| 2732 | +}; | |
| 2733 | +// src/createAction.ts | |
| 2734 | +function createAction(type, prepareAction) { | |
| 2735 | + function actionCreator() { | |
| 2736 | + var args = []; | |
| 2737 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2738 | + args[_i] = arguments[_i]; | |
| 2739 | + } | |
| 2740 | + if (prepareAction) { | |
| 2741 | + var prepared = prepareAction.apply(void 0, args); | |
| 2742 | + if (!prepared) { | |
| 2743 | + throw new Error("prepareAction did not return an object"); | |
| 2744 | + } | |
| 2745 | + return __spreadValues(__spreadValues({ | |
| 2746 | + type: type, | |
| 2747 | + payload: prepared.payload | |
| 2748 | + }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error }); | |
| 2749 | + } | |
| 2750 | + return { type: type, payload: args[0] }; | |
| 2751 | + } | |
| 2752 | + actionCreator.toString = function () { return "" + type; }; | |
| 2753 | + actionCreator.type = type; | |
| 2754 | + actionCreator.match = function (action) { return action.type === type; }; | |
| 2755 | + return actionCreator; | |
| 2756 | +} | |
| 2757 | +function isAction(action) { | |
| 2758 | + return isPlainObject(action) && "type" in action; | |
| 2759 | +} | |
| 2760 | +function isActionCreator(action) { | |
| 2761 | + return typeof action === "function" && "type" in action && hasMatchFunction(action); | |
| 2762 | +} | |
| 2763 | +function isFSA(action) { | |
| 2764 | + return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey); | |
| 2765 | +} | |
| 2766 | +function isValidKey(key) { | |
| 2767 | + return ["type", "payload", "error", "meta"].indexOf(key) > -1; | |
| 2768 | +} | |
| 2769 | +function getType(actionCreator) { | |
| 2770 | + return "" + actionCreator; | |
| 2771 | +} | |
| 2772 | +// src/actionCreatorInvariantMiddleware.ts | |
| 2773 | +function getMessage(type) { | |
| 2774 | + var splitType = type ? ("" + type).split("/") : []; | |
| 2775 | + var actionName = splitType[splitType.length - 1] || "actionCreator"; | |
| 2776 | + return "Detected an action creator with type \"" + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload."; | |
| 2777 | +} | |
| 2778 | +function createActionCreatorInvariantMiddleware(options) { | |
| 2779 | + if (options === void 0) { options = {}; } | |
| 2780 | + if (false) // removed by dead control flow | |
| 2781 | +{} | |
| 2782 | + var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c; | |
| 2783 | + return function () { return function (next) { return function (action) { | |
| 2784 | + if (isActionCreator2(action)) { | |
| 2785 | + console.warn(getMessage(action.type)); | |
| 2786 | + } | |
| 2787 | + return next(action); | |
| 2788 | + }; }; }; | |
| 2789 | +} | |
| 2790 | +// src/utils.ts | |
| 2791 | + | |
| 2792 | +function getTimeMeasureUtils(maxDelay, fnName) { | |
| 2793 | + var elapsed = 0; | |
| 2794 | + return { | |
| 2795 | + measureTime: function (fn) { | |
| 2796 | + var started = Date.now(); | |
| 2797 | + try { | |
| 2798 | + return fn(); | |
| 2799 | + } | |
| 2800 | + finally { | |
| 2801 | + var finished = Date.now(); | |
| 2802 | + elapsed += finished - started; | |
| 2803 | + } | |
| 2804 | + }, | |
| 2805 | + warnIfExceeded: function () { | |
| 2806 | + if (elapsed > maxDelay) { | |
| 2807 | + console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that."); | |
| 2808 | + } | |
| 2809 | + } | |
| 2810 | + }; | |
| 2811 | +} | |
| 2812 | +var MiddlewareArray = /** @class */ (function (_super) { | |
| 2813 | + __extends(MiddlewareArray, _super); | |
| 2814 | + function MiddlewareArray() { | |
| 2815 | + var args = []; | |
| 2816 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2817 | + args[_i] = arguments[_i]; | |
| 2818 | + } | |
| 2819 | + var _this = _super.apply(this, args) || this; | |
| 2820 | + Object.setPrototypeOf(_this, MiddlewareArray.prototype); | |
| 2821 | + return _this; | |
| 2822 | + } | |
| 2823 | + Object.defineProperty(MiddlewareArray, Symbol.species, { | |
| 2824 | + get: function () { | |
| 2825 | + return MiddlewareArray; | |
| 2826 | + }, | |
| 2827 | + enumerable: false, | |
| 2828 | + configurable: true | |
| 2829 | + }); | |
| 2830 | + MiddlewareArray.prototype.concat = function () { | |
| 2831 | + var arr = []; | |
| 2832 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2833 | + arr[_i] = arguments[_i]; | |
| 2834 | + } | |
| 2835 | + return _super.prototype.concat.apply(this, arr); | |
| 2836 | + }; | |
| 2837 | + MiddlewareArray.prototype.prepend = function () { | |
| 2838 | + var arr = []; | |
| 2839 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2840 | + arr[_i] = arguments[_i]; | |
| 2841 | + } | |
| 2842 | + if (arr.length === 1 && Array.isArray(arr[0])) { | |
| 2843 | + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))(); | |
| 2844 | + } | |
| 2845 | + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))(); | |
| 2846 | + }; | |
| 2847 | + return MiddlewareArray; | |
| 2848 | +}(Array)); | |
| 2849 | +var EnhancerArray = /** @class */ (function (_super) { | |
| 2850 | + __extends(EnhancerArray, _super); | |
| 2851 | + function EnhancerArray() { | |
| 2852 | + var args = []; | |
| 2853 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2854 | + args[_i] = arguments[_i]; | |
| 2855 | + } | |
| 2856 | + var _this = _super.apply(this, args) || this; | |
| 2857 | + Object.setPrototypeOf(_this, EnhancerArray.prototype); | |
| 2858 | + return _this; | |
| 2859 | + } | |
| 2860 | + Object.defineProperty(EnhancerArray, Symbol.species, { | |
| 2861 | + get: function () { | |
| 2862 | + return EnhancerArray; | |
| 2863 | + }, | |
| 2864 | + enumerable: false, | |
| 2865 | + configurable: true | |
| 2866 | + }); | |
| 2867 | + EnhancerArray.prototype.concat = function () { | |
| 2868 | + var arr = []; | |
| 2869 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2870 | + arr[_i] = arguments[_i]; | |
| 2871 | + } | |
| 2872 | + return _super.prototype.concat.apply(this, arr); | |
| 2873 | + }; | |
| 2874 | + EnhancerArray.prototype.prepend = function () { | |
| 2875 | + var arr = []; | |
| 2876 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 2877 | + arr[_i] = arguments[_i]; | |
| 2878 | + } | |
| 2879 | + if (arr.length === 1 && Array.isArray(arr[0])) { | |
| 2880 | + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))(); | |
| 2881 | + } | |
| 2882 | + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))(); | |
| 2883 | + }; | |
| 2884 | + return EnhancerArray; | |
| 2885 | +}(Array)); | |
| 2886 | +function freezeDraftable(val) { | |
| 2887 | + return (0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_0__["default"])(val, function () { | |
| 2888 | + }) : val; | |
| 2889 | +} | |
| 2890 | +// src/immutableStateInvariantMiddleware.ts | |
| 2891 | +var isProduction = "development" === "production"; | |
| 2892 | +var prefix = "Invariant failed"; | |
| 2893 | +function invariant(condition, message) { | |
| 2894 | + if (condition) { | |
| 2895 | + return; | |
| 2896 | + } | |
| 2897 | + if (isProduction) { | |
| 2898 | + throw new Error(prefix); | |
| 2899 | + } | |
| 2900 | + throw new Error(prefix + ": " + (message || "")); | |
| 2901 | +} | |
| 2902 | +function stringify(obj, serializer, indent, decycler) { | |
| 2903 | + return JSON.stringify(obj, getSerialize(serializer, decycler), indent); | |
| 2904 | +} | |
| 2905 | +function getSerialize(serializer, decycler) { | |
| 2906 | + var stack = [], keys = []; | |
| 2907 | + if (!decycler) | |
| 2908 | + decycler = function (_, value) { | |
| 2909 | + if (stack[0] === value) | |
| 2910 | + return "[Circular ~]"; | |
| 2911 | + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; | |
| 2912 | + }; | |
| 2913 | + return function (key, value) { | |
| 2914 | + if (stack.length > 0) { | |
| 2915 | + var thisPos = stack.indexOf(this); | |
| 2916 | + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); | |
| 2917 | + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); | |
| 2918 | + if (~stack.indexOf(value)) | |
| 2919 | + value = decycler.call(this, key, value); | |
| 2920 | + } | |
| 2921 | + else | |
| 2922 | + stack.push(value); | |
| 2923 | + return serializer == null ? value : serializer.call(this, key, value); | |
| 2924 | + }; | |
| 2925 | +} | |
| 2926 | +function isImmutableDefault(value) { | |
| 2927 | + return typeof value !== "object" || value == null || Object.isFrozen(value); | |
| 2928 | +} | |
| 2929 | +function trackForMutations(isImmutable, ignorePaths, obj) { | |
| 2930 | + var trackedProperties = trackProperties(isImmutable, ignorePaths, obj); | |
| 2931 | + return { | |
| 2932 | + detectMutations: function () { | |
| 2933 | + return detectMutations(isImmutable, ignorePaths, trackedProperties, obj); | |
| 2934 | + } | |
| 2935 | + }; | |
| 2936 | +} | |
| 2937 | +function trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) { | |
| 2938 | + if (ignorePaths === void 0) { ignorePaths = []; } | |
| 2939 | + if (path === void 0) { path = ""; } | |
| 2940 | + if (checkedObjects === void 0) { checkedObjects = new Set(); } | |
| 2941 | + var tracked = { value: obj }; | |
| 2942 | + if (!isImmutable(obj) && !checkedObjects.has(obj)) { | |
| 2943 | + checkedObjects.add(obj); | |
| 2944 | + tracked.children = {}; | |
| 2945 | + for (var key in obj) { | |
| 2946 | + var childPath = path ? path + "." + key : key; | |
| 2947 | + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) { | |
| 2948 | + continue; | |
| 2949 | + } | |
| 2950 | + tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath); | |
| 2951 | + } | |
| 2952 | + } | |
| 2953 | + return tracked; | |
| 2954 | +} | |
| 2955 | +function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) { | |
| 2956 | + if (ignoredPaths === void 0) { ignoredPaths = []; } | |
| 2957 | + if (sameParentRef === void 0) { sameParentRef = false; } | |
| 2958 | + if (path === void 0) { path = ""; } | |
| 2959 | + var prevObj = trackedProperty ? trackedProperty.value : void 0; | |
| 2960 | + var sameRef = prevObj === obj; | |
| 2961 | + if (sameParentRef && !sameRef && !Number.isNaN(obj)) { | |
| 2962 | + return { wasMutated: true, path: path }; | |
| 2963 | + } | |
| 2964 | + if (isImmutable(prevObj) || isImmutable(obj)) { | |
| 2965 | + return { wasMutated: false }; | |
| 2966 | + } | |
| 2967 | + var keysToDetect = {}; | |
| 2968 | + for (var key in trackedProperty.children) { | |
| 2969 | + keysToDetect[key] = true; | |
| 2970 | + } | |
| 2971 | + for (var key in obj) { | |
| 2972 | + keysToDetect[key] = true; | |
| 2973 | + } | |
| 2974 | + var hasIgnoredPaths = ignoredPaths.length > 0; | |
| 2975 | + var _loop_1 = function (key) { | |
| 2976 | + var nestedPath = path ? path + "." + key : key; | |
| 2977 | + if (hasIgnoredPaths) { | |
| 2978 | + var hasMatches = ignoredPaths.some(function (ignored) { | |
| 2979 | + if (ignored instanceof RegExp) { | |
| 2980 | + return ignored.test(nestedPath); | |
| 2981 | + } | |
| 2982 | + return nestedPath === ignored; | |
| 2983 | + }); | |
| 2984 | + if (hasMatches) { | |
| 2985 | + return "continue"; | |
| 2986 | + } | |
| 2987 | + } | |
| 2988 | + var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath); | |
| 2989 | + if (result.wasMutated) { | |
| 2990 | + return { value: result }; | |
| 2991 | + } | |
| 2992 | + }; | |
| 2993 | + for (var key in keysToDetect) { | |
| 2994 | + var state_1 = _loop_1(key); | |
| 2995 | + if (typeof state_1 === "object") | |
| 2996 | + return state_1.value; | |
| 2997 | + } | |
| 2998 | + return { wasMutated: false }; | |
| 2999 | +} | |
| 3000 | +function createImmutableStateInvariantMiddleware(options) { | |
| 3001 | + if (options === void 0) { options = {}; } | |
| 3002 | + if (false) // removed by dead control flow | |
| 3003 | +{} | |
| 3004 | + var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore; | |
| 3005 | + ignoredPaths = ignoredPaths || ignore; | |
| 3006 | + var track = trackForMutations.bind(null, isImmutable, ignoredPaths); | |
| 3007 | + return function (_c) { | |
| 3008 | + var getState = _c.getState; | |
| 3009 | + var state = getState(); | |
| 3010 | + var tracker = track(state); | |
| 3011 | + var result; | |
| 3012 | + return function (next) { return function (action) { | |
| 3013 | + var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware"); | |
| 3014 | + measureUtils.measureTime(function () { | |
| 3015 | + state = getState(); | |
| 3016 | + result = tracker.detectMutations(); | |
| 3017 | + tracker = track(state); | |
| 3018 | + invariant(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"); | |
| 3019 | + }); | |
| 3020 | + var dispatchedAction = next(action); | |
| 3021 | + measureUtils.measureTime(function () { | |
| 3022 | + state = getState(); | |
| 3023 | + result = tracker.detectMutations(); | |
| 3024 | + tracker = track(state); | |
| 3025 | + result.wasMutated && invariant(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"); | |
| 3026 | + }); | |
| 3027 | + measureUtils.warnIfExceeded(); | |
| 3028 | + return dispatchedAction; | |
| 3029 | + }; }; | |
| 3030 | + }; | |
| 3031 | +} | |
| 3032 | +// src/serializableStateInvariantMiddleware.ts | |
| 3033 | +function isPlain(val) { | |
| 3034 | + var type = typeof val; | |
| 3035 | + return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val); | |
| 3036 | +} | |
| 3037 | +function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) { | |
| 3038 | + if (path === void 0) { path = ""; } | |
| 3039 | + if (isSerializable === void 0) { isSerializable = isPlain; } | |
| 3040 | + if (ignoredPaths === void 0) { ignoredPaths = []; } | |
| 3041 | + var foundNestedSerializable; | |
| 3042 | + if (!isSerializable(value)) { | |
| 3043 | + return { | |
| 3044 | + keyPath: path || "<root>", | |
| 3045 | + value: value | |
| 3046 | + }; | |
| 3047 | + } | |
| 3048 | + if (typeof value !== "object" || value === null) { | |
| 3049 | + return false; | |
| 3050 | + } | |
| 3051 | + if (cache == null ? void 0 : cache.has(value)) | |
| 3052 | + return false; | |
| 3053 | + var entries = getEntries != null ? getEntries(value) : Object.entries(value); | |
| 3054 | + var hasIgnoredPaths = ignoredPaths.length > 0; | |
| 3055 | + var _loop_2 = function (key, nestedValue) { | |
| 3056 | + var nestedPath = path ? path + "." + key : key; | |
| 3057 | + if (hasIgnoredPaths) { | |
| 3058 | + var hasMatches = ignoredPaths.some(function (ignored) { | |
| 3059 | + if (ignored instanceof RegExp) { | |
| 3060 | + return ignored.test(nestedPath); | |
| 3061 | + } | |
| 3062 | + return nestedPath === ignored; | |
| 3063 | + }); | |
| 3064 | + if (hasMatches) { | |
| 3065 | + return "continue"; | |
| 3066 | + } | |
| 3067 | + } | |
| 3068 | + if (!isSerializable(nestedValue)) { | |
| 3069 | + return { value: { | |
| 3070 | + keyPath: nestedPath, | |
| 3071 | + value: nestedValue | |
| 3072 | + } }; | |
| 3073 | + } | |
| 3074 | + if (typeof nestedValue === "object") { | |
| 3075 | + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache); | |
| 3076 | + if (foundNestedSerializable) { | |
| 3077 | + return { value: foundNestedSerializable }; | |
| 3078 | + } | |
| 3079 | + } | |
| 3080 | + }; | |
| 3081 | + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | |
| 3082 | + var _c = entries_1[_i], key = _c[0], nestedValue = _c[1]; | |
| 3083 | + var state_2 = _loop_2(key, nestedValue); | |
| 3084 | + if (typeof state_2 === "object") | |
| 3085 | + return state_2.value; | |
| 3086 | + } | |
| 3087 | + if (cache && isNestedFrozen(value)) | |
| 3088 | + cache.add(value); | |
| 3089 | + return false; | |
| 3090 | +} | |
| 3091 | +function isNestedFrozen(value) { | |
| 3092 | + if (!Object.isFrozen(value)) | |
| 3093 | + return false; | |
| 3094 | + for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) { | |
| 3095 | + var nestedValue = _c[_i]; | |
| 3096 | + if (typeof nestedValue !== "object" || nestedValue === null) | |
| 3097 | + continue; | |
| 3098 | + if (!isNestedFrozen(nestedValue)) | |
| 3099 | + return false; | |
| 3100 | + } | |
| 3101 | + return true; | |
| 3102 | +} | |
| 3103 | +function createSerializableStateInvariantMiddleware(options) { | |
| 3104 | + if (options === void 0) { options = {}; } | |
| 3105 | + if (false) // removed by dead control flow | |
| 3106 | +{} | |
| 3107 | + var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k; | |
| 3108 | + var cache = !disableCache && WeakSet ? new WeakSet() : void 0; | |
| 3109 | + return function (storeAPI) { return function (next) { return function (action) { | |
| 3110 | + var result = next(action); | |
| 3111 | + var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware"); | |
| 3112 | + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) { | |
| 3113 | + measureUtils.measureTime(function () { | |
| 3114 | + var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache); | |
| 3115 | + if (foundActionNonSerializableValue) { | |
| 3116 | + var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value; | |
| 3117 | + console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)"); | |
| 3118 | + } | |
| 3119 | + }); | |
| 3120 | + } | |
| 3121 | + if (!ignoreState) { | |
| 3122 | + measureUtils.measureTime(function () { | |
| 3123 | + var state = storeAPI.getState(); | |
| 3124 | + var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache); | |
| 3125 | + if (foundStateNonSerializableValue) { | |
| 3126 | + var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value; | |
| 3127 | + console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"); | |
| 3128 | + } | |
| 3129 | + }); | |
| 3130 | + measureUtils.warnIfExceeded(); | |
| 3131 | + } | |
| 3132 | + return result; | |
| 3133 | + }; }; }; | |
| 3134 | +} | |
| 3135 | +// src/getDefaultMiddleware.ts | |
| 3136 | +function isBoolean(x) { | |
| 3137 | + return typeof x === "boolean"; | |
| 3138 | +} | |
| 3139 | +function curryGetDefaultMiddleware() { | |
| 3140 | + return function curriedGetDefaultMiddleware(options) { | |
| 3141 | + return getDefaultMiddleware(options); | |
| 3142 | + }; | |
| 3143 | +} | |
| 3144 | +function getDefaultMiddleware(options) { | |
| 3145 | + if (options === void 0) { options = {}; } | |
| 3146 | + var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f; | |
| 3147 | + var middlewareArray = new MiddlewareArray(); | |
| 3148 | + if (thunk) { | |
| 3149 | + if (isBoolean(thunk)) { | |
| 3150 | + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]); | |
| 3151 | + } | |
| 3152 | + else { | |
| 3153 | + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument)); | |
| 3154 | + } | |
| 3155 | + } | |
| 3156 | + if (true) { | |
| 3157 | + if (immutableCheck) { | |
| 3158 | + var immutableOptions = {}; | |
| 3159 | + if (!isBoolean(immutableCheck)) { | |
| 3160 | + immutableOptions = immutableCheck; | |
| 3161 | + } | |
| 3162 | + middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions)); | |
| 3163 | + } | |
| 3164 | + if (serializableCheck) { | |
| 3165 | + var serializableOptions = {}; | |
| 3166 | + if (!isBoolean(serializableCheck)) { | |
| 3167 | + serializableOptions = serializableCheck; | |
| 3168 | + } | |
| 3169 | + middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions)); | |
| 3170 | + } | |
| 3171 | + if (actionCreatorCheck) { | |
| 3172 | + var actionCreatorOptions = {}; | |
| 3173 | + if (!isBoolean(actionCreatorCheck)) { | |
| 3174 | + actionCreatorOptions = actionCreatorCheck; | |
| 3175 | + } | |
| 3176 | + middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions)); | |
| 3177 | + } | |
| 3178 | + } | |
| 3179 | + return middlewareArray; | |
| 3180 | +} | |
| 3181 | +// src/configureStore.ts | |
| 3182 | +var IS_PRODUCTION = "development" === "production"; | |
| 3183 | +function configureStore(options) { | |
| 3184 | + var curriedGetDefaultMiddleware = curryGetDefaultMiddleware(); | |
| 3185 | + var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h; | |
| 3186 | + var rootReducer; | |
| 3187 | + if (typeof reducer === "function") { | |
| 3188 | + rootReducer = reducer; | |
| 3189 | + } | |
| 3190 | + else if (isPlainObject(reducer)) { | |
| 3191 | + rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_1__.combineReducers)(reducer); | |
| 3192 | + } | |
| 3193 | + else { | |
| 3194 | + throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers'); | |
| 3195 | + } | |
| 3196 | + var finalMiddleware = middleware; | |
| 3197 | + if (typeof finalMiddleware === "function") { | |
| 3198 | + finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware); | |
| 3199 | + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) { | |
| 3200 | + throw new Error("when using a middleware builder function, an array of middleware must be returned"); | |
| 3201 | + } | |
| 3202 | + } | |
| 3203 | + if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) { | |
| 3204 | + throw new Error("each middleware provided to configureStore must be a function"); | |
| 3205 | + } | |
| 3206 | + var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_1__.applyMiddleware.apply(void 0, finalMiddleware); | |
| 3207 | + var finalCompose = redux__WEBPACK_IMPORTED_MODULE_1__.compose; | |
| 3208 | + if (devTools) { | |
| 3209 | + finalCompose = composeWithDevTools(__spreadValues({ | |
| 3210 | + trace: !IS_PRODUCTION | |
| 3211 | + }, typeof devTools === "object" && devTools)); | |
| 3212 | + } | |
| 3213 | + var defaultEnhancers = new EnhancerArray(middlewareEnhancer); | |
| 3214 | + var storeEnhancers = defaultEnhancers; | |
| 3215 | + if (Array.isArray(enhancers)) { | |
| 3216 | + storeEnhancers = __spreadArray([middlewareEnhancer], enhancers); | |
| 3217 | + } | |
| 3218 | + else if (typeof enhancers === "function") { | |
| 3219 | + storeEnhancers = enhancers(defaultEnhancers); | |
| 3220 | + } | |
| 3221 | + var composedEnhancer = finalCompose.apply(void 0, storeEnhancers); | |
| 3222 | + return (0,redux__WEBPACK_IMPORTED_MODULE_1__.createStore)(rootReducer, preloadedState, composedEnhancer); | |
| 3223 | +} | |
| 3224 | +// src/createReducer.ts | |
| 3225 | + | |
| 3226 | +// src/mapBuilders.ts | |
| 3227 | +function executeReducerBuilderCallback(builderCallback) { | |
| 3228 | + var actionsMap = {}; | |
| 3229 | + var actionMatchers = []; | |
| 3230 | + var defaultCaseReducer; | |
| 3231 | + var builder = { | |
| 3232 | + addCase: function (typeOrActionCreator, reducer) { | |
| 3233 | + if (true) { | |
| 3234 | + if (actionMatchers.length > 0) { | |
| 3235 | + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`"); | |
| 3236 | + } | |
| 3237 | + if (defaultCaseReducer) { | |
| 3238 | + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`"); | |
| 3239 | + } | |
| 3240 | + } | |
| 3241 | + var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; | |
| 3242 | + if (!type) { | |
| 3243 | + throw new Error("`builder.addCase` cannot be called with an empty action type"); | |
| 3244 | + } | |
| 3245 | + if (type in actionsMap) { | |
| 3246 | + throw new Error("`builder.addCase` cannot be called with two reducers for the same action type"); | |
| 3247 | + } | |
| 3248 | + actionsMap[type] = reducer; | |
| 3249 | + return builder; | |
| 3250 | + }, | |
| 3251 | + addMatcher: function (matcher, reducer) { | |
| 3252 | + if (true) { | |
| 3253 | + if (defaultCaseReducer) { | |
| 3254 | + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`"); | |
| 3255 | + } | |
| 3256 | + } | |
| 3257 | + actionMatchers.push({ matcher: matcher, reducer: reducer }); | |
| 3258 | + return builder; | |
| 3259 | + }, | |
| 3260 | + addDefaultCase: function (reducer) { | |
| 3261 | + if (true) { | |
| 3262 | + if (defaultCaseReducer) { | |
| 3263 | + throw new Error("`builder.addDefaultCase` can only be called once"); | |
| 3264 | + } | |
| 3265 | + } | |
| 3266 | + defaultCaseReducer = reducer; | |
| 3267 | + return builder; | |
| 3268 | + } | |
| 3269 | + }; | |
| 3270 | + builderCallback(builder); | |
| 3271 | + return [actionsMap, actionMatchers, defaultCaseReducer]; | |
| 3272 | +} | |
| 3273 | +// src/createReducer.ts | |
| 3274 | +function isStateFunction(x) { | |
| 3275 | + return typeof x === "function"; | |
| 3276 | +} | |
| 3277 | +var hasWarnedAboutObjectNotation = false; | |
| 3278 | +function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) { | |
| 3279 | + if (actionMatchers === void 0) { actionMatchers = []; } | |
| 3280 | + if (true) { | |
| 3281 | + if (typeof mapOrBuilderCallback === "object") { | |
| 3282 | + if (!hasWarnedAboutObjectNotation) { | |
| 3283 | + hasWarnedAboutObjectNotation = true; | |
| 3284 | + console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer"); | |
| 3285 | + } | |
| 3286 | + } | |
| 3287 | + } | |
| 3288 | + var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2]; | |
| 3289 | + var getInitialState; | |
| 3290 | + if (isStateFunction(initialState)) { | |
| 3291 | + getInitialState = function () { return freezeDraftable(initialState()); }; | |
| 3292 | + } | |
| 3293 | + else { | |
| 3294 | + var frozenInitialState_1 = freezeDraftable(initialState); | |
| 3295 | + getInitialState = function () { return frozenInitialState_1; }; | |
| 3296 | + } | |
| 3297 | + function reducer(state, action) { | |
| 3298 | + if (state === void 0) { state = getInitialState(); } | |
| 3299 | + var caseReducers = __spreadArray([ | |
| 3300 | + actionsMap[action.type] | |
| 3301 | + ], finalActionMatchers.filter(function (_c) { | |
| 3302 | + var matcher = _c.matcher; | |
| 3303 | + return matcher(action); | |
| 3304 | + }).map(function (_c) { | |
| 3305 | + var reducer2 = _c.reducer; | |
| 3306 | + return reducer2; | |
| 3307 | + })); | |
| 3308 | + if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) { | |
| 3309 | + caseReducers = [finalDefaultCaseReducer]; | |
| 3310 | + } | |
| 3311 | + return caseReducers.reduce(function (previousState, caseReducer) { | |
| 3312 | + if (caseReducer) { | |
| 3313 | + if ((0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraft)(previousState)) { | |
| 3314 | + var draft = previousState; | |
| 3315 | + var result = caseReducer(draft, action); | |
| 3316 | + if (result === void 0) { | |
| 3317 | + return previousState; | |
| 3318 | + } | |
| 3319 | + return result; | |
| 3320 | + } | |
| 3321 | + else if (!(0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraftable)(previousState)) { | |
| 3322 | + var result = caseReducer(previousState, action); | |
| 3323 | + if (result === void 0) { | |
| 3324 | + if (previousState === null) { | |
| 3325 | + return previousState; | |
| 3326 | + } | |
| 3327 | + throw Error("A case reducer on a non-draftable value must not return undefined"); | |
| 3328 | + } | |
| 3329 | + return result; | |
| 3330 | + } | |
| 3331 | + else { | |
| 3332 | + return (0,immer__WEBPACK_IMPORTED_MODULE_0__["default"])(previousState, function (draft) { | |
| 3333 | + return caseReducer(draft, action); | |
| 3334 | + }); | |
| 3335 | + } | |
| 3336 | + } | |
| 3337 | + return previousState; | |
| 3338 | + }, state); | |
| 3339 | + } | |
| 3340 | + reducer.getInitialState = getInitialState; | |
| 3341 | + return reducer; | |
| 3342 | +} | |
| 3343 | +// src/createSlice.ts | |
| 3344 | +var hasWarnedAboutObjectNotation2 = false; | |
| 3345 | +function getType2(slice, actionKey) { | |
| 3346 | + return slice + "/" + actionKey; | |
| 3347 | +} | |
| 3348 | +function createSlice(options) { | |
| 3349 | + var name = options.name; | |
| 3350 | + if (!name) { | |
| 3351 | + throw new Error("`name` is a required option for createSlice"); | |
| 3352 | + } | |
| 3353 | + if (typeof process !== "undefined" && "development" === "development") { | |
| 3354 | + if (options.initialState === void 0) { | |
| 3355 | + console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`"); | |
| 3356 | + } | |
| 3357 | + } | |
| 3358 | + var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState); | |
| 3359 | + var reducers = options.reducers || {}; | |
| 3360 | + var reducerNames = Object.keys(reducers); | |
| 3361 | + var sliceCaseReducersByName = {}; | |
| 3362 | + var sliceCaseReducersByType = {}; | |
| 3363 | + var actionCreators = {}; | |
| 3364 | + reducerNames.forEach(function (reducerName) { | |
| 3365 | + var maybeReducerWithPrepare = reducers[reducerName]; | |
| 3366 | + var type = getType2(name, reducerName); | |
| 3367 | + var caseReducer; | |
| 3368 | + var prepareCallback; | |
| 3369 | + if ("reducer" in maybeReducerWithPrepare) { | |
| 3370 | + caseReducer = maybeReducerWithPrepare.reducer; | |
| 3371 | + prepareCallback = maybeReducerWithPrepare.prepare; | |
| 3372 | + } | |
| 3373 | + else { | |
| 3374 | + caseReducer = maybeReducerWithPrepare; | |
| 3375 | + } | |
| 3376 | + sliceCaseReducersByName[reducerName] = caseReducer; | |
| 3377 | + sliceCaseReducersByType[type] = caseReducer; | |
| 3378 | + actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type); | |
| 3379 | + }); | |
| 3380 | + function buildReducer() { | |
| 3381 | + if (true) { | |
| 3382 | + if (typeof options.extraReducers === "object") { | |
| 3383 | + if (!hasWarnedAboutObjectNotation2) { | |
| 3384 | + hasWarnedAboutObjectNotation2 = true; | |
| 3385 | + console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice"); | |
| 3386 | + } | |
| 3387 | + } | |
| 3388 | + } | |
| 3389 | + var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f; | |
| 3390 | + var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType); | |
| 3391 | + return createReducer(initialState, function (builder) { | |
| 3392 | + for (var key in finalCaseReducers) { | |
| 3393 | + builder.addCase(key, finalCaseReducers[key]); | |
| 3394 | + } | |
| 3395 | + for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) { | |
| 3396 | + var m = actionMatchers_1[_i]; | |
| 3397 | + builder.addMatcher(m.matcher, m.reducer); | |
| 3398 | + } | |
| 3399 | + if (defaultCaseReducer) { | |
| 3400 | + builder.addDefaultCase(defaultCaseReducer); | |
| 3401 | + } | |
| 3402 | + }); | |
| 3403 | + } | |
| 3404 | + var _reducer; | |
| 3405 | + return { | |
| 3406 | + name: name, | |
| 3407 | + reducer: function (state, action) { | |
| 3408 | + if (!_reducer) | |
| 3409 | + _reducer = buildReducer(); | |
| 3410 | + return _reducer(state, action); | |
| 3411 | + }, | |
| 3412 | + actions: actionCreators, | |
| 3413 | + caseReducers: sliceCaseReducersByName, | |
| 3414 | + getInitialState: function () { | |
| 3415 | + if (!_reducer) | |
| 3416 | + _reducer = buildReducer(); | |
| 3417 | + return _reducer.getInitialState(); | |
| 3418 | + } | |
| 3419 | + }; | |
| 3420 | +} | |
| 3421 | +// src/entities/entity_state.ts | |
| 3422 | +function getInitialEntityState() { | |
| 3423 | + return { | |
| 3424 | + ids: [], | |
| 3425 | + entities: {} | |
| 3426 | + }; | |
| 3427 | +} | |
| 3428 | +function createInitialStateFactory() { | |
| 3429 | + function getInitialState(additionalState) { | |
| 3430 | + if (additionalState === void 0) { additionalState = {}; } | |
| 3431 | + return Object.assign(getInitialEntityState(), additionalState); | |
| 3432 | + } | |
| 3433 | + return { getInitialState: getInitialState }; | |
| 3434 | +} | |
| 3435 | +// src/entities/state_selectors.ts | |
| 3436 | +function createSelectorsFactory() { | |
| 3437 | + function getSelectors(selectState) { | |
| 3438 | + var selectIds = function (state) { return state.ids; }; | |
| 3439 | + var selectEntities = function (state) { return state.entities; }; | |
| 3440 | + var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); }); | |
| 3441 | + var selectId = function (_, id) { return id; }; | |
| 3442 | + var selectById = function (entities, id) { return entities[id]; }; | |
| 3443 | + var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; }); | |
| 3444 | + if (!selectState) { | |
| 3445 | + return { | |
| 3446 | + selectIds: selectIds, | |
| 3447 | + selectEntities: selectEntities, | |
| 3448 | + selectAll: selectAll, | |
| 3449 | + selectTotal: selectTotal, | |
| 3450 | + selectById: createDraftSafeSelector(selectEntities, selectId, selectById) | |
| 3451 | + }; | |
| 3452 | + } | |
| 3453 | + var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities); | |
| 3454 | + return { | |
| 3455 | + selectIds: createDraftSafeSelector(selectState, selectIds), | |
| 3456 | + selectEntities: selectGlobalizedEntities, | |
| 3457 | + selectAll: createDraftSafeSelector(selectState, selectAll), | |
| 3458 | + selectTotal: createDraftSafeSelector(selectState, selectTotal), | |
| 3459 | + selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById) | |
| 3460 | + }; | |
| 3461 | + } | |
| 3462 | + return { getSelectors: getSelectors }; | |
| 3463 | +} | |
| 3464 | +// src/entities/state_adapter.ts | |
| 3465 | + | |
| 3466 | +function createSingleArgumentStateOperator(mutator) { | |
| 3467 | + var operator = createStateOperator(function (_, state) { return mutator(state); }); | |
| 3468 | + return function operation(state) { | |
| 3469 | + return operator(state, void 0); | |
| 3470 | + }; | |
| 3471 | +} | |
| 3472 | +function createStateOperator(mutator) { | |
| 3473 | + return function operation(state, arg) { | |
| 3474 | + function isPayloadActionArgument(arg2) { | |
| 3475 | + return isFSA(arg2); | |
| 3476 | + } | |
| 3477 | + var runMutator = function (draft) { | |
| 3478 | + if (isPayloadActionArgument(arg)) { | |
| 3479 | + mutator(arg.payload, draft); | |
| 3480 | + } | |
| 3481 | + else { | |
| 3482 | + mutator(arg, draft); | |
| 3483 | + } | |
| 3484 | + }; | |
| 3485 | + if ((0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraft)(state)) { | |
| 3486 | + runMutator(state); | |
| 3487 | + return state; | |
| 3488 | + } | |
| 3489 | + else { | |
| 3490 | + return (0,immer__WEBPACK_IMPORTED_MODULE_0__["default"])(state, runMutator); | |
| 3491 | + } | |
| 3492 | + }; | |
| 3493 | +} | |
| 3494 | +// src/entities/utils.ts | |
| 3495 | +function selectIdValue(entity, selectId) { | |
| 3496 | + var key = selectId(entity); | |
| 3497 | + if ( true && key === void 0) { | |
| 3498 | + console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString()); | |
| 3499 | + } | |
| 3500 | + return key; | |
| 3501 | +} | |
| 3502 | +function ensureEntitiesArray(entities) { | |
| 3503 | + if (!Array.isArray(entities)) { | |
| 3504 | + entities = Object.values(entities); | |
| 3505 | + } | |
| 3506 | + return entities; | |
| 3507 | +} | |
| 3508 | +function splitAddedUpdatedEntities(newEntities, selectId, state) { | |
| 3509 | + newEntities = ensureEntitiesArray(newEntities); | |
| 3510 | + var added = []; | |
| 3511 | + var updated = []; | |
| 3512 | + for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) { | |
| 3513 | + var entity = newEntities_1[_i]; | |
| 3514 | + var id = selectIdValue(entity, selectId); | |
| 3515 | + if (id in state.entities) { | |
| 3516 | + updated.push({ id: id, changes: entity }); | |
| 3517 | + } | |
| 3518 | + else { | |
| 3519 | + added.push(entity); | |
| 3520 | + } | |
| 3521 | + } | |
| 3522 | + return [added, updated]; | |
| 3523 | +} | |
| 3524 | +// src/entities/unsorted_state_adapter.ts | |
| 3525 | +function createUnsortedStateAdapter(selectId) { | |
| 3526 | + function addOneMutably(entity, state) { | |
| 3527 | + var key = selectIdValue(entity, selectId); | |
| 3528 | + if (key in state.entities) { | |
| 3529 | + return; | |
| 3530 | + } | |
| 3531 | + state.ids.push(key); | |
| 3532 | + state.entities[key] = entity; | |
| 3533 | + } | |
| 3534 | + function addManyMutably(newEntities, state) { | |
| 3535 | + newEntities = ensureEntitiesArray(newEntities); | |
| 3536 | + for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) { | |
| 3537 | + var entity = newEntities_2[_i]; | |
| 3538 | + addOneMutably(entity, state); | |
| 3539 | + } | |
| 3540 | + } | |
| 3541 | + function setOneMutably(entity, state) { | |
| 3542 | + var key = selectIdValue(entity, selectId); | |
| 3543 | + if (!(key in state.entities)) { | |
| 3544 | + state.ids.push(key); | |
| 3545 | + } | |
| 3546 | + state.entities[key] = entity; | |
| 3547 | + } | |
| 3548 | + function setManyMutably(newEntities, state) { | |
| 3549 | + newEntities = ensureEntitiesArray(newEntities); | |
| 3550 | + for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) { | |
| 3551 | + var entity = newEntities_3[_i]; | |
| 3552 | + setOneMutably(entity, state); | |
| 3553 | + } | |
| 3554 | + } | |
| 3555 | + function setAllMutably(newEntities, state) { | |
| 3556 | + newEntities = ensureEntitiesArray(newEntities); | |
| 3557 | + state.ids = []; | |
| 3558 | + state.entities = {}; | |
| 3559 | + addManyMutably(newEntities, state); | |
| 3560 | + } | |
| 3561 | + function removeOneMutably(key, state) { | |
| 3562 | + return removeManyMutably([key], state); | |
| 3563 | + } | |
| 3564 | + function removeManyMutably(keys, state) { | |
| 3565 | + var didMutate = false; | |
| 3566 | + keys.forEach(function (key) { | |
| 3567 | + if (key in state.entities) { | |
| 3568 | + delete state.entities[key]; | |
| 3569 | + didMutate = true; | |
| 3570 | + } | |
| 3571 | + }); | |
| 3572 | + if (didMutate) { | |
| 3573 | + state.ids = state.ids.filter(function (id) { return id in state.entities; }); | |
| 3574 | + } | |
| 3575 | + } | |
| 3576 | + function removeAllMutably(state) { | |
| 3577 | + Object.assign(state, { | |
| 3578 | + ids: [], | |
| 3579 | + entities: {} | |
| 3580 | + }); | |
| 3581 | + } | |
| 3582 | + function takeNewKey(keys, update, state) { | |
| 3583 | + var original2 = state.entities[update.id]; | |
| 3584 | + var updated = Object.assign({}, original2, update.changes); | |
| 3585 | + var newKey = selectIdValue(updated, selectId); | |
| 3586 | + var hasNewKey = newKey !== update.id; | |
| 3587 | + if (hasNewKey) { | |
| 3588 | + keys[update.id] = newKey; | |
| 3589 | + delete state.entities[update.id]; | |
| 3590 | + } | |
| 3591 | + state.entities[newKey] = updated; | |
| 3592 | + return hasNewKey; | |
| 3593 | + } | |
| 3594 | + function updateOneMutably(update, state) { | |
| 3595 | + return updateManyMutably([update], state); | |
| 3596 | + } | |
| 3597 | + function updateManyMutably(updates, state) { | |
| 3598 | + var newKeys = {}; | |
| 3599 | + var updatesPerEntity = {}; | |
| 3600 | + updates.forEach(function (update) { | |
| 3601 | + if (update.id in state.entities) { | |
| 3602 | + updatesPerEntity[update.id] = { | |
| 3603 | + id: update.id, | |
| 3604 | + changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes) | |
| 3605 | + }; | |
| 3606 | + } | |
| 3607 | + }); | |
| 3608 | + updates = Object.values(updatesPerEntity); | |
| 3609 | + var didMutateEntities = updates.length > 0; | |
| 3610 | + if (didMutateEntities) { | |
| 3611 | + var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0; | |
| 3612 | + if (didMutateIds) { | |
| 3613 | + state.ids = Object.keys(state.entities); | |
| 3614 | + } | |
| 3615 | + } | |
| 3616 | + } | |
| 3617 | + function upsertOneMutably(entity, state) { | |
| 3618 | + return upsertManyMutably([entity], state); | |
| 3619 | + } | |
| 3620 | + function upsertManyMutably(newEntities, state) { | |
| 3621 | + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1]; | |
| 3622 | + updateManyMutably(updated, state); | |
| 3623 | + addManyMutably(added, state); | |
| 3624 | + } | |
| 3625 | + return { | |
| 3626 | + removeAll: createSingleArgumentStateOperator(removeAllMutably), | |
| 3627 | + addOne: createStateOperator(addOneMutably), | |
| 3628 | + addMany: createStateOperator(addManyMutably), | |
| 3629 | + setOne: createStateOperator(setOneMutably), | |
| 3630 | + setMany: createStateOperator(setManyMutably), | |
| 3631 | + setAll: createStateOperator(setAllMutably), | |
| 3632 | + updateOne: createStateOperator(updateOneMutably), | |
| 3633 | + updateMany: createStateOperator(updateManyMutably), | |
| 3634 | + upsertOne: createStateOperator(upsertOneMutably), | |
| 3635 | + upsertMany: createStateOperator(upsertManyMutably), | |
| 3636 | + removeOne: createStateOperator(removeOneMutably), | |
| 3637 | + removeMany: createStateOperator(removeManyMutably) | |
| 3638 | + }; | |
| 3639 | +} | |
| 3640 | +// src/entities/sorted_state_adapter.ts | |
| 3641 | +function createSortedStateAdapter(selectId, sort) { | |
| 3642 | + var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll; | |
| 3643 | + function addOneMutably(entity, state) { | |
| 3644 | + return addManyMutably([entity], state); | |
| 3645 | + } | |
| 3646 | + function addManyMutably(newEntities, state) { | |
| 3647 | + newEntities = ensureEntitiesArray(newEntities); | |
| 3648 | + var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); }); | |
| 3649 | + if (models.length !== 0) { | |
| 3650 | + merge(models, state); | |
| 3651 | + } | |
| 3652 | + } | |
| 3653 | + function setOneMutably(entity, state) { | |
| 3654 | + return setManyMutably([entity], state); | |
| 3655 | + } | |
| 3656 | + function setManyMutably(newEntities, state) { | |
| 3657 | + newEntities = ensureEntitiesArray(newEntities); | |
| 3658 | + if (newEntities.length !== 0) { | |
| 3659 | + merge(newEntities, state); | |
| 3660 | + } | |
| 3661 | + } | |
| 3662 | + function setAllMutably(newEntities, state) { | |
| 3663 | + newEntities = ensureEntitiesArray(newEntities); | |
| 3664 | + state.entities = {}; | |
| 3665 | + state.ids = []; | |
| 3666 | + addManyMutably(newEntities, state); | |
| 3667 | + } | |
| 3668 | + function updateOneMutably(update, state) { | |
| 3669 | + return updateManyMutably([update], state); | |
| 3670 | + } | |
| 3671 | + function updateManyMutably(updates, state) { | |
| 3672 | + var appliedUpdates = false; | |
| 3673 | + for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) { | |
| 3674 | + var update = updates_1[_i]; | |
| 3675 | + var entity = state.entities[update.id]; | |
| 3676 | + if (!entity) { | |
| 3677 | + continue; | |
| 3678 | + } | |
| 3679 | + appliedUpdates = true; | |
| 3680 | + Object.assign(entity, update.changes); | |
| 3681 | + var newId = selectId(entity); | |
| 3682 | + if (update.id !== newId) { | |
| 3683 | + delete state.entities[update.id]; | |
| 3684 | + state.entities[newId] = entity; | |
| 3685 | + } | |
| 3686 | + } | |
| 3687 | + if (appliedUpdates) { | |
| 3688 | + resortEntities(state); | |
| 3689 | + } | |
| 3690 | + } | |
| 3691 | + function upsertOneMutably(entity, state) { | |
| 3692 | + return upsertManyMutably([entity], state); | |
| 3693 | + } | |
| 3694 | + function upsertManyMutably(newEntities, state) { | |
| 3695 | + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1]; | |
| 3696 | + updateManyMutably(updated, state); | |
| 3697 | + addManyMutably(added, state); | |
| 3698 | + } | |
| 3699 | + function areArraysEqual(a, b) { | |
| 3700 | + if (a.length !== b.length) { | |
| 3701 | + return false; | |
| 3702 | + } | |
| 3703 | + for (var i = 0; i < a.length && i < b.length; i++) { | |
| 3704 | + if (a[i] === b[i]) { | |
| 3705 | + continue; | |
| 3706 | + } | |
| 3707 | + return false; | |
| 3708 | + } | |
| 3709 | + return true; | |
| 3710 | + } | |
| 3711 | + function merge(models, state) { | |
| 3712 | + models.forEach(function (model) { | |
| 3713 | + state.entities[selectId(model)] = model; | |
| 3714 | + }); | |
| 3715 | + resortEntities(state); | |
| 3716 | + } | |
| 3717 | + function resortEntities(state) { | |
| 3718 | + var allEntities = Object.values(state.entities); | |
| 3719 | + allEntities.sort(sort); | |
| 3720 | + var newSortedIds = allEntities.map(selectId); | |
| 3721 | + var ids = state.ids; | |
| 3722 | + if (!areArraysEqual(ids, newSortedIds)) { | |
| 3723 | + state.ids = newSortedIds; | |
| 3724 | + } | |
| 3725 | + } | |
| 3726 | + return { | |
| 3727 | + removeOne: removeOne, | |
| 3728 | + removeMany: removeMany, | |
| 3729 | + removeAll: removeAll, | |
| 3730 | + addOne: createStateOperator(addOneMutably), | |
| 3731 | + updateOne: createStateOperator(updateOneMutably), | |
| 3732 | + upsertOne: createStateOperator(upsertOneMutably), | |
| 3733 | + setOne: createStateOperator(setOneMutably), | |
| 3734 | + setMany: createStateOperator(setManyMutably), | |
| 3735 | + setAll: createStateOperator(setAllMutably), | |
| 3736 | + addMany: createStateOperator(addManyMutably), | |
| 3737 | + updateMany: createStateOperator(updateManyMutably), | |
| 3738 | + upsertMany: createStateOperator(upsertManyMutably) | |
| 3739 | + }; | |
| 3740 | +} | |
| 3741 | +// src/entities/create_adapter.ts | |
| 3742 | +function createEntityAdapter(options) { | |
| 3743 | + if (options === void 0) { options = {}; } | |
| 3744 | + var _c = __spreadValues({ | |
| 3745 | + sortComparer: false, | |
| 3746 | + selectId: function (instance) { return instance.id; } | |
| 3747 | + }, options), selectId = _c.selectId, sortComparer = _c.sortComparer; | |
| 3748 | + var stateFactory = createInitialStateFactory(); | |
| 3749 | + var selectorsFactory = createSelectorsFactory(); | |
| 3750 | + var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId); | |
| 3751 | + return __spreadValues(__spreadValues(__spreadValues({ | |
| 3752 | + selectId: selectId, | |
| 3753 | + sortComparer: sortComparer | |
| 3754 | + }, stateFactory), selectorsFactory), stateAdapter); | |
| 3755 | +} | |
| 3756 | +// src/nanoid.ts | |
| 3757 | +var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"; | |
| 3758 | +var nanoid = function (size) { | |
| 3759 | + if (size === void 0) { size = 21; } | |
| 3760 | + var id = ""; | |
| 3761 | + var i = size; | |
| 3762 | + while (i--) { | |
| 3763 | + id += urlAlphabet[Math.random() * 64 | 0]; | |
| 3764 | + } | |
| 3765 | + return id; | |
| 3766 | +}; | |
| 3767 | +// src/createAsyncThunk.ts | |
| 3768 | +var commonProperties = [ | |
| 3769 | + "name", | |
| 3770 | + "message", | |
| 3771 | + "stack", | |
| 3772 | + "code" | |
| 3773 | +]; | |
| 3774 | +var RejectWithValue = /** @class */ (function () { | |
| 3775 | + function RejectWithValue(payload, meta) { | |
| 3776 | + this.payload = payload; | |
| 3777 | + this.meta = meta; | |
| 3778 | + } | |
| 3779 | + return RejectWithValue; | |
| 3780 | +}()); | |
| 3781 | +var FulfillWithMeta = /** @class */ (function () { | |
| 3782 | + function FulfillWithMeta(payload, meta) { | |
| 3783 | + this.payload = payload; | |
| 3784 | + this.meta = meta; | |
| 3785 | + } | |
| 3786 | + return FulfillWithMeta; | |
| 3787 | +}()); | |
| 3788 | +var miniSerializeError = function (value) { | |
| 3789 | + if (typeof value === "object" && value !== null) { | |
| 3790 | + var simpleError = {}; | |
| 3791 | + for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) { | |
| 3792 | + var property = commonProperties_1[_i]; | |
| 3793 | + if (typeof value[property] === "string") { | |
| 3794 | + simpleError[property] = value[property]; | |
| 3795 | + } | |
| 3796 | + } | |
| 3797 | + return simpleError; | |
| 3798 | + } | |
| 3799 | + return { message: String(value) }; | |
| 3800 | +}; | |
| 3801 | +var createAsyncThunk = (function () { | |
| 3802 | + function createAsyncThunk2(typePrefix, payloadCreator, options) { | |
| 3803 | + var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({ | |
| 3804 | + payload: payload, | |
| 3805 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 3806 | + arg: arg, | |
| 3807 | + requestId: requestId, | |
| 3808 | + requestStatus: "fulfilled" | |
| 3809 | + }) | |
| 3810 | + }); }); | |
| 3811 | + var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({ | |
| 3812 | + payload: void 0, | |
| 3813 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 3814 | + arg: arg, | |
| 3815 | + requestId: requestId, | |
| 3816 | + requestStatus: "pending" | |
| 3817 | + }) | |
| 3818 | + }); }); | |
| 3819 | + var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({ | |
| 3820 | + payload: payload, | |
| 3821 | + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"), | |
| 3822 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 3823 | + arg: arg, | |
| 3824 | + requestId: requestId, | |
| 3825 | + rejectedWithValue: !!payload, | |
| 3826 | + requestStatus: "rejected", | |
| 3827 | + aborted: (error == null ? void 0 : error.name) === "AbortError", | |
| 3828 | + condition: (error == null ? void 0 : error.name) === "ConditionError" | |
| 3829 | + }) | |
| 3830 | + }); }); | |
| 3831 | + var displayedWarning = false; | |
| 3832 | + var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () { | |
| 3833 | + function class_1() { | |
| 3834 | + this.signal = { | |
| 3835 | + aborted: false, | |
| 3836 | + addEventListener: function () { | |
| 3837 | + }, | |
| 3838 | + dispatchEvent: function () { | |
| 3839 | + return false; | |
| 3840 | + }, | |
| 3841 | + onabort: function () { | |
| 3842 | + }, | |
| 3843 | + removeEventListener: function () { | |
| 3844 | + }, | |
| 3845 | + reason: void 0, | |
| 3846 | + throwIfAborted: function () { | |
| 3847 | + } | |
| 3848 | + }; | |
| 3849 | + } | |
| 3850 | + class_1.prototype.abort = function () { | |
| 3851 | + if (true) { | |
| 3852 | + if (!displayedWarning) { | |
| 3853 | + displayedWarning = true; | |
| 3854 | + console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'."); | |
| 3855 | + } | |
| 3856 | + } | |
| 3857 | + }; | |
| 3858 | + return class_1; | |
| 3859 | + }()); | |
| 3860 | + function actionCreator(arg) { | |
| 3861 | + return function (dispatch, getState, extra) { | |
| 3862 | + var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid(); | |
| 3863 | + var abortController = new AC(); | |
| 3864 | + var abortReason; | |
| 3865 | + var started = false; | |
| 3866 | + function abort(reason) { | |
| 3867 | + abortReason = reason; | |
| 3868 | + abortController.abort(); | |
| 3869 | + } | |
| 3870 | + var promise2 = function () { | |
| 3871 | + return __async(this, null, function () { | |
| 3872 | + var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch; | |
| 3873 | + return __generator(this, function (_c) { | |
| 3874 | + switch (_c.label) { | |
| 3875 | + case 0: | |
| 3876 | + _c.trys.push([0, 4, , 5]); | |
| 3877 | + conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra }); | |
| 3878 | + if (!isThenable(conditionResult)) return [3 /*break*/, 2]; | |
| 3879 | + return [4 /*yield*/, conditionResult]; | |
| 3880 | + case 1: | |
| 3881 | + conditionResult = _c.sent(); | |
| 3882 | + _c.label = 2; | |
| 3883 | + case 2: | |
| 3884 | + if (conditionResult === false || abortController.signal.aborted) { | |
| 3885 | + throw { | |
| 3886 | + name: "ConditionError", | |
| 3887 | + message: "Aborted due to condition callback returning false." | |
| 3888 | + }; | |
| 3889 | + } | |
| 3890 | + started = true; | |
| 3891 | + abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({ | |
| 3892 | + name: "AbortError", | |
| 3893 | + message: abortReason || "Aborted" | |
| 3894 | + }); }); }); | |
| 3895 | + dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra }))); | |
| 3896 | + return [4 /*yield*/, Promise.race([ | |
| 3897 | + abortedPromise, | |
| 3898 | + Promise.resolve(payloadCreator(arg, { | |
| 3899 | + dispatch: dispatch, | |
| 3900 | + getState: getState, | |
| 3901 | + extra: extra, | |
| 3902 | + requestId: requestId, | |
| 3903 | + signal: abortController.signal, | |
| 3904 | + abort: abort, | |
| 3905 | + rejectWithValue: function (value, meta) { | |
| 3906 | + return new RejectWithValue(value, meta); | |
| 3907 | + }, | |
| 3908 | + fulfillWithValue: function (value, meta) { | |
| 3909 | + return new FulfillWithMeta(value, meta); | |
| 3910 | + } | |
| 3911 | + })).then(function (result) { | |
| 3912 | + if (result instanceof RejectWithValue) { | |
| 3913 | + throw result; | |
| 3914 | + } | |
| 3915 | + if (result instanceof FulfillWithMeta) { | |
| 3916 | + return fulfilled(result.payload, requestId, arg, result.meta); | |
| 3917 | + } | |
| 3918 | + return fulfilled(result, requestId, arg); | |
| 3919 | + }) | |
| 3920 | + ])]; | |
| 3921 | + case 3: | |
| 3922 | + finalAction = _c.sent(); | |
| 3923 | + return [3 /*break*/, 5]; | |
| 3924 | + case 4: | |
| 3925 | + err_1 = _c.sent(); | |
| 3926 | + finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg); | |
| 3927 | + return [3 /*break*/, 5]; | |
| 3928 | + case 5: | |
| 3929 | + skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; | |
| 3930 | + if (!skipDispatch) { | |
| 3931 | + dispatch(finalAction); | |
| 3932 | + } | |
| 3933 | + return [2 /*return*/, finalAction]; | |
| 3934 | + } | |
| 3935 | + }); | |
| 3936 | + }); | |
| 3937 | + }(); | |
| 3938 | + return Object.assign(promise2, { | |
| 3939 | + abort: abort, | |
| 3940 | + requestId: requestId, | |
| 3941 | + arg: arg, | |
| 3942 | + unwrap: function () { | |
| 3943 | + return promise2.then(unwrapResult); | |
| 3944 | + } | |
| 3945 | + }); | |
| 3946 | + }; | |
| 3947 | + } | |
| 3948 | + return Object.assign(actionCreator, { | |
| 3949 | + pending: pending, | |
| 3950 | + rejected: rejected, | |
| 3951 | + fulfilled: fulfilled, | |
| 3952 | + typePrefix: typePrefix | |
| 3953 | + }); | |
| 3954 | + } | |
| 3955 | + createAsyncThunk2.withTypes = function () { return createAsyncThunk2; }; | |
| 3956 | + return createAsyncThunk2; | |
| 3957 | +})(); | |
| 3958 | +function unwrapResult(action) { | |
| 3959 | + if (action.meta && action.meta.rejectedWithValue) { | |
| 3960 | + throw action.payload; | |
| 3961 | + } | |
| 3962 | + if (action.error) { | |
| 3963 | + throw action.error; | |
| 3964 | + } | |
| 3965 | + return action.payload; | |
| 3966 | +} | |
| 3967 | +function isThenable(value) { | |
| 3968 | + return value !== null && typeof value === "object" && typeof value.then === "function"; | |
| 3969 | +} | |
| 3970 | +// src/matchers.ts | |
| 3971 | +var matches = function (matcher, action) { | |
| 3972 | + if (hasMatchFunction(matcher)) { | |
| 3973 | + return matcher.match(action); | |
| 3974 | + } | |
| 3975 | + else { | |
| 3976 | + return matcher(action); | |
| 3977 | + } | |
| 3978 | +}; | |
| 3979 | +function isAnyOf() { | |
| 3980 | + var matchers = []; | |
| 3981 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 3982 | + matchers[_i] = arguments[_i]; | |
| 3983 | + } | |
| 3984 | + return function (action) { | |
| 3985 | + return matchers.some(function (matcher) { return matches(matcher, action); }); | |
| 3986 | + }; | |
| 3987 | +} | |
| 3988 | +function isAllOf() { | |
| 3989 | + var matchers = []; | |
| 3990 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 3991 | + matchers[_i] = arguments[_i]; | |
| 3992 | + } | |
| 3993 | + return function (action) { | |
| 3994 | + return matchers.every(function (matcher) { return matches(matcher, action); }); | |
| 3995 | + }; | |
| 3996 | +} | |
| 3997 | +function hasExpectedRequestMetadata(action, validStatus) { | |
| 3998 | + if (!action || !action.meta) | |
| 3999 | + return false; | |
| 4000 | + var hasValidRequestId = typeof action.meta.requestId === "string"; | |
| 4001 | + var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1; | |
| 4002 | + return hasValidRequestId && hasValidRequestStatus; | |
| 4003 | +} | |
| 4004 | +function isAsyncThunkArray(a) { | |
| 4005 | + return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0]; | |
| 4006 | +} | |
| 4007 | +function isPending() { | |
| 4008 | + var asyncThunks = []; | |
| 4009 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4010 | + asyncThunks[_i] = arguments[_i]; | |
| 4011 | + } | |
| 4012 | + if (asyncThunks.length === 0) { | |
| 4013 | + return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); }; | |
| 4014 | + } | |
| 4015 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 4016 | + return isPending()(asyncThunks[0]); | |
| 4017 | + } | |
| 4018 | + return function (action) { | |
| 4019 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; }); | |
| 4020 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 4021 | + return combinedMatcher(action); | |
| 4022 | + }; | |
| 4023 | +} | |
| 4024 | +function isRejected() { | |
| 4025 | + var asyncThunks = []; | |
| 4026 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4027 | + asyncThunks[_i] = arguments[_i]; | |
| 4028 | + } | |
| 4029 | + if (asyncThunks.length === 0) { | |
| 4030 | + return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); }; | |
| 4031 | + } | |
| 4032 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 4033 | + return isRejected()(asyncThunks[0]); | |
| 4034 | + } | |
| 4035 | + return function (action) { | |
| 4036 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; }); | |
| 4037 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 4038 | + return combinedMatcher(action); | |
| 4039 | + }; | |
| 4040 | +} | |
| 4041 | +function isRejectedWithValue() { | |
| 4042 | + var asyncThunks = []; | |
| 4043 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4044 | + asyncThunks[_i] = arguments[_i]; | |
| 4045 | + } | |
| 4046 | + var hasFlag = function (action) { | |
| 4047 | + return action && action.meta && action.meta.rejectedWithValue; | |
| 4048 | + }; | |
| 4049 | + if (asyncThunks.length === 0) { | |
| 4050 | + return function (action) { | |
| 4051 | + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag); | |
| 4052 | + return combinedMatcher(action); | |
| 4053 | + }; | |
| 4054 | + } | |
| 4055 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 4056 | + return isRejectedWithValue()(asyncThunks[0]); | |
| 4057 | + } | |
| 4058 | + return function (action) { | |
| 4059 | + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag); | |
| 4060 | + return combinedMatcher(action); | |
| 4061 | + }; | |
| 4062 | +} | |
| 4063 | +function isFulfilled() { | |
| 4064 | + var asyncThunks = []; | |
| 4065 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4066 | + asyncThunks[_i] = arguments[_i]; | |
| 4067 | + } | |
| 4068 | + if (asyncThunks.length === 0) { | |
| 4069 | + return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); }; | |
| 4070 | + } | |
| 4071 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 4072 | + return isFulfilled()(asyncThunks[0]); | |
| 4073 | + } | |
| 4074 | + return function (action) { | |
| 4075 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; }); | |
| 4076 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 4077 | + return combinedMatcher(action); | |
| 4078 | + }; | |
| 4079 | +} | |
| 4080 | +function isAsyncThunkAction() { | |
| 4081 | + var asyncThunks = []; | |
| 4082 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4083 | + asyncThunks[_i] = arguments[_i]; | |
| 4084 | + } | |
| 4085 | + if (asyncThunks.length === 0) { | |
| 4086 | + return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); }; | |
| 4087 | + } | |
| 4088 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 4089 | + return isAsyncThunkAction()(asyncThunks[0]); | |
| 4090 | + } | |
| 4091 | + return function (action) { | |
| 4092 | + var matchers = []; | |
| 4093 | + for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) { | |
| 4094 | + var asyncThunk = asyncThunks_1[_i]; | |
| 4095 | + matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled); | |
| 4096 | + } | |
| 4097 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 4098 | + return combinedMatcher(action); | |
| 4099 | + }; | |
| 4100 | +} | |
| 4101 | +// src/listenerMiddleware/utils.ts | |
| 4102 | +var assertFunction = function (func, expected) { | |
| 4103 | + if (typeof func !== "function") { | |
| 4104 | + throw new TypeError(expected + " is not a function"); | |
| 4105 | + } | |
| 4106 | +}; | |
| 4107 | +var noop = function () { | |
| 4108 | +}; | |
| 4109 | +var catchRejection = function (promise2, onError) { | |
| 4110 | + if (onError === void 0) { onError = noop; } | |
| 4111 | + promise2.catch(onError); | |
| 4112 | + return promise2; | |
| 4113 | +}; | |
| 4114 | +var addAbortSignalListener = function (abortSignal, callback) { | |
| 4115 | + abortSignal.addEventListener("abort", callback, { once: true }); | |
| 4116 | + return function () { return abortSignal.removeEventListener("abort", callback); }; | |
| 4117 | +}; | |
| 4118 | +var abortControllerWithReason = function (abortController, reason) { | |
| 4119 | + var signal = abortController.signal; | |
| 4120 | + if (signal.aborted) { | |
| 4121 | + return; | |
| 4122 | + } | |
| 4123 | + if (!("reason" in signal)) { | |
| 4124 | + Object.defineProperty(signal, "reason", { | |
| 4125 | + enumerable: true, | |
| 4126 | + value: reason, | |
| 4127 | + configurable: true, | |
| 4128 | + writable: true | |
| 4129 | + }); | |
| 4130 | + } | |
| 4131 | + ; | |
| 4132 | + abortController.abort(reason); | |
| 4133 | +}; | |
| 4134 | +// src/listenerMiddleware/exceptions.ts | |
| 4135 | +var task = "task"; | |
| 4136 | +var listener = "listener"; | |
| 4137 | +var completed = "completed"; | |
| 4138 | +var cancelled = "cancelled"; | |
| 4139 | +var taskCancelled = "task-" + cancelled; | |
| 4140 | +var taskCompleted = "task-" + completed; | |
| 4141 | +var listenerCancelled = listener + "-" + cancelled; | |
| 4142 | +var listenerCompleted = listener + "-" + completed; | |
| 4143 | +var TaskAbortError = /** @class */ (function () { | |
| 4144 | + function TaskAbortError(code) { | |
| 4145 | + this.code = code; | |
| 4146 | + this.name = "TaskAbortError"; | |
| 4147 | + this.message = task + " " + cancelled + " (reason: " + code + ")"; | |
| 4148 | + } | |
| 4149 | + return TaskAbortError; | |
| 4150 | +}()); | |
| 4151 | +// src/listenerMiddleware/task.ts | |
| 4152 | +var validateActive = function (signal) { | |
| 4153 | + if (signal.aborted) { | |
| 4154 | + throw new TaskAbortError(signal.reason); | |
| 4155 | + } | |
| 4156 | +}; | |
| 4157 | +function raceWithSignal(signal, promise2) { | |
| 4158 | + var cleanup = noop; | |
| 4159 | + return new Promise(function (resolve, reject) { | |
| 4160 | + var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); }; | |
| 4161 | + if (signal.aborted) { | |
| 4162 | + notifyRejection(); | |
| 4163 | + return; | |
| 4164 | + } | |
| 4165 | + cleanup = addAbortSignalListener(signal, notifyRejection); | |
| 4166 | + promise2.finally(function () { return cleanup(); }).then(resolve, reject); | |
| 4167 | + }).finally(function () { | |
| 4168 | + cleanup = noop; | |
| 4169 | + }); | |
| 4170 | +} | |
| 4171 | +var runTask = function (task2, cleanUp) { return __async(void 0, null, function () { | |
| 4172 | + var value, error_1; | |
| 4173 | + return __generator(this, function (_c) { | |
| 4174 | + switch (_c.label) { | |
| 4175 | + case 0: | |
| 4176 | + _c.trys.push([0, 3, 4, 5]); | |
| 4177 | + return [4 /*yield*/, Promise.resolve()]; | |
| 4178 | + case 1: | |
| 4179 | + _c.sent(); | |
| 4180 | + return [4 /*yield*/, task2()]; | |
| 4181 | + case 2: | |
| 4182 | + value = _c.sent(); | |
| 4183 | + return [2 /*return*/, { | |
| 4184 | + status: "ok", | |
| 4185 | + value: value | |
| 4186 | + }]; | |
| 4187 | + case 3: | |
| 4188 | + error_1 = _c.sent(); | |
| 4189 | + return [2 /*return*/, { | |
| 4190 | + status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected", | |
| 4191 | + error: error_1 | |
| 4192 | + }]; | |
| 4193 | + case 4: | |
| 4194 | + cleanUp == null ? void 0 : cleanUp(); | |
| 4195 | + return [7 /*endfinally*/]; | |
| 4196 | + case 5: return [2 /*return*/]; | |
| 4197 | + } | |
| 4198 | + }); | |
| 4199 | +}); }; | |
| 4200 | +var createPause = function (signal) { | |
| 4201 | + return function (promise2) { | |
| 4202 | + return catchRejection(raceWithSignal(signal, promise2).then(function (output) { | |
| 4203 | + validateActive(signal); | |
| 4204 | + return output; | |
| 4205 | + })); | |
| 4206 | + }; | |
| 4207 | +}; | |
| 4208 | +var createDelay = function (signal) { | |
| 4209 | + var pause = createPause(signal); | |
| 4210 | + return function (timeoutMs) { | |
| 4211 | + return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); })); | |
| 4212 | + }; | |
| 4213 | +}; | |
| 4214 | +// src/listenerMiddleware/index.ts | |
| 4215 | +var assign = Object.assign; | |
| 4216 | +var INTERNAL_NIL_TOKEN = {}; | |
| 4217 | +var alm = "listenerMiddleware"; | |
| 4218 | +var createFork = function (parentAbortSignal, parentBlockingPromises) { | |
| 4219 | + var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); }; | |
| 4220 | + return function (taskExecutor, opts) { | |
| 4221 | + assertFunction(taskExecutor, "taskExecutor"); | |
| 4222 | + var childAbortController = new AbortController(); | |
| 4223 | + linkControllers(childAbortController); | |
| 4224 | + var result = runTask(function () { return __async(void 0, null, function () { | |
| 4225 | + var result2; | |
| 4226 | + return __generator(this, function (_c) { | |
| 4227 | + switch (_c.label) { | |
| 4228 | + case 0: | |
| 4229 | + validateActive(parentAbortSignal); | |
| 4230 | + validateActive(childAbortController.signal); | |
| 4231 | + return [4 /*yield*/, taskExecutor({ | |
| 4232 | + pause: createPause(childAbortController.signal), | |
| 4233 | + delay: createDelay(childAbortController.signal), | |
| 4234 | + signal: childAbortController.signal | |
| 4235 | + })]; | |
| 4236 | + case 1: | |
| 4237 | + result2 = _c.sent(); | |
| 4238 | + validateActive(childAbortController.signal); | |
| 4239 | + return [2 /*return*/, result2]; | |
| 4240 | + } | |
| 4241 | + }); | |
| 4242 | + }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); }); | |
| 4243 | + if (opts == null ? void 0 : opts.autoJoin) { | |
| 4244 | + parentBlockingPromises.push(result); | |
| 4245 | + } | |
| 4246 | + return { | |
| 4247 | + result: createPause(parentAbortSignal)(result), | |
| 4248 | + cancel: function () { | |
| 4249 | + abortControllerWithReason(childAbortController, taskCancelled); | |
| 4250 | + } | |
| 4251 | + }; | |
| 4252 | + }; | |
| 4253 | +}; | |
| 4254 | +var createTakePattern = function (startListening, signal) { | |
| 4255 | + var take = function (predicate, timeout) { return __async(void 0, null, function () { | |
| 4256 | + var unsubscribe, tuplePromise, promises, output; | |
| 4257 | + return __generator(this, function (_c) { | |
| 4258 | + switch (_c.label) { | |
| 4259 | + case 0: | |
| 4260 | + validateActive(signal); | |
| 4261 | + unsubscribe = function () { | |
| 4262 | + }; | |
| 4263 | + tuplePromise = new Promise(function (resolve, reject) { | |
| 4264 | + var stopListening = startListening({ | |
| 4265 | + predicate: predicate, | |
| 4266 | + effect: function (action, listenerApi) { | |
| 4267 | + listenerApi.unsubscribe(); | |
| 4268 | + resolve([ | |
| 4269 | + action, | |
| 4270 | + listenerApi.getState(), | |
| 4271 | + listenerApi.getOriginalState() | |
| 4272 | + ]); | |
| 4273 | + } | |
| 4274 | + }); | |
| 4275 | + unsubscribe = function () { | |
| 4276 | + stopListening(); | |
| 4277 | + reject(); | |
| 4278 | + }; | |
| 4279 | + }); | |
| 4280 | + promises = [ | |
| 4281 | + tuplePromise | |
| 4282 | + ]; | |
| 4283 | + if (timeout != null) { | |
| 4284 | + promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); })); | |
| 4285 | + } | |
| 4286 | + _c.label = 1; | |
| 4287 | + case 1: | |
| 4288 | + _c.trys.push([1, , 3, 4]); | |
| 4289 | + return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))]; | |
| 4290 | + case 2: | |
| 4291 | + output = _c.sent(); | |
| 4292 | + validateActive(signal); | |
| 4293 | + return [2 /*return*/, output]; | |
| 4294 | + case 3: | |
| 4295 | + unsubscribe(); | |
| 4296 | + return [7 /*endfinally*/]; | |
| 4297 | + case 4: return [2 /*return*/]; | |
| 4298 | + } | |
| 4299 | + }); | |
| 4300 | + }); }; | |
| 4301 | + return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); }; | |
| 4302 | +}; | |
| 4303 | +var getListenerEntryPropsFrom = function (options) { | |
| 4304 | + var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect; | |
| 4305 | + if (type) { | |
| 4306 | + predicate = createAction(type).match; | |
| 4307 | + } | |
| 4308 | + else if (actionCreator) { | |
| 4309 | + type = actionCreator.type; | |
| 4310 | + predicate = actionCreator.match; | |
| 4311 | + } | |
| 4312 | + else if (matcher) { | |
| 4313 | + predicate = matcher; | |
| 4314 | + } | |
| 4315 | + else if (predicate) { | |
| 4316 | + } | |
| 4317 | + else { | |
| 4318 | + throw new Error("Creating or removing a listener requires one of the known fields for matching an action"); | |
| 4319 | + } | |
| 4320 | + assertFunction(effect, "options.listener"); | |
| 4321 | + return { predicate: predicate, type: type, effect: effect }; | |
| 4322 | +}; | |
| 4323 | +var createListenerEntry = function (options) { | |
| 4324 | + var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect; | |
| 4325 | + var id = nanoid(); | |
| 4326 | + var entry = { | |
| 4327 | + id: id, | |
| 4328 | + effect: effect, | |
| 4329 | + type: type, | |
| 4330 | + predicate: predicate, | |
| 4331 | + pending: new Set(), | |
| 4332 | + unsubscribe: function () { | |
| 4333 | + throw new Error("Unsubscribe not initialized"); | |
| 4334 | + } | |
| 4335 | + }; | |
| 4336 | + return entry; | |
| 4337 | +}; | |
| 4338 | +var cancelActiveListeners = function (entry) { | |
| 4339 | + entry.pending.forEach(function (controller) { | |
| 4340 | + abortControllerWithReason(controller, listenerCancelled); | |
| 4341 | + }); | |
| 4342 | +}; | |
| 4343 | +var createClearListenerMiddleware = function (listenerMap) { | |
| 4344 | + return function () { | |
| 4345 | + listenerMap.forEach(cancelActiveListeners); | |
| 4346 | + listenerMap.clear(); | |
| 4347 | + }; | |
| 4348 | +}; | |
| 4349 | +var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) { | |
| 4350 | + try { | |
| 4351 | + errorHandler(errorToNotify, errorInfo); | |
| 4352 | + } | |
| 4353 | + catch (errorHandlerError) { | |
| 4354 | + setTimeout(function () { | |
| 4355 | + throw errorHandlerError; | |
| 4356 | + }, 0); | |
| 4357 | + } | |
| 4358 | +}; | |
| 4359 | +var addListener = createAction(alm + "/add"); | |
| 4360 | +var clearAllListeners = createAction(alm + "/removeAll"); | |
| 4361 | +var removeListener = createAction(alm + "/remove"); | |
| 4362 | +var defaultErrorHandler = function () { | |
| 4363 | + var args = []; | |
| 4364 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4365 | + args[_i] = arguments[_i]; | |
| 4366 | + } | |
| 4367 | + console.error.apply(console, __spreadArray([alm + "/error"], args)); | |
| 4368 | +}; | |
| 4369 | +function createListenerMiddleware(middlewareOptions) { | |
| 4370 | + var _this = this; | |
| 4371 | + if (middlewareOptions === void 0) { middlewareOptions = {}; } | |
| 4372 | + var listenerMap = new Map(); | |
| 4373 | + var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c; | |
| 4374 | + assertFunction(onError, "onError"); | |
| 4375 | + var insertEntry = function (entry) { | |
| 4376 | + entry.unsubscribe = function () { return listenerMap.delete(entry.id); }; | |
| 4377 | + listenerMap.set(entry.id, entry); | |
| 4378 | + return function (cancelOptions) { | |
| 4379 | + entry.unsubscribe(); | |
| 4380 | + if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) { | |
| 4381 | + cancelActiveListeners(entry); | |
| 4382 | + } | |
| 4383 | + }; | |
| 4384 | + }; | |
| 4385 | + var findListenerEntry = function (comparator) { | |
| 4386 | + for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) { | |
| 4387 | + var entry = _c[_i]; | |
| 4388 | + if (comparator(entry)) { | |
| 4389 | + return entry; | |
| 4390 | + } | |
| 4391 | + } | |
| 4392 | + return void 0; | |
| 4393 | + }; | |
| 4394 | + var startListening = function (options) { | |
| 4395 | + var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; }); | |
| 4396 | + if (!entry) { | |
| 4397 | + entry = createListenerEntry(options); | |
| 4398 | + } | |
| 4399 | + return insertEntry(entry); | |
| 4400 | + }; | |
| 4401 | + var stopListening = function (options) { | |
| 4402 | + var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate; | |
| 4403 | + var entry = findListenerEntry(function (entry2) { | |
| 4404 | + var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate; | |
| 4405 | + return matchPredicateOrType && entry2.effect === effect; | |
| 4406 | + }); | |
| 4407 | + if (entry) { | |
| 4408 | + entry.unsubscribe(); | |
| 4409 | + if (options.cancelActive) { | |
| 4410 | + cancelActiveListeners(entry); | |
| 4411 | + } | |
| 4412 | + } | |
| 4413 | + return !!entry; | |
| 4414 | + }; | |
| 4415 | + var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () { | |
| 4416 | + var internalTaskController, take, autoJoinPromises, listenerError_1; | |
| 4417 | + return __generator(this, function (_c) { | |
| 4418 | + switch (_c.label) { | |
| 4419 | + case 0: | |
| 4420 | + internalTaskController = new AbortController(); | |
| 4421 | + take = createTakePattern(startListening, internalTaskController.signal); | |
| 4422 | + autoJoinPromises = []; | |
| 4423 | + _c.label = 1; | |
| 4424 | + case 1: | |
| 4425 | + _c.trys.push([1, 3, 4, 6]); | |
| 4426 | + entry.pending.add(internalTaskController); | |
| 4427 | + return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, { | |
| 4428 | + getOriginalState: getOriginalState, | |
| 4429 | + condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); }, | |
| 4430 | + take: take, | |
| 4431 | + delay: createDelay(internalTaskController.signal), | |
| 4432 | + pause: createPause(internalTaskController.signal), | |
| 4433 | + extra: extra, | |
| 4434 | + signal: internalTaskController.signal, | |
| 4435 | + fork: createFork(internalTaskController.signal, autoJoinPromises), | |
| 4436 | + unsubscribe: entry.unsubscribe, | |
| 4437 | + subscribe: function () { | |
| 4438 | + listenerMap.set(entry.id, entry); | |
| 4439 | + }, | |
| 4440 | + cancelActiveListeners: function () { | |
| 4441 | + entry.pending.forEach(function (controller, _, set) { | |
| 4442 | + if (controller !== internalTaskController) { | |
| 4443 | + abortControllerWithReason(controller, listenerCancelled); | |
| 4444 | + set.delete(controller); | |
| 4445 | + } | |
| 4446 | + }); | |
| 4447 | + } | |
| 4448 | + })))]; | |
| 4449 | + case 2: | |
| 4450 | + _c.sent(); | |
| 4451 | + return [3 /*break*/, 6]; | |
| 4452 | + case 3: | |
| 4453 | + listenerError_1 = _c.sent(); | |
| 4454 | + if (!(listenerError_1 instanceof TaskAbortError)) { | |
| 4455 | + safelyNotifyError(onError, listenerError_1, { | |
| 4456 | + raisedBy: "effect" | |
| 4457 | + }); | |
| 4458 | + } | |
| 4459 | + return [3 /*break*/, 6]; | |
| 4460 | + case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)]; | |
| 4461 | + case 5: | |
| 4462 | + _c.sent(); | |
| 4463 | + abortControllerWithReason(internalTaskController, listenerCompleted); | |
| 4464 | + entry.pending.delete(internalTaskController); | |
| 4465 | + return [7 /*endfinally*/]; | |
| 4466 | + case 6: return [2 /*return*/]; | |
| 4467 | + } | |
| 4468 | + }); | |
| 4469 | + }); }; | |
| 4470 | + var clearListenerMiddleware = createClearListenerMiddleware(listenerMap); | |
| 4471 | + var middleware = function (api) { return function (next) { return function (action) { | |
| 4472 | + if (!isAction(action)) { | |
| 4473 | + return next(action); | |
| 4474 | + } | |
| 4475 | + if (addListener.match(action)) { | |
| 4476 | + return startListening(action.payload); | |
| 4477 | + } | |
| 4478 | + if (clearAllListeners.match(action)) { | |
| 4479 | + clearListenerMiddleware(); | |
| 4480 | + return; | |
| 4481 | + } | |
| 4482 | + if (removeListener.match(action)) { | |
| 4483 | + return stopListening(action.payload); | |
| 4484 | + } | |
| 4485 | + var originalState = api.getState(); | |
| 4486 | + var getOriginalState = function () { | |
| 4487 | + if (originalState === INTERNAL_NIL_TOKEN) { | |
| 4488 | + throw new Error(alm + ": getOriginalState can only be called synchronously"); | |
| 4489 | + } | |
| 4490 | + return originalState; | |
| 4491 | + }; | |
| 4492 | + var result; | |
| 4493 | + try { | |
| 4494 | + result = next(action); | |
| 4495 | + if (listenerMap.size > 0) { | |
| 4496 | + var currentState = api.getState(); | |
| 4497 | + var listenerEntries = Array.from(listenerMap.values()); | |
| 4498 | + for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) { | |
| 4499 | + var entry = listenerEntries_1[_i]; | |
| 4500 | + var runListener = false; | |
| 4501 | + try { | |
| 4502 | + runListener = entry.predicate(action, currentState, originalState); | |
| 4503 | + } | |
| 4504 | + catch (predicateError) { | |
| 4505 | + runListener = false; | |
| 4506 | + safelyNotifyError(onError, predicateError, { | |
| 4507 | + raisedBy: "predicate" | |
| 4508 | + }); | |
| 4509 | + } | |
| 4510 | + if (!runListener) { | |
| 4511 | + continue; | |
| 4512 | + } | |
| 4513 | + notifyListener(entry, action, api, getOriginalState); | |
| 4514 | + } | |
| 4515 | + } | |
| 4516 | + } | |
| 4517 | + finally { | |
| 4518 | + originalState = INTERNAL_NIL_TOKEN; | |
| 4519 | + } | |
| 4520 | + return result; | |
| 4521 | + }; }; }; | |
| 4522 | + return { | |
| 4523 | + middleware: middleware, | |
| 4524 | + startListening: startListening, | |
| 4525 | + stopListening: stopListening, | |
| 4526 | + clearListeners: clearListenerMiddleware | |
| 4527 | + }; | |
| 4528 | +} | |
| 4529 | +// src/autoBatchEnhancer.ts | |
| 4530 | +var SHOULD_AUTOBATCH = "RTK_autoBatch"; | |
| 4531 | +var prepareAutoBatched = function () { return function (payload) { | |
| 4532 | + var _c; | |
| 4533 | + return ({ | |
| 4534 | + payload: payload, | |
| 4535 | + meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c) | |
| 4536 | + }); | |
| 4537 | +}; }; | |
| 4538 | +var promise; | |
| 4539 | +var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () { | |
| 4540 | + throw err; | |
| 4541 | +}, 0); }); }; | |
| 4542 | +var createQueueWithTimer = function (timeout) { | |
| 4543 | + return function (notify) { | |
| 4544 | + setTimeout(notify, timeout); | |
| 4545 | + }; | |
| 4546 | +}; | |
| 4547 | +var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10); | |
| 4548 | +var autoBatchEnhancer = function (options) { | |
| 4549 | + if (options === void 0) { options = { type: "raf" }; } | |
| 4550 | + return function (next) { return function () { | |
| 4551 | + var args = []; | |
| 4552 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4553 | + args[_i] = arguments[_i]; | |
| 4554 | + } | |
| 4555 | + var store = next.apply(void 0, args); | |
| 4556 | + var notifying = true; | |
| 4557 | + var shouldNotifyAtEndOfTick = false; | |
| 4558 | + var notificationQueued = false; | |
| 4559 | + var listeners = new Set(); | |
| 4560 | + var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout); | |
| 4561 | + var notifyListeners = function () { | |
| 4562 | + notificationQueued = false; | |
| 4563 | + if (shouldNotifyAtEndOfTick) { | |
| 4564 | + shouldNotifyAtEndOfTick = false; | |
| 4565 | + listeners.forEach(function (l) { return l(); }); | |
| 4566 | + } | |
| 4567 | + }; | |
| 4568 | + return Object.assign({}, store, { | |
| 4569 | + subscribe: function (listener2) { | |
| 4570 | + var wrappedListener = function () { return notifying && listener2(); }; | |
| 4571 | + var unsubscribe = store.subscribe(wrappedListener); | |
| 4572 | + listeners.add(listener2); | |
| 4573 | + return function () { | |
| 4574 | + unsubscribe(); | |
| 4575 | + listeners.delete(listener2); | |
| 4576 | + }; | |
| 4577 | + }, | |
| 4578 | + dispatch: function (action) { | |
| 4579 | + var _a; | |
| 4580 | + try { | |
| 4581 | + notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]); | |
| 4582 | + shouldNotifyAtEndOfTick = !notifying; | |
| 4583 | + if (shouldNotifyAtEndOfTick) { | |
| 4584 | + if (!notificationQueued) { | |
| 4585 | + notificationQueued = true; | |
| 4586 | + queueCallback(notifyListeners); | |
| 4587 | + } | |
| 4588 | + } | |
| 4589 | + return store.dispatch(action); | |
| 4590 | + } | |
| 4591 | + finally { | |
| 4592 | + notifying = true; | |
| 4593 | + } | |
| 4594 | + } | |
| 4595 | + }); | |
| 4596 | + }; }; | |
| 4597 | +}; | |
| 4598 | +// src/index.ts | |
| 4599 | +(0,immer__WEBPACK_IMPORTED_MODULE_0__.enableES5)(); | |
| 4600 | + | |
| 4601 | +//# sourceMappingURL=redux-toolkit.esm.js.map | |
| 4602 | + | |
| 4603 | +/***/ }), | |
| 4604 | + | |
| 4605 | +/***/ "../node_modules/immer/dist/immer.esm.mjs": | |
| 2384 | 4606 | /*!************************************************!*\ |
| 2385 | - !*** external "elementorVendors.reduxToolkit" ***! | |
| 4607 | + !*** ../node_modules/immer/dist/immer.esm.mjs ***! | |
| 2386 | 4608 | \************************************************/ |
| 2387 | -/***/ ((module) => { | |
| 4609 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 2388 | 4610 | |
| 2389 | 4611 | "use strict"; |
| 2390 | -module.exports = elementorVendors.reduxToolkit; | |
| 4612 | +__webpack_require__.r(__webpack_exports__); | |
| 4613 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4614 | +/* harmony export */ Immer: () => (/* binding */ un), | |
| 4615 | +/* harmony export */ applyPatches: () => (/* binding */ pn), | |
| 4616 | +/* harmony export */ castDraft: () => (/* binding */ K), | |
| 4617 | +/* harmony export */ castImmutable: () => (/* binding */ $), | |
| 4618 | +/* harmony export */ createDraft: () => (/* binding */ ln), | |
| 4619 | +/* harmony export */ current: () => (/* binding */ R), | |
| 4620 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), | |
| 4621 | +/* harmony export */ enableAllPlugins: () => (/* binding */ J), | |
| 4622 | +/* harmony export */ enableES5: () => (/* binding */ F), | |
| 4623 | +/* harmony export */ enableMapSet: () => (/* binding */ C), | |
| 4624 | +/* harmony export */ enablePatches: () => (/* binding */ T), | |
| 4625 | +/* harmony export */ finishDraft: () => (/* binding */ dn), | |
| 4626 | +/* harmony export */ freeze: () => (/* binding */ d), | |
| 4627 | +/* harmony export */ immerable: () => (/* binding */ L), | |
| 4628 | +/* harmony export */ isDraft: () => (/* binding */ r), | |
| 4629 | +/* harmony export */ isDraftable: () => (/* binding */ t), | |
| 4630 | +/* harmony export */ nothing: () => (/* binding */ H), | |
| 4631 | +/* harmony export */ original: () => (/* binding */ e), | |
| 4632 | +/* harmony export */ produce: () => (/* binding */ fn), | |
| 4633 | +/* harmony export */ produceWithPatches: () => (/* binding */ cn), | |
| 4634 | +/* harmony export */ setAutoFreeze: () => (/* binding */ sn), | |
| 4635 | +/* harmony export */ setUseProxies: () => (/* binding */ vn) | |
| 4636 | +/* harmony export */ }); | |
| 4637 | +function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if(true){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}// removed by dead control flow | |
| 4638 | +}function r(n){return!!n&&!!n[Q]}function t(n){var r;return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return false||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if( true&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return true&&f(r),en.get(r,n)},set:function(r){var t=this[Q]; true&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return true&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return true&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q]; true&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (fn); | |
| 4639 | +//# sourceMappingURL=immer.esm.js.map | |
| 2391 | 4640 | |
| 4641 | + | |
| 4642 | +/***/ }), | |
| 4643 | + | |
| 4644 | +/***/ "../node_modules/redux-thunk/es/index.js": | |
| 4645 | +/*!***********************************************!*\ | |
| 4646 | + !*** ../node_modules/redux-thunk/es/index.js ***! | |
| 4647 | + \***********************************************/ | |
| 4648 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 4649 | + | |
| 4650 | +"use strict"; | |
| 4651 | +__webpack_require__.r(__webpack_exports__); | |
| 4652 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4653 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) | |
| 4654 | +/* harmony export */ }); | |
| 4655 | +/** A function that accepts a potential "extra argument" value to be injected later, | |
| 4656 | + * and returns an instance of the thunk middleware that uses that value | |
| 4657 | + */ | |
| 4658 | +function createThunkMiddleware(extraArgument) { | |
| 4659 | + // Standard Redux middleware definition pattern: | |
| 4660 | + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware | |
| 4661 | + var middleware = function middleware(_ref) { | |
| 4662 | + var dispatch = _ref.dispatch, | |
| 4663 | + getState = _ref.getState; | |
| 4664 | + return function (next) { | |
| 4665 | + return function (action) { | |
| 4666 | + // The thunk middleware looks for any functions that were passed to `store.dispatch`. | |
| 4667 | + // If this "action" is really a function, call it and return the result. | |
| 4668 | + if (typeof action === 'function') { | |
| 4669 | + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg" | |
| 4670 | + return action(dispatch, getState, extraArgument); | |
| 4671 | + } // Otherwise, pass the action down the middleware chain as usual | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + return next(action); | |
| 4675 | + }; | |
| 4676 | + }; | |
| 4677 | + }; | |
| 4678 | + | |
| 4679 | + return middleware; | |
| 4680 | +} | |
| 4681 | + | |
| 4682 | +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version | |
| 4683 | +// with whatever "extra arg" they want to inject into their thunks | |
| 4684 | + | |
| 4685 | +thunk.withExtraArgument = createThunkMiddleware; | |
| 4686 | +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk); | |
| 4687 | + | |
| 4688 | +/***/ }), | |
| 4689 | + | |
| 4690 | +/***/ "../node_modules/redux/es/redux.js": | |
| 4691 | +/*!*****************************************!*\ | |
| 4692 | + !*** ../node_modules/redux/es/redux.js ***! | |
| 4693 | + \*****************************************/ | |
| 4694 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 4695 | + | |
| 4696 | +"use strict"; | |
| 4697 | +__webpack_require__.r(__webpack_exports__); | |
| 4698 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4699 | +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* binding */ ActionTypes), | |
| 4700 | +/* harmony export */ applyMiddleware: () => (/* binding */ applyMiddleware), | |
| 4701 | +/* harmony export */ bindActionCreators: () => (/* binding */ bindActionCreators), | |
| 4702 | +/* harmony export */ combineReducers: () => (/* binding */ combineReducers), | |
| 4703 | +/* harmony export */ compose: () => (/* binding */ compose), | |
| 4704 | +/* harmony export */ createStore: () => (/* binding */ createStore), | |
| 4705 | +/* harmony export */ legacy_createStore: () => (/* binding */ legacy_createStore) | |
| 4706 | +/* harmony export */ }); | |
| 4707 | +/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js"); | |
| 4708 | + | |
| 4709 | + | |
| 4710 | +/** | |
| 4711 | + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js | |
| 4712 | + * | |
| 4713 | + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes | |
| 4714 | + * during build. | |
| 4715 | + * @param {number} code | |
| 4716 | + */ | |
| 4717 | +function formatProdErrorMessage(code) { | |
| 4718 | + return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. '; | |
| 4719 | +} | |
| 4720 | + | |
| 4721 | +// Inlined version of the `symbol-observable` polyfill | |
| 4722 | +var $$observable = (function () { | |
| 4723 | + return typeof Symbol === 'function' && Symbol.observable || '@@observable'; | |
| 4724 | +})(); | |
| 4725 | + | |
| 4726 | +/** | |
| 4727 | + * These are private action types reserved by Redux. | |
| 4728 | + * For any unknown actions, you must return the current state. | |
| 4729 | + * If the current state is undefined, you must return the initial state. | |
| 4730 | + * Do not reference these action types directly in your code. | |
| 4731 | + */ | |
| 4732 | +var randomString = function randomString() { | |
| 4733 | + return Math.random().toString(36).substring(7).split('').join('.'); | |
| 4734 | +}; | |
| 4735 | + | |
| 4736 | +var ActionTypes = { | |
| 4737 | + INIT: "@@redux/INIT" + randomString(), | |
| 4738 | + REPLACE: "@@redux/REPLACE" + randomString(), | |
| 4739 | + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { | |
| 4740 | + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); | |
| 4741 | + } | |
| 4742 | +}; | |
| 4743 | + | |
| 4744 | +/** | |
| 4745 | + * @param {any} obj The object to inspect. | |
| 4746 | + * @returns {boolean} True if the argument appears to be a plain object. | |
| 4747 | + */ | |
| 4748 | +function isPlainObject(obj) { | |
| 4749 | + if (typeof obj !== 'object' || obj === null) return false; | |
| 4750 | + var proto = obj; | |
| 4751 | + | |
| 4752 | + while (Object.getPrototypeOf(proto) !== null) { | |
| 4753 | + proto = Object.getPrototypeOf(proto); | |
| 4754 | + } | |
| 4755 | + | |
| 4756 | + return Object.getPrototypeOf(obj) === proto; | |
| 4757 | +} | |
| 4758 | + | |
| 4759 | +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of | |
| 4760 | +function miniKindOf(val) { | |
| 4761 | + if (val === void 0) return 'undefined'; | |
| 4762 | + if (val === null) return 'null'; | |
| 4763 | + var type = typeof val; | |
| 4764 | + | |
| 4765 | + switch (type) { | |
| 4766 | + case 'boolean': | |
| 4767 | + case 'string': | |
| 4768 | + case 'number': | |
| 4769 | + case 'symbol': | |
| 4770 | + case 'function': | |
| 4771 | + { | |
| 4772 | + return type; | |
| 4773 | + } | |
| 4774 | + } | |
| 4775 | + | |
| 4776 | + if (Array.isArray(val)) return 'array'; | |
| 4777 | + if (isDate(val)) return 'date'; | |
| 4778 | + if (isError(val)) return 'error'; | |
| 4779 | + var constructorName = ctorName(val); | |
| 4780 | + | |
| 4781 | + switch (constructorName) { | |
| 4782 | + case 'Symbol': | |
| 4783 | + case 'Promise': | |
| 4784 | + case 'WeakMap': | |
| 4785 | + case 'WeakSet': | |
| 4786 | + case 'Map': | |
| 4787 | + case 'Set': | |
| 4788 | + return constructorName; | |
| 4789 | + } // other | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); | |
| 4793 | +} | |
| 4794 | + | |
| 4795 | +function ctorName(val) { | |
| 4796 | + return typeof val.constructor === 'function' ? val.constructor.name : null; | |
| 4797 | +} | |
| 4798 | + | |
| 4799 | +function isError(val) { | |
| 4800 | + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'; | |
| 4801 | +} | |
| 4802 | + | |
| 4803 | +function isDate(val) { | |
| 4804 | + if (val instanceof Date) return true; | |
| 4805 | + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; | |
| 4806 | +} | |
| 4807 | + | |
| 4808 | +function kindOf(val) { | |
| 4809 | + var typeOfVal = typeof val; | |
| 4810 | + | |
| 4811 | + if (true) { | |
| 4812 | + typeOfVal = miniKindOf(val); | |
| 4813 | + } | |
| 4814 | + | |
| 4815 | + return typeOfVal; | |
| 4816 | +} | |
| 4817 | + | |
| 4818 | +/** | |
| 4819 | + * @deprecated | |
| 4820 | + * | |
| 4821 | + * **We recommend using the `configureStore` method | |
| 4822 | + * of the `@reduxjs/toolkit` package**, which replaces `createStore`. | |
| 4823 | + * | |
| 4824 | + * Redux Toolkit is our recommended approach for writing Redux logic today, | |
| 4825 | + * including store setup, reducers, data fetching, and more. | |
| 4826 | + * | |
| 4827 | + * **For more details, please read this Redux docs page:** | |
| 4828 | + * **https://redux.js.org/introduction/why-rtk-is-redux-today** | |
| 4829 | + * | |
| 4830 | + * `configureStore` from Redux Toolkit is an improved version of `createStore` that | |
| 4831 | + * simplifies setup and helps avoid common bugs. | |
| 4832 | + * | |
| 4833 | + * You should not be using the `redux` core package by itself today, except for learning purposes. | |
| 4834 | + * The `createStore` method from the core `redux` package will not be removed, but we encourage | |
| 4835 | + * all users to migrate to using Redux Toolkit for all Redux code. | |
| 4836 | + * | |
| 4837 | + * If you want to use `createStore` without this visual deprecation warning, use | |
| 4838 | + * the `legacy_createStore` import instead: | |
| 4839 | + * | |
| 4840 | + * `import { legacy_createStore as createStore} from 'redux'` | |
| 4841 | + * | |
| 4842 | + */ | |
| 4843 | + | |
| 4844 | +function createStore(reducer, preloadedState, enhancer) { | |
| 4845 | + var _ref2; | |
| 4846 | + | |
| 4847 | + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { | |
| 4848 | + throw new Error( false ? 0 : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.'); | |
| 4849 | + } | |
| 4850 | + | |
| 4851 | + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { | |
| 4852 | + enhancer = preloadedState; | |
| 4853 | + preloadedState = undefined; | |
| 4854 | + } | |
| 4855 | + | |
| 4856 | + if (typeof enhancer !== 'undefined') { | |
| 4857 | + if (typeof enhancer !== 'function') { | |
| 4858 | + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'"); | |
| 4859 | + } | |
| 4860 | + | |
| 4861 | + return enhancer(createStore)(reducer, preloadedState); | |
| 4862 | + } | |
| 4863 | + | |
| 4864 | + if (typeof reducer !== 'function') { | |
| 4865 | + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'"); | |
| 4866 | + } | |
| 4867 | + | |
| 4868 | + var currentReducer = reducer; | |
| 4869 | + var currentState = preloadedState; | |
| 4870 | + var currentListeners = []; | |
| 4871 | + var nextListeners = currentListeners; | |
| 4872 | + var isDispatching = false; | |
| 4873 | + /** | |
| 4874 | + * This makes a shallow copy of currentListeners so we can use | |
| 4875 | + * nextListeners as a temporary list while dispatching. | |
| 4876 | + * | |
| 4877 | + * This prevents any bugs around consumers calling | |
| 4878 | + * subscribe/unsubscribe in the middle of a dispatch. | |
| 4879 | + */ | |
| 4880 | + | |
| 4881 | + function ensureCanMutateNextListeners() { | |
| 4882 | + if (nextListeners === currentListeners) { | |
| 4883 | + nextListeners = currentListeners.slice(); | |
| 4884 | + } | |
| 4885 | + } | |
| 4886 | + /** | |
| 4887 | + * Reads the state tree managed by the store. | |
| 4888 | + * | |
| 4889 | + * @returns {any} The current state tree of your application. | |
| 4890 | + */ | |
| 4891 | + | |
| 4892 | + | |
| 4893 | + function getState() { | |
| 4894 | + if (isDispatching) { | |
| 4895 | + throw new Error( false ? 0 : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.'); | |
| 4896 | + } | |
| 4897 | + | |
| 4898 | + return currentState; | |
| 4899 | + } | |
| 4900 | + /** | |
| 4901 | + * Adds a change listener. It will be called any time an action is dispatched, | |
| 4902 | + * and some part of the state tree may potentially have changed. You may then | |
| 4903 | + * call `getState()` to read the current state tree inside the callback. | |
| 4904 | + * | |
| 4905 | + * You may call `dispatch()` from a change listener, with the following | |
| 4906 | + * caveats: | |
| 4907 | + * | |
| 4908 | + * 1. The subscriptions are snapshotted just before every `dispatch()` call. | |
| 4909 | + * If you subscribe or unsubscribe while the listeners are being invoked, this | |
| 4910 | + * will not have any effect on the `dispatch()` that is currently in progress. | |
| 4911 | + * However, the next `dispatch()` call, whether nested or not, will use a more | |
| 4912 | + * recent snapshot of the subscription list. | |
| 4913 | + * | |
| 4914 | + * 2. The listener should not expect to see all state changes, as the state | |
| 4915 | + * might have been updated multiple times during a nested `dispatch()` before | |
| 4916 | + * the listener is called. It is, however, guaranteed that all subscribers | |
| 4917 | + * registered before the `dispatch()` started will be called with the latest | |
| 4918 | + * state by the time it exits. | |
| 4919 | + * | |
| 4920 | + * @param {Function} listener A callback to be invoked on every dispatch. | |
| 4921 | + * @returns {Function} A function to remove this change listener. | |
| 4922 | + */ | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + function subscribe(listener) { | |
| 4926 | + if (typeof listener !== 'function') { | |
| 4927 | + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'"); | |
| 4928 | + } | |
| 4929 | + | |
| 4930 | + if (isDispatching) { | |
| 4931 | + throw new Error( false ? 0 : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.'); | |
| 4932 | + } | |
| 4933 | + | |
| 4934 | + var isSubscribed = true; | |
| 4935 | + ensureCanMutateNextListeners(); | |
| 4936 | + nextListeners.push(listener); | |
| 4937 | + return function unsubscribe() { | |
| 4938 | + if (!isSubscribed) { | |
| 4939 | + return; | |
| 4940 | + } | |
| 4941 | + | |
| 4942 | + if (isDispatching) { | |
| 4943 | + throw new Error( false ? 0 : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.'); | |
| 4944 | + } | |
| 4945 | + | |
| 4946 | + isSubscribed = false; | |
| 4947 | + ensureCanMutateNextListeners(); | |
| 4948 | + var index = nextListeners.indexOf(listener); | |
| 4949 | + nextListeners.splice(index, 1); | |
| 4950 | + currentListeners = null; | |
| 4951 | + }; | |
| 4952 | + } | |
| 4953 | + /** | |
| 4954 | + * Dispatches an action. It is the only way to trigger a state change. | |
| 4955 | + * | |
| 4956 | + * The `reducer` function, used to create the store, will be called with the | |
| 4957 | + * current state tree and the given `action`. Its return value will | |
| 4958 | + * be considered the **next** state of the tree, and the change listeners | |
| 4959 | + * will be notified. | |
| 4960 | + * | |
| 4961 | + * The base implementation only supports plain object actions. If you want to | |
| 4962 | + * dispatch a Promise, an Observable, a thunk, or something else, you need to | |
| 4963 | + * wrap your store creating function into the corresponding middleware. For | |
| 4964 | + * example, see the documentation for the `redux-thunk` package. Even the | |
| 4965 | + * middleware will eventually dispatch plain object actions using this method. | |
| 4966 | + * | |
| 4967 | + * @param {Object} action A plain object representing “what changed”. It is | |
| 4968 | + * a good idea to keep actions serializable so you can record and replay user | |
| 4969 | + * sessions, or use the time travelling `redux-devtools`. An action must have | |
| 4970 | + * a `type` property which may not be `undefined`. It is a good idea to use | |
| 4971 | + * string constants for action types. | |
| 4972 | + * | |
| 4973 | + * @returns {Object} For convenience, the same action object you dispatched. | |
| 4974 | + * | |
| 4975 | + * Note that, if you use a custom middleware, it may wrap `dispatch()` to | |
| 4976 | + * return something else (for example, a Promise you can await). | |
| 4977 | + */ | |
| 4978 | + | |
| 4979 | + | |
| 4980 | + function dispatch(action) { | |
| 4981 | + if (!isPlainObject(action)) { | |
| 4982 | + throw new Error( false ? 0 : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples."); | |
| 4983 | + } | |
| 4984 | + | |
| 4985 | + if (typeof action.type === 'undefined') { | |
| 4986 | + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); | |
| 4987 | + } | |
| 4988 | + | |
| 4989 | + if (isDispatching) { | |
| 4990 | + throw new Error( false ? 0 : 'Reducers may not dispatch actions.'); | |
| 4991 | + } | |
| 4992 | + | |
| 4993 | + try { | |
| 4994 | + isDispatching = true; | |
| 4995 | + currentState = currentReducer(currentState, action); | |
| 4996 | + } finally { | |
| 4997 | + isDispatching = false; | |
| 4998 | + } | |
| 4999 | + | |
| 5000 | + var listeners = currentListeners = nextListeners; | |
| 5001 | + | |
| 5002 | + for (var i = 0; i < listeners.length; i++) { | |
| 5003 | + var listener = listeners[i]; | |
| 5004 | + listener(); | |
| 5005 | + } | |
| 5006 | + | |
| 5007 | + return action; | |
| 5008 | + } | |
| 5009 | + /** | |
| 5010 | + * Replaces the reducer currently used by the store to calculate the state. | |
| 5011 | + * | |
| 5012 | + * You might need this if your app implements code splitting and you want to | |
| 5013 | + * load some of the reducers dynamically. You might also need this if you | |
| 5014 | + * implement a hot reloading mechanism for Redux. | |
| 5015 | + * | |
| 5016 | + * @param {Function} nextReducer The reducer for the store to use instead. | |
| 5017 | + * @returns {void} | |
| 5018 | + */ | |
| 5019 | + | |
| 5020 | + | |
| 5021 | + function replaceReducer(nextReducer) { | |
| 5022 | + if (typeof nextReducer !== 'function') { | |
| 5023 | + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer)); | |
| 5024 | + } | |
| 5025 | + | |
| 5026 | + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT. | |
| 5027 | + // Any reducers that existed in both the new and old rootReducer | |
| 5028 | + // will receive the previous state. This effectively populates | |
| 5029 | + // the new state tree with any relevant data from the old one. | |
| 5030 | + | |
| 5031 | + dispatch({ | |
| 5032 | + type: ActionTypes.REPLACE | |
| 5033 | + }); | |
| 5034 | + } | |
| 5035 | + /** | |
| 5036 | + * Interoperability point for observable/reactive libraries. | |
| 5037 | + * @returns {observable} A minimal observable of state changes. | |
| 5038 | + * For more information, see the observable proposal: | |
| 5039 | + * https://github.com/tc39/proposal-observable | |
| 5040 | + */ | |
| 5041 | + | |
| 5042 | + | |
| 5043 | + function observable() { | |
| 5044 | + var _ref; | |
| 5045 | + | |
| 5046 | + var outerSubscribe = subscribe; | |
| 5047 | + return _ref = { | |
| 5048 | + /** | |
| 5049 | + * The minimal observable subscription method. | |
| 5050 | + * @param {Object} observer Any object that can be used as an observer. | |
| 5051 | + * The observer object should have a `next` method. | |
| 5052 | + * @returns {subscription} An object with an `unsubscribe` method that can | |
| 5053 | + * be used to unsubscribe the observable from the store, and prevent further | |
| 5054 | + * emission of values from the observable. | |
| 5055 | + */ | |
| 5056 | + subscribe: function subscribe(observer) { | |
| 5057 | + if (typeof observer !== 'object' || observer === null) { | |
| 5058 | + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'"); | |
| 5059 | + } | |
| 5060 | + | |
| 5061 | + function observeState() { | |
| 5062 | + if (observer.next) { | |
| 5063 | + observer.next(getState()); | |
| 5064 | + } | |
| 5065 | + } | |
| 5066 | + | |
| 5067 | + observeState(); | |
| 5068 | + var unsubscribe = outerSubscribe(observeState); | |
| 5069 | + return { | |
| 5070 | + unsubscribe: unsubscribe | |
| 5071 | + }; | |
| 5072 | + } | |
| 5073 | + }, _ref[$$observable] = function () { | |
| 5074 | + return this; | |
| 5075 | + }, _ref; | |
| 5076 | + } // When a store is created, an "INIT" action is dispatched so that every | |
| 5077 | + // reducer returns their initial state. This effectively populates | |
| 5078 | + // the initial state tree. | |
| 5079 | + | |
| 5080 | + | |
| 5081 | + dispatch({ | |
| 5082 | + type: ActionTypes.INIT | |
| 5083 | + }); | |
| 5084 | + return _ref2 = { | |
| 5085 | + dispatch: dispatch, | |
| 5086 | + subscribe: subscribe, | |
| 5087 | + getState: getState, | |
| 5088 | + replaceReducer: replaceReducer | |
| 5089 | + }, _ref2[$$observable] = observable, _ref2; | |
| 5090 | +} | |
| 5091 | +/** | |
| 5092 | + * Creates a Redux store that holds the state tree. | |
| 5093 | + * | |
| 5094 | + * **We recommend using `configureStore` from the | |
| 5095 | + * `@reduxjs/toolkit` package**, which replaces `createStore`: | |
| 5096 | + * **https://redux.js.org/introduction/why-rtk-is-redux-today** | |
| 5097 | + * | |
| 5098 | + * The only way to change the data in the store is to call `dispatch()` on it. | |
| 5099 | + * | |
| 5100 | + * There should only be a single store in your app. To specify how different | |
| 5101 | + * parts of the state tree respond to actions, you may combine several reducers | |
| 5102 | + * into a single reducer function by using `combineReducers`. | |
| 5103 | + * | |
| 5104 | + * @param {Function} reducer A function that returns the next state tree, given | |
| 5105 | + * the current state tree and the action to handle. | |
| 5106 | + * | |
| 5107 | + * @param {any} [preloadedState] The initial state. You may optionally specify it | |
| 5108 | + * to hydrate the state from the server in universal apps, or to restore a | |
| 5109 | + * previously serialized user session. | |
| 5110 | + * If you use `combineReducers` to produce the root reducer function, this must be | |
| 5111 | + * an object with the same shape as `combineReducers` keys. | |
| 5112 | + * | |
| 5113 | + * @param {Function} [enhancer] The store enhancer. You may optionally specify it | |
| 5114 | + * to enhance the store with third-party capabilities such as middleware, | |
| 5115 | + * time travel, persistence, etc. The only store enhancer that ships with Redux | |
| 5116 | + * is `applyMiddleware()`. | |
| 5117 | + * | |
| 5118 | + * @returns {Store} A Redux store that lets you read the state, dispatch actions | |
| 5119 | + * and subscribe to changes. | |
| 5120 | + */ | |
| 5121 | + | |
| 5122 | +var legacy_createStore = createStore; | |
| 5123 | + | |
| 5124 | +/** | |
| 5125 | + * Prints a warning in the console if it exists. | |
| 5126 | + * | |
| 5127 | + * @param {String} message The warning message. | |
| 5128 | + * @returns {void} | |
| 5129 | + */ | |
| 5130 | +function warning(message) { | |
| 5131 | + /* eslint-disable no-console */ | |
| 5132 | + if (typeof console !== 'undefined' && typeof console.error === 'function') { | |
| 5133 | + console.error(message); | |
| 5134 | + } | |
| 5135 | + /* eslint-enable no-console */ | |
| 5136 | + | |
| 5137 | + | |
| 5138 | + try { | |
| 5139 | + // This error was thrown as a convenience so that if you enable | |
| 5140 | + // "break on all exceptions" in your console, | |
| 5141 | + // it would pause the execution at this line. | |
| 5142 | + throw new Error(message); | |
| 5143 | + } catch (e) {} // eslint-disable-line no-empty | |
| 5144 | + | |
| 5145 | +} | |
| 5146 | + | |
| 5147 | +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { | |
| 5148 | + var reducerKeys = Object.keys(reducers); | |
| 5149 | + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; | |
| 5150 | + | |
| 5151 | + if (reducerKeys.length === 0) { | |
| 5152 | + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; | |
| 5153 | + } | |
| 5154 | + | |
| 5155 | + if (!isPlainObject(inputState)) { | |
| 5156 | + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); | |
| 5157 | + } | |
| 5158 | + | |
| 5159 | + var unexpectedKeys = Object.keys(inputState).filter(function (key) { | |
| 5160 | + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; | |
| 5161 | + }); | |
| 5162 | + unexpectedKeys.forEach(function (key) { | |
| 5163 | + unexpectedKeyCache[key] = true; | |
| 5164 | + }); | |
| 5165 | + if (action && action.type === ActionTypes.REPLACE) return; | |
| 5166 | + | |
| 5167 | + if (unexpectedKeys.length > 0) { | |
| 5168 | + return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored."); | |
| 5169 | + } | |
| 5170 | +} | |
| 5171 | + | |
| 5172 | +function assertReducerShape(reducers) { | |
| 5173 | + Object.keys(reducers).forEach(function (key) { | |
| 5174 | + var reducer = reducers[key]; | |
| 5175 | + var initialState = reducer(undefined, { | |
| 5176 | + type: ActionTypes.INIT | |
| 5177 | + }); | |
| 5178 | + | |
| 5179 | + if (typeof initialState === 'undefined') { | |
| 5180 | + throw new Error( false ? 0 : "The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined."); | |
| 5181 | + } | |
| 5182 | + | |
| 5183 | + if (typeof reducer(undefined, { | |
| 5184 | + type: ActionTypes.PROBE_UNKNOWN_ACTION() | |
| 5185 | + }) === 'undefined') { | |
| 5186 | + throw new Error( false ? 0 : "The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null."); | |
| 5187 | + } | |
| 5188 | + }); | |
| 5189 | +} | |
| 5190 | +/** | |
| 5191 | + * Turns an object whose values are different reducer functions, into a single | |
| 5192 | + * reducer function. It will call every child reducer, and gather their results | |
| 5193 | + * into a single state object, whose keys correspond to the keys of the passed | |
| 5194 | + * reducer functions. | |
| 5195 | + * | |
| 5196 | + * @param {Object} reducers An object whose values correspond to different | |
| 5197 | + * reducer functions that need to be combined into one. One handy way to obtain | |
| 5198 | + * it is to use ES6 `import * as reducers` syntax. The reducers may never return | |
| 5199 | + * undefined for any action. Instead, they should return their initial state | |
| 5200 | + * if the state passed to them was undefined, and the current state for any | |
| 5201 | + * unrecognized action. | |
| 5202 | + * | |
| 5203 | + * @returns {Function} A reducer function that invokes every reducer inside the | |
| 5204 | + * passed object, and builds a state object with the same shape. | |
| 5205 | + */ | |
| 5206 | + | |
| 5207 | + | |
| 5208 | +function combineReducers(reducers) { | |
| 5209 | + var reducerKeys = Object.keys(reducers); | |
| 5210 | + var finalReducers = {}; | |
| 5211 | + | |
| 5212 | + for (var i = 0; i < reducerKeys.length; i++) { | |
| 5213 | + var key = reducerKeys[i]; | |
| 5214 | + | |
| 5215 | + if (true) { | |
| 5216 | + if (typeof reducers[key] === 'undefined') { | |
| 5217 | + warning("No reducer provided for key \"" + key + "\""); | |
| 5218 | + } | |
| 5219 | + } | |
| 5220 | + | |
| 5221 | + if (typeof reducers[key] === 'function') { | |
| 5222 | + finalReducers[key] = reducers[key]; | |
| 5223 | + } | |
| 5224 | + } | |
| 5225 | + | |
| 5226 | + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same | |
| 5227 | + // keys multiple times. | |
| 5228 | + | |
| 5229 | + var unexpectedKeyCache; | |
| 5230 | + | |
| 5231 | + if (true) { | |
| 5232 | + unexpectedKeyCache = {}; | |
| 5233 | + } | |
| 5234 | + | |
| 5235 | + var shapeAssertionError; | |
| 5236 | + | |
| 5237 | + try { | |
| 5238 | + assertReducerShape(finalReducers); | |
| 5239 | + } catch (e) { | |
| 5240 | + shapeAssertionError = e; | |
| 5241 | + } | |
| 5242 | + | |
| 5243 | + return function combination(state, action) { | |
| 5244 | + if (state === void 0) { | |
| 5245 | + state = {}; | |
| 5246 | + } | |
| 5247 | + | |
| 5248 | + if (shapeAssertionError) { | |
| 5249 | + throw shapeAssertionError; | |
| 5250 | + } | |
| 5251 | + | |
| 5252 | + if (true) { | |
| 5253 | + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); | |
| 5254 | + | |
| 5255 | + if (warningMessage) { | |
| 5256 | + warning(warningMessage); | |
| 5257 | + } | |
| 5258 | + } | |
| 5259 | + | |
| 5260 | + var hasChanged = false; | |
| 5261 | + var nextState = {}; | |
| 5262 | + | |
| 5263 | + for (var _i = 0; _i < finalReducerKeys.length; _i++) { | |
| 5264 | + var _key = finalReducerKeys[_i]; | |
| 5265 | + var reducer = finalReducers[_key]; | |
| 5266 | + var previousStateForKey = state[_key]; | |
| 5267 | + var nextStateForKey = reducer(previousStateForKey, action); | |
| 5268 | + | |
| 5269 | + if (typeof nextStateForKey === 'undefined') { | |
| 5270 | + var actionType = action && action.type; | |
| 5271 | + throw new Error( false ? 0 : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined."); | |
| 5272 | + } | |
| 5273 | + | |
| 5274 | + nextState[_key] = nextStateForKey; | |
| 5275 | + hasChanged = hasChanged || nextStateForKey !== previousStateForKey; | |
| 5276 | + } | |
| 5277 | + | |
| 5278 | + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; | |
| 5279 | + return hasChanged ? nextState : state; | |
| 5280 | + }; | |
| 5281 | +} | |
| 5282 | + | |
| 5283 | +function bindActionCreator(actionCreator, dispatch) { | |
| 5284 | + return function () { | |
| 5285 | + return dispatch(actionCreator.apply(this, arguments)); | |
| 5286 | + }; | |
| 5287 | +} | |
| 5288 | +/** | |
| 5289 | + * Turns an object whose values are action creators, into an object with the | |
| 5290 | + * same keys, but with every function wrapped into a `dispatch` call so they | |
| 5291 | + * may be invoked directly. This is just a convenience method, as you can call | |
| 5292 | + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. | |
| 5293 | + * | |
| 5294 | + * For convenience, you can also pass an action creator as the first argument, | |
| 5295 | + * and get a dispatch wrapped function in return. | |
| 5296 | + * | |
| 5297 | + * @param {Function|Object} actionCreators An object whose values are action | |
| 5298 | + * creator functions. One handy way to obtain it is to use ES6 `import * as` | |
| 5299 | + * syntax. You may also pass a single function. | |
| 5300 | + * | |
| 5301 | + * @param {Function} dispatch The `dispatch` function available on your Redux | |
| 5302 | + * store. | |
| 5303 | + * | |
| 5304 | + * @returns {Function|Object} The object mimicking the original object, but with | |
| 5305 | + * every action creator wrapped into the `dispatch` call. If you passed a | |
| 5306 | + * function as `actionCreators`, the return value will also be a single | |
| 5307 | + * function. | |
| 5308 | + */ | |
| 5309 | + | |
| 5310 | + | |
| 5311 | +function bindActionCreators(actionCreators, dispatch) { | |
| 5312 | + if (typeof actionCreators === 'function') { | |
| 5313 | + return bindActionCreator(actionCreators, dispatch); | |
| 5314 | + } | |
| 5315 | + | |
| 5316 | + if (typeof actionCreators !== 'object' || actionCreators === null) { | |
| 5317 | + throw new Error( false ? 0 : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?"); | |
| 5318 | + } | |
| 5319 | + | |
| 5320 | + var boundActionCreators = {}; | |
| 5321 | + | |
| 5322 | + for (var key in actionCreators) { | |
| 5323 | + var actionCreator = actionCreators[key]; | |
| 5324 | + | |
| 5325 | + if (typeof actionCreator === 'function') { | |
| 5326 | + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); | |
| 5327 | + } | |
| 5328 | + } | |
| 5329 | + | |
| 5330 | + return boundActionCreators; | |
| 5331 | +} | |
| 5332 | + | |
| 5333 | +/** | |
| 5334 | + * Composes single-argument functions from right to left. The rightmost | |
| 5335 | + * function can take multiple arguments as it provides the signature for | |
| 5336 | + * the resulting composite function. | |
| 5337 | + * | |
| 5338 | + * @param {...Function} funcs The functions to compose. | |
| 5339 | + * @returns {Function} A function obtained by composing the argument functions | |
| 5340 | + * from right to left. For example, compose(f, g, h) is identical to doing | |
| 5341 | + * (...args) => f(g(h(...args))). | |
| 5342 | + */ | |
| 5343 | +function compose() { | |
| 5344 | + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 5345 | + funcs[_key] = arguments[_key]; | |
| 5346 | + } | |
| 5347 | + | |
| 5348 | + if (funcs.length === 0) { | |
| 5349 | + return function (arg) { | |
| 5350 | + return arg; | |
| 5351 | + }; | |
| 5352 | + } | |
| 5353 | + | |
| 5354 | + if (funcs.length === 1) { | |
| 5355 | + return funcs[0]; | |
| 5356 | + } | |
| 5357 | + | |
| 5358 | + return funcs.reduce(function (a, b) { | |
| 5359 | + return function () { | |
| 5360 | + return a(b.apply(void 0, arguments)); | |
| 5361 | + }; | |
| 5362 | + }); | |
| 5363 | +} | |
| 5364 | + | |
| 5365 | +/** | |
| 5366 | + * Creates a store enhancer that applies middleware to the dispatch method | |
| 5367 | + * of the Redux store. This is handy for a variety of tasks, such as expressing | |
| 5368 | + * asynchronous actions in a concise manner, or logging every action payload. | |
| 5369 | + * | |
| 5370 | + * See `redux-thunk` package as an example of the Redux middleware. | |
| 5371 | + * | |
| 5372 | + * Because middleware is potentially asynchronous, this should be the first | |
| 5373 | + * store enhancer in the composition chain. | |
| 5374 | + * | |
| 5375 | + * Note that each middleware will be given the `dispatch` and `getState` functions | |
| 5376 | + * as named arguments. | |
| 5377 | + * | |
| 5378 | + * @param {...Function} middlewares The middleware chain to be applied. | |
| 5379 | + * @returns {Function} A store enhancer applying the middleware. | |
| 5380 | + */ | |
| 5381 | + | |
| 5382 | +function applyMiddleware() { | |
| 5383 | + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 5384 | + middlewares[_key] = arguments[_key]; | |
| 5385 | + } | |
| 5386 | + | |
| 5387 | + return function (createStore) { | |
| 5388 | + return function () { | |
| 5389 | + var store = createStore.apply(void 0, arguments); | |
| 5390 | + | |
| 5391 | + var _dispatch = function dispatch() { | |
| 5392 | + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.'); | |
| 5393 | + }; | |
| 5394 | + | |
| 5395 | + var middlewareAPI = { | |
| 5396 | + getState: store.getState, | |
| 5397 | + dispatch: function dispatch() { | |
| 5398 | + return _dispatch.apply(void 0, arguments); | |
| 5399 | + } | |
| 5400 | + }; | |
| 5401 | + var chain = middlewares.map(function (middleware) { | |
| 5402 | + return middleware(middlewareAPI); | |
| 5403 | + }); | |
| 5404 | + _dispatch = compose.apply(void 0, chain)(store.dispatch); | |
| 5405 | + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, { | |
| 5406 | + dispatch: _dispatch | |
| 5407 | + }); | |
| 5408 | + }; | |
| 5409 | + }; | |
| 5410 | +} | |
| 5411 | + | |
| 5412 | + | |
| 5413 | + | |
| 5414 | + | |
| 5415 | +/***/ }), | |
| 5416 | + | |
| 5417 | +/***/ "../node_modules/reselect/es/defaultMemoize.js": | |
| 5418 | +/*!*****************************************************!*\ | |
| 5419 | + !*** ../node_modules/reselect/es/defaultMemoize.js ***! | |
| 5420 | + \*****************************************************/ | |
| 5421 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 5422 | + | |
| 5423 | +"use strict"; | |
| 5424 | +__webpack_require__.r(__webpack_exports__); | |
| 5425 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5426 | +/* harmony export */ createCacheKeyComparator: () => (/* binding */ createCacheKeyComparator), | |
| 5427 | +/* harmony export */ defaultEqualityCheck: () => (/* binding */ defaultEqualityCheck), | |
| 5428 | +/* harmony export */ defaultMemoize: () => (/* binding */ defaultMemoize) | |
| 5429 | +/* harmony export */ }); | |
| 5430 | +// Cache implementation based on Erik Rasmussen's `lru-memoize`: | |
| 5431 | +// https://github.com/erikras/lru-memoize | |
| 5432 | +var NOT_FOUND = 'NOT_FOUND'; | |
| 5433 | + | |
| 5434 | +function createSingletonCache(equals) { | |
| 5435 | + var entry; | |
| 5436 | + return { | |
| 5437 | + get: function get(key) { | |
| 5438 | + if (entry && equals(entry.key, key)) { | |
| 5439 | + return entry.value; | |
| 5440 | + } | |
| 5441 | + | |
| 5442 | + return NOT_FOUND; | |
| 5443 | + }, | |
| 5444 | + put: function put(key, value) { | |
| 5445 | + entry = { | |
| 5446 | + key: key, | |
| 5447 | + value: value | |
| 5448 | + }; | |
| 5449 | + }, | |
| 5450 | + getEntries: function getEntries() { | |
| 5451 | + return entry ? [entry] : []; | |
| 5452 | + }, | |
| 5453 | + clear: function clear() { | |
| 5454 | + entry = undefined; | |
| 5455 | + } | |
| 5456 | + }; | |
| 5457 | +} | |
| 5458 | + | |
| 5459 | +function createLruCache(maxSize, equals) { | |
| 5460 | + var entries = []; | |
| 5461 | + | |
| 5462 | + function get(key) { | |
| 5463 | + var cacheIndex = entries.findIndex(function (entry) { | |
| 5464 | + return equals(key, entry.key); | |
| 5465 | + }); // We found a cached entry | |
| 5466 | + | |
| 5467 | + if (cacheIndex > -1) { | |
| 5468 | + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top | |
| 5469 | + | |
| 5470 | + if (cacheIndex > 0) { | |
| 5471 | + entries.splice(cacheIndex, 1); | |
| 5472 | + entries.unshift(entry); | |
| 5473 | + } | |
| 5474 | + | |
| 5475 | + return entry.value; | |
| 5476 | + } // No entry found in cache, return sentinel | |
| 5477 | + | |
| 5478 | + | |
| 5479 | + return NOT_FOUND; | |
| 5480 | + } | |
| 5481 | + | |
| 5482 | + function put(key, value) { | |
| 5483 | + if (get(key) === NOT_FOUND) { | |
| 5484 | + // TODO Is unshift slow? | |
| 5485 | + entries.unshift({ | |
| 5486 | + key: key, | |
| 5487 | + value: value | |
| 5488 | + }); | |
| 5489 | + | |
| 5490 | + if (entries.length > maxSize) { | |
| 5491 | + entries.pop(); | |
| 5492 | + } | |
| 5493 | + } | |
| 5494 | + } | |
| 5495 | + | |
| 5496 | + function getEntries() { | |
| 5497 | + return entries; | |
| 5498 | + } | |
| 5499 | + | |
| 5500 | + function clear() { | |
| 5501 | + entries = []; | |
| 5502 | + } | |
| 5503 | + | |
| 5504 | + return { | |
| 5505 | + get: get, | |
| 5506 | + put: put, | |
| 5507 | + getEntries: getEntries, | |
| 5508 | + clear: clear | |
| 5509 | + }; | |
| 5510 | +} | |
| 5511 | + | |
| 5512 | +var defaultEqualityCheck = function defaultEqualityCheck(a, b) { | |
| 5513 | + return a === b; | |
| 5514 | +}; | |
| 5515 | +function createCacheKeyComparator(equalityCheck) { | |
| 5516 | + return function areArgumentsShallowlyEqual(prev, next) { | |
| 5517 | + if (prev === null || next === null || prev.length !== next.length) { | |
| 5518 | + return false; | |
| 5519 | + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible. | |
| 5520 | + | |
| 5521 | + | |
| 5522 | + var length = prev.length; | |
| 5523 | + | |
| 5524 | + for (var i = 0; i < length; i++) { | |
| 5525 | + if (!equalityCheck(prev[i], next[i])) { | |
| 5526 | + return false; | |
| 5527 | + } | |
| 5528 | + } | |
| 5529 | + | |
| 5530 | + return true; | |
| 5531 | + }; | |
| 5532 | +} | |
| 5533 | +// defaultMemoize now supports a configurable cache size with LRU behavior, | |
| 5534 | +// and optional comparison of the result value with existing values | |
| 5535 | +function defaultMemoize(func, equalityCheckOrOptions) { | |
| 5536 | + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : { | |
| 5537 | + equalityCheck: equalityCheckOrOptions | |
| 5538 | + }; | |
| 5539 | + var _providedOptions$equa = providedOptions.equalityCheck, | |
| 5540 | + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa, | |
| 5541 | + _providedOptions$maxS = providedOptions.maxSize, | |
| 5542 | + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS, | |
| 5543 | + resultEqualityCheck = providedOptions.resultEqualityCheck; | |
| 5544 | + var comparator = createCacheKeyComparator(equalityCheck); | |
| 5545 | + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons | |
| 5546 | + | |
| 5547 | + function memoized() { | |
| 5548 | + var value = cache.get(arguments); | |
| 5549 | + | |
| 5550 | + if (value === NOT_FOUND) { | |
| 5551 | + // @ts-ignore | |
| 5552 | + value = func.apply(null, arguments); | |
| 5553 | + | |
| 5554 | + if (resultEqualityCheck) { | |
| 5555 | + var entries = cache.getEntries(); | |
| 5556 | + var matchingEntry = entries.find(function (entry) { | |
| 5557 | + return resultEqualityCheck(entry.value, value); | |
| 5558 | + }); | |
| 5559 | + | |
| 5560 | + if (matchingEntry) { | |
| 5561 | + value = matchingEntry.value; | |
| 5562 | + } | |
| 5563 | + } | |
| 5564 | + | |
| 5565 | + cache.put(arguments, value); | |
| 5566 | + } | |
| 5567 | + | |
| 5568 | + return value; | |
| 5569 | + } | |
| 5570 | + | |
| 5571 | + memoized.clearCache = function () { | |
| 5572 | + return cache.clear(); | |
| 5573 | + }; | |
| 5574 | + | |
| 5575 | + return memoized; | |
| 5576 | +} | |
| 5577 | + | |
| 5578 | +/***/ }), | |
| 5579 | + | |
| 5580 | +/***/ "../node_modules/reselect/es/index.js": | |
| 5581 | +/*!********************************************!*\ | |
| 5582 | + !*** ../node_modules/reselect/es/index.js ***! | |
| 5583 | + \********************************************/ | |
| 5584 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 5585 | + | |
| 5586 | +"use strict"; | |
| 5587 | +__webpack_require__.r(__webpack_exports__); | |
| 5588 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5589 | +/* harmony export */ createSelector: () => (/* binding */ createSelector), | |
| 5590 | +/* harmony export */ createSelectorCreator: () => (/* binding */ createSelectorCreator), | |
| 5591 | +/* harmony export */ createStructuredSelector: () => (/* binding */ createStructuredSelector), | |
| 5592 | +/* harmony export */ defaultEqualityCheck: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck), | |
| 5593 | +/* harmony export */ defaultMemoize: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize) | |
| 5594 | +/* harmony export */ }); | |
| 5595 | +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js"); | |
| 5596 | + | |
| 5597 | + | |
| 5598 | + | |
| 5599 | +function getDependencies(funcs) { | |
| 5600 | + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; | |
| 5601 | + | |
| 5602 | + if (!dependencies.every(function (dep) { | |
| 5603 | + return typeof dep === 'function'; | |
| 5604 | + })) { | |
| 5605 | + var dependencyTypes = dependencies.map(function (dep) { | |
| 5606 | + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep; | |
| 5607 | + }).join(', '); | |
| 5608 | + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]"); | |
| 5609 | + } | |
| 5610 | + | |
| 5611 | + return dependencies; | |
| 5612 | +} | |
| 5613 | + | |
| 5614 | +function createSelectorCreator(memoize) { | |
| 5615 | + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | |
| 5616 | + memoizeOptionsFromArgs[_key - 1] = arguments[_key]; | |
| 5617 | + } | |
| 5618 | + | |
| 5619 | + var createSelector = function createSelector() { | |
| 5620 | + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | |
| 5621 | + funcs[_key2] = arguments[_key2]; | |
| 5622 | + } | |
| 5623 | + | |
| 5624 | + var _recomputations = 0; | |
| 5625 | + | |
| 5626 | + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`. | |
| 5627 | + // So, start by declaring the default value here. | |
| 5628 | + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.) | |
| 5629 | + | |
| 5630 | + | |
| 5631 | + var directlyPassedOptions = { | |
| 5632 | + memoizeOptions: undefined | |
| 5633 | + }; // Normally, the result func or "output selector" is the last arg | |
| 5634 | + | |
| 5635 | + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object | |
| 5636 | + | |
| 5637 | + if (typeof resultFunc === 'object') { | |
| 5638 | + directlyPassedOptions = resultFunc; // and pop the real result func off | |
| 5639 | + | |
| 5640 | + resultFunc = funcs.pop(); | |
| 5641 | + } | |
| 5642 | + | |
| 5643 | + if (typeof resultFunc !== 'function') { | |
| 5644 | + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]"); | |
| 5645 | + } // Determine which set of options we're using. Prefer options passed directly, | |
| 5646 | + // but fall back to options given to createSelectorCreator. | |
| 5647 | + | |
| 5648 | + | |
| 5649 | + var _directlyPassedOption = directlyPassedOptions, | |
| 5650 | + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions, | |
| 5651 | + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer | |
| 5652 | + // is an array. In most libs I've looked at, it's an equality function or options object. | |
| 5653 | + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full | |
| 5654 | + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so | |
| 5655 | + // we wrap it in an array so we can apply it. | |
| 5656 | + | |
| 5657 | + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions]; | |
| 5658 | + var dependencies = getDependencies(funcs); | |
| 5659 | + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() { | |
| 5660 | + _recomputations++; // apply arguments instead of spreading for performance. | |
| 5661 | + | |
| 5662 | + return resultFunc.apply(null, arguments); | |
| 5663 | + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again. | |
| 5664 | + | |
| 5665 | + var selector = memoize(function dependenciesChecker() { | |
| 5666 | + var params = []; | |
| 5667 | + var length = dependencies.length; | |
| 5668 | + | |
| 5669 | + for (var i = 0; i < length; i++) { | |
| 5670 | + // apply arguments instead of spreading and mutate a local list of params for performance. | |
| 5671 | + // @ts-ignore | |
| 5672 | + params.push(dependencies[i].apply(null, arguments)); | |
| 5673 | + } // apply arguments instead of spreading for performance. | |
| 5674 | + | |
| 5675 | + | |
| 5676 | + _lastResult = memoizedResultFunc.apply(null, params); | |
| 5677 | + return _lastResult; | |
| 5678 | + }); | |
| 5679 | + Object.assign(selector, { | |
| 5680 | + resultFunc: resultFunc, | |
| 5681 | + memoizedResultFunc: memoizedResultFunc, | |
| 5682 | + dependencies: dependencies, | |
| 5683 | + lastResult: function lastResult() { | |
| 5684 | + return _lastResult; | |
| 5685 | + }, | |
| 5686 | + recomputations: function recomputations() { | |
| 5687 | + return _recomputations; | |
| 5688 | + }, | |
| 5689 | + resetRecomputations: function resetRecomputations() { | |
| 5690 | + return _recomputations = 0; | |
| 5691 | + } | |
| 5692 | + }); | |
| 5693 | + return selector; | |
| 5694 | + }; // @ts-ignore | |
| 5695 | + | |
| 5696 | + | |
| 5697 | + return createSelector; | |
| 5698 | +} | |
| 5699 | +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize); | |
| 5700 | +// Manual definition of state and output arguments | |
| 5701 | +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) { | |
| 5702 | + if (selectorCreator === void 0) { | |
| 5703 | + selectorCreator = createSelector; | |
| 5704 | + } | |
| 5705 | + | |
| 5706 | + if (typeof selectors !== 'object') { | |
| 5707 | + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors)); | |
| 5708 | + } | |
| 5709 | + | |
| 5710 | + var objectKeys = Object.keys(selectors); | |
| 5711 | + var resultSelector = selectorCreator( // @ts-ignore | |
| 5712 | + objectKeys.map(function (key) { | |
| 5713 | + return selectors[key]; | |
| 5714 | + }), function () { | |
| 5715 | + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | |
| 5716 | + values[_key3] = arguments[_key3]; | |
| 5717 | + } | |
| 5718 | + | |
| 5719 | + return values.reduce(function (composition, value, index) { | |
| 5720 | + composition[objectKeys[index]] = value; | |
| 5721 | + return composition; | |
| 5722 | + }, {}); | |
| 5723 | + }); | |
| 5724 | + return resultSelector; | |
| 5725 | +}; | |
| 5726 | + | |
| 2392 | 5727 | /***/ }) |
| 2393 | 5728 | |
| 2394 | 5729 | /******/ }); |
| 2395 | 5730 | /************************************************************************/ |
| @@ -2415,8 +5750,49 @@ | ||
| 2415 | 5750 | /******/ |
| 2416 | 5751 | /******/ // Return the exports of the module |
| 2417 | 5752 | /******/ return module.exports; |
| 2418 | 5753 | /******/ } |
| 5754 | +/******/ | |
| 5755 | +/************************************************************************/ | |
| 5756 | +/******/ /* webpack/runtime/define property getters */ | |
| 5757 | +/******/ (() => { | |
| 5758 | +/******/ // define getter functions for harmony exports | |
| 5759 | +/******/ __webpack_require__.d = (exports, definition) => { | |
| 5760 | +/******/ for(var key in definition) { | |
| 5761 | +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 5762 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 5763 | +/******/ } | |
| 5764 | +/******/ } | |
| 5765 | +/******/ }; | |
| 5766 | +/******/ })(); | |
| 5767 | +/******/ | |
| 5768 | +/******/ /* webpack/runtime/global */ | |
| 5769 | +/******/ (() => { | |
| 5770 | +/******/ __webpack_require__.g = (function() { | |
| 5771 | +/******/ if (typeof globalThis === 'object') return globalThis; | |
| 5772 | +/******/ try { | |
| 5773 | +/******/ return this || new Function('return this')(); | |
| 5774 | +/******/ } catch (e) { | |
| 5775 | +/******/ if (typeof window === 'object') return window; | |
| 5776 | +/******/ } | |
| 5777 | +/******/ })(); | |
| 5778 | +/******/ })(); | |
| 5779 | +/******/ | |
| 5780 | +/******/ /* webpack/runtime/hasOwnProperty shorthand */ | |
| 5781 | +/******/ (() => { | |
| 5782 | +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | |
| 5783 | +/******/ })(); | |
| 5784 | +/******/ | |
| 5785 | +/******/ /* webpack/runtime/make namespace object */ | |
| 5786 | +/******/ (() => { | |
| 5787 | +/******/ // define __esModule on exports | |
| 5788 | +/******/ __webpack_require__.r = (exports) => { | |
| 5789 | +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 5790 | +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
| 5791 | +/******/ } | |
| 5792 | +/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
| 5793 | +/******/ }; | |
| 5794 | +/******/ })(); | |
| 2419 | 5795 | /******/ |
| 2420 | 5796 | /************************************************************************/ |
| 2421 | 5797 | var __webpack_exports__ = {}; |
| 2422 | 5798 | // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. |