UNPKG

207 kBSource Map (JSON)View Raw
1{"version":3,"file":"redux-toolkit.umd.min.js","sources":["../node_modules/immer/src/utils/errors.ts","../node_modules/immer/src/utils/common.ts","../node_modules/immer/src/types/types-internal.ts","../node_modules/immer/src/utils/plugins.ts","../node_modules/immer/src/core/scope.ts","../node_modules/immer/src/core/finalize.ts","../node_modules/immer/src/core/proxy.ts","../node_modules/immer/src/core/immerClass.ts","../node_modules/immer/src/utils/env.ts","../node_modules/immer/src/immer.ts","../node_modules/symbol-observable/es/index.js","../node_modules/symbol-observable/es/ponyfill.js","../node_modules/redux/es/redux.js","../node_modules/reselect/es/index.js","../src/devtoolsExtension.ts","../src/isPlainObject.ts","../node_modules/redux-thunk/es/index.js","../src/serializableStateInvariantMiddleware.ts","../src/getDefaultMiddleware.ts","../src/createAction.ts","../src/mapBuilders.ts","../src/createReducer.ts","../src/entities/state_adapter.ts","../src/entities/utils.ts","../src/entities/unsorted_state_adapter.ts","../node_modules/babel-plugin-transform-async-to-promises/helpers.js","../src/nanoid.ts","../src/createAsyncThunk.ts","../node_modules/immer/src/plugins/es5.ts","../src/index.ts","../src/configureStore.ts","../src/entities/create_adapter.ts","../src/entities/entity_state.ts","../src/entities/state_selectors.ts","../src/entities/sorted_state_adapter.ts","../src/createSlice.ts"],"sourcesContent":["const errors = {\n\t0: \"Illegal state\",\n\t1: \"Immer drafts cannot have computed properties\",\n\t2: \"This object has been frozen and should not be mutated\",\n\t3(data: any) {\n\t\treturn (\n\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\tdata\n\t\t)\n\t},\n\t4: \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t5: \"Immer forbids circular references\",\n\t6: \"The first or second argument to `produce` must be a function\",\n\t7: \"The third argument to `produce` must be a function or undefined\",\n\t8: \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t9: \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t10: \"The given draft is already finalized\",\n\t11: \"Object.defineProperty() cannot be used on an Immer draft\",\n\t12: \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t13: \"Immer only supports deleting array indices\",\n\t14: \"Immer only supports setting array indices and the 'length' property\",\n\t15(path: string) {\n\t\treturn \"Cannot apply patch, path doesn't resolve: \" + path\n\t},\n\t16: 'Sets cannot have \"replace\" patches.',\n\t17(op: string) {\n\t\treturn \"Unsupported patch operation: \" + op\n\t},\n\t18(plugin: string) {\n\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t},\n\t19: \"plugin not loaded\",\n\t20: \"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available\"\n} as const\n\nexport function die(error: keyof typeof errors, ...args: any[]): never {\n\tif (__DEV__) {\n\t\tconst e = errors[error]\n\t\tconst msg = !e\n\t\t\t? \"unknown error nr: \" + error\n\t\t\t: typeof e === \"function\"\n\t\t\t? e.apply(null, args as any)\n\t\t\t: e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}${\n\t\t\targs.length ? \" \" + args.join(\",\") : \"\"\n\t\t}. Find the full error at: https://bit.ly/38PiBHb`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\thasSet,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\thasMap,\n\tArchtypeObject,\n\tArchtypeArray,\n\tArchtypeMap,\n\tArchtypeSet,\n\tdie\n} from \"../internal\"\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = Object.getPrototypeOf(value)\n\treturn !proto || proto === Object.prototype\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original<T>(value: T): T | undefined\nexport function original(value: Drafted<any>): any {\n\tif (value && value[DRAFT_STATE]) {\n\t\treturn value[DRAFT_STATE].base_ as any\n\t}\n\t// otherwise return undefined\n}\n\n/*#__PURE__*/\nexport const ownKeys: (target: AnyObject) => PropertyKey[] =\n\ttypeof Reflect !== \"undefined\" && Reflect.ownKeys\n\t\t? Reflect.ownKeys\n\t\t: typeof Object.getOwnPropertySymbols !== \"undefined\"\n\t\t? obj =>\n\t\t\t\tObject.getOwnPropertyNames(obj).concat(\n\t\t\t\t\tObject.getOwnPropertySymbols(obj) as any\n\t\t\t\t)\n\t\t: /* istanbul ignore next */ Object.getOwnPropertyNames\n\nexport function each<T extends Objectish>(\n\tobj: T,\n\titer: (key: string | number, value: any, source: T) => void\n): void\nexport function each(obj: any, iter: any) {\n\tif (getArchtype(obj) === ArchtypeObject) {\n\t\townKeys(obj).forEach(key => iter(key, obj[key], obj))\n\t} else {\n\t\tobj.forEach((entry: any, index: any) => iter(index, entry, obj))\n\t}\n}\n\n/*#__PURE__*/\nexport function getArchtype(thing: any): 0 | 1 | 2 | 3 {\n\t/* istanbul ignore next */\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_ > 3\n\t\t\t? state.type_ - 4 // cause Object and Array map back from 4 and 5\n\t\t\t: (state.type_ as any) // others are the same\n\t\t: Array.isArray(thing)\n\t\t? ArchtypeArray\n\t\t: isMap(thing)\n\t\t? ArchtypeMap\n\t\t: isSet(thing)\n\t\t? ArchtypeSet\n\t\t: ArchtypeObject\n}\n\n/*#__PURE__*/\nexport function has(thing: any, prop: PropertyKey): boolean {\n\treturn getArchtype(thing) === ArchtypeMap\n\t\t? thing.has(prop)\n\t\t: Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\n/*#__PURE__*/\nexport function get(thing: AnyMap | AnyObject, prop: PropertyKey): any {\n\t// @ts-ignore\n\treturn getArchtype(thing) === ArchtypeMap ? thing.get(prop) : thing[prop]\n}\n\n/*#__PURE__*/\nexport function set(thing: any, propOrOldValue: PropertyKey, value: any) {\n\tconst t = getArchtype(thing)\n\tif (t === ArchtypeMap) thing.set(propOrOldValue, value)\n\telse if (t === ArchtypeSet) {\n\t\tthing.delete(propOrOldValue)\n\t\tthing.add(value)\n\t} else thing[propOrOldValue] = value\n}\n\n/*#__PURE__*/\nexport function is(x: any, y: any): boolean {\n\t// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y\n\t} else {\n\t\treturn x !== x && y !== y\n\t}\n}\n\n/*#__PURE__*/\nexport function isMap(target: any): target is AnyMap {\n\treturn hasMap && target instanceof Map\n}\n\n/*#__PURE__*/\nexport function isSet(target: any): target is AnySet {\n\treturn hasSet && target instanceof Set\n}\n/*#__PURE__*/\nexport function latest(state: ImmerState): any {\n\treturn state.copy_ || state.base_\n}\n\n/*#__PURE__*/\nexport function shallowCopy<T extends AnyObject | AnyArray>(\n\tbase: T,\n\tinvokeGetters?: boolean\n): T\nexport function shallowCopy(base: any, invokeGetters = false) {\n\tif (Array.isArray(base)) return base.slice()\n\tconst clone = Object.create(Object.getPrototypeOf(base))\n\teach(base, (key: any) => {\n\t\tif (key === DRAFT_STATE) {\n\t\t\treturn // Never copy over draft state.\n\t\t}\n\t\tconst desc = Object.getOwnPropertyDescriptor(base, key)!\n\t\tlet {value} = desc\n\t\tif (desc.get) {\n\t\t\tif (!invokeGetters) die(1)\n\t\t\tvalue = desc.get.call(base)\n\t\t}\n\t\tif (desc.enumerable) {\n\t\t\tclone[key] = value\n\t\t} else {\n\t\t\tObject.defineProperty(clone, key, {\n\t\t\t\tvalue,\n\t\t\t\twritable: true,\n\t\t\t\tconfigurable: true\n\t\t\t})\n\t\t}\n\t})\n\treturn clone\n}\n\nexport function freeze(obj: any, deep: boolean): void {\n\tif (isDraft(obj) || Object.isFrozen(obj) || !isDraftable(obj)) return\n\tif (getArchtype(obj) > 1 /* Map or Set */) {\n\t\tobj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections as any\n\t}\n\tObject.freeze(obj)\n\tif (deep) each(obj, (_, value) => freeze(value, true))\n}\n\nfunction dontMutateFrozenCollections() {\n\tdie(2)\n}\n","import {\n\tSetState,\n\tImmerScope,\n\tProxyObjectState,\n\tProxyArrayState,\n\tES5ObjectState,\n\tES5ArrayState,\n\tMapState,\n\tDRAFT_STATE\n} from \"../internal\"\n\nexport type Objectish = AnyObject | AnyArray | AnyMap | AnySet\nexport type ObjectishNoSet = AnyObject | AnyArray | AnyMap\n\nexport type AnyObject = {[key: string]: any}\nexport type AnyArray = Array<any>\nexport type AnySet = Set<any>\nexport type AnyMap = Map<any, any>\n\nexport const ArchtypeObject = 0\nexport const ArchtypeArray = 1\nexport const ArchtypeMap = 2\nexport const ArchtypeSet = 3\n\nexport const ProxyTypeProxyObject = 0\nexport const ProxyTypeProxyArray = 1\nexport const ProxyTypeES5Object = 4\nexport const ProxyTypeES5Array = 5\nexport const ProxyTypeMap = 2\nexport const ProxyTypeSet = 3\n\nexport interface ImmerBaseState {\n\tparent_?: ImmerState\n\tscope_: ImmerScope\n\tmodified_: boolean\n\tfinalized_: boolean\n\tisManual_: boolean\n}\n\nexport type ImmerState =\n\t| ProxyObjectState\n\t| ProxyArrayState\n\t| ES5ObjectState\n\t| ES5ArrayState\n\t| MapState\n\t| SetState\n\n// The _internal_ type used for drafts (not to be confused with Draft, which is public facing)\nexport type Drafted<Base = any, T extends ImmerState = ImmerState> = {\n\t[DRAFT_STATE]: T\n} & Base\n","import {\n\tImmerState,\n\tPatch,\n\tImmerScope,\n\tDrafted,\n\tAnyObject,\n\tImmerBaseState,\n\tAnyArray,\n\tAnyMap,\n\tAnySet,\n\tProxyTypeES5Array,\n\tProxyTypeES5Object,\n\tProxyTypeMap,\n\tProxyTypeSet,\n\tdie\n} from \"../internal\"\n\n/** Plugin utilities */\nconst plugins: {\n\tPatches?: {\n\t\tgeneratePatches_(\n\t\t\tstate: ImmerState,\n\t\t\tbasePath: PatchPath,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tgenerateReplacementPatches_(\n\t\t\trootState: ImmerState,\n\t\t\treplacement: any,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tapplyPatches_<T>(draft: T, patches: Patch[]): T\n\t}\n\tES5?: {\n\t\twillFinalizeES5_(scope: ImmerScope, result: any, isReplaced: boolean): void\n\t\tcreateES5Proxy_<T>(\n\t\t\tbase: T,\n\t\t\tparent?: ImmerState\n\t\t): Drafted<T, ES5ObjectState | ES5ArrayState>\n\t\tmarkChangedES5_(state: ImmerState): void\n\t}\n\tMapSet?: {\n\t\tproxyMap_<T extends AnyMap>(target: T, parent?: ImmerState): T\n\t\tproxySet_<T extends AnySet>(target: T, parent?: ImmerState): T\n\t}\n} = {}\n\ntype Plugins = typeof plugins\n\nexport function getPlugin<K extends keyof Plugins>(\n\tpluginKey: K\n): Exclude<Plugins[K], undefined> {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(__DEV__ ? 18 : 19, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}\n\nexport function loadPlugin<K extends keyof Plugins>(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tplugins[pluginKey] = implementation\n}\n\n/** ES5 Plugin */\n\ninterface ES5BaseState extends ImmerBaseState {\n\tfinalizing_: boolean\n\tassigned_: {[key: string]: any}\n\tparent_?: ImmerState\n\trevoked_: boolean\n}\n\nexport interface ES5ObjectState extends ES5BaseState {\n\ttype_: typeof ProxyTypeES5Object\n\tdraft_: Drafted<AnyObject, ES5ObjectState>\n\tbase_: AnyObject\n\tcopy_: AnyObject | null\n}\n\nexport interface ES5ArrayState extends ES5BaseState {\n\ttype_: typeof ProxyTypeES5Array\n\tdraft_: Drafted<AnyObject, ES5ArrayState>\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n}\n\n/** Map / Set plugin */\n\nexport interface MapState extends ImmerBaseState {\n\ttype_: typeof ProxyTypeMap\n\tcopy_: AnyMap | undefined\n\tassigned_: Map<any, boolean> | undefined\n\tbase_: AnyMap\n\trevoked_: boolean\n\tdraft_: Drafted<AnyMap, MapState>\n}\n\nexport interface SetState extends ImmerBaseState {\n\ttype_: typeof ProxyTypeSet\n\tcopy_: AnySet | undefined\n\tbase_: AnySet\n\tdrafts_: Map<any, Drafted> // maps the original value to the draft value in the new set\n\trevoked_: boolean\n\tdraft_: Drafted<AnySet, SetState>\n}\n\n/** Patches plugin */\n\nexport type PatchPath = (string | number)[]\n","import {\n\tPatch,\n\tPatchListener,\n\tDrafted,\n\tImmer,\n\tDRAFT_STATE,\n\tImmerState,\n\tProxyTypeProxyObject,\n\tProxyTypeProxyArray,\n\tgetPlugin\n} from \"../internal\"\nimport {die} from \"../utils/errors\"\n\n/** Each scope represents a `produce` call. */\n\nexport interface ImmerScope {\n\tpatches_?: Patch[]\n\tinversePatches_?: Patch[]\n\tcanAutoFreeze_: boolean\n\tdrafts_: any[]\n\tparent_?: ImmerScope\n\tpatchListener_?: PatchListener\n\timmer_: Immer\n\tunfinalizedDrafts_: number\n}\n\nlet currentScope: ImmerScope | undefined\n\nexport function getCurrentScope() {\n\tif (__DEV__ && !currentScope) die(0)\n\treturn currentScope!\n}\n\nfunction createScope(\n\tparent_: ImmerScope | undefined,\n\timmer_: Immer\n): ImmerScope {\n\treturn {\n\t\tdrafts_: [],\n\t\tparent_,\n\t\timmer_,\n\t\t// Whenever the modified draft contains a draft from another scope, we\n\t\t// need to prevent auto-freezing so the unowned draft can be finalized.\n\t\tcanAutoFreeze_: true,\n\t\tunfinalizedDrafts_: 0\n\t}\n}\n\nexport function usePatchesInScope(\n\tscope: ImmerScope,\n\tpatchListener?: PatchListener\n) {\n\tif (patchListener) {\n\t\tgetPlugin(\"Patches\") // assert we have the plugin\n\t\tscope.patches_ = []\n\t\tscope.inversePatches_ = []\n\t\tscope.patchListener_ = patchListener\n\t}\n}\n\nexport function revokeScope(scope: ImmerScope) {\n\tleaveScope(scope)\n\tscope.drafts_.forEach(revokeDraft)\n\t// @ts-ignore\n\tscope.drafts_ = null\n}\n\nexport function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}\n\nexport function enterScope(immer: Immer) {\n\treturn (currentScope = createScope(currentScope, immer))\n}\n\nfunction revokeDraft(draft: Drafted) {\n\tconst state: ImmerState = draft[DRAFT_STATE]\n\tif (\n\t\tstate.type_ === ProxyTypeProxyObject ||\n\t\tstate.type_ === ProxyTypeProxyArray\n\t)\n\t\tstate.revoke_()\n\telse state.revoked_ = true\n}\n","import {\n\tImmerScope,\n\tDRAFT_STATE,\n\tisDraftable,\n\tNOTHING,\n\tPatchPath,\n\teach,\n\thas,\n\tfreeze,\n\tshallowCopy,\n\tImmerState,\n\tisDraft,\n\tSetState,\n\tset,\n\tis,\n\tget,\n\tProxyTypeES5Object,\n\tProxyTypeES5Array,\n\tProxyTypeSet,\n\tgetPlugin,\n\tdie,\n\trevokeScope\n} from \"../internal\"\n\nexport function processResult(result: any, scope: ImmerScope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length\n\tconst baseDraft = scope.drafts_![0]\n\tconst isReplaced = result !== undefined && result !== baseDraft\n\tif (!scope.immer_.useProxies_)\n\t\tgetPlugin(\"ES5\").willFinalizeES5_(scope, result, isReplaced)\n\tif (isReplaced) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope)\n\t\t\tdie(4)\n\t\t}\n\t\tif (isDraftable(result)) {\n\t\t\t// Finalize the result in case it contains (or is) a subset of the draft.\n\t\t\tresult = finalize(scope, result)\n\t\t\tif (!scope.parent_) maybeFreeze(scope, result)\n\t\t}\n\t\tif (scope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(\n\t\t\t\tbaseDraft[DRAFT_STATE],\n\t\t\t\tresult,\n\t\t\t\tscope.patches_,\n\t\t\t\tscope.inversePatches_!\n\t\t\t)\n\t\t}\n\t} else {\n\t\t// Finalize the base draft.\n\t\tresult = finalize(scope, baseDraft, [])\n\t}\n\trevokeScope(scope)\n\tif (scope.patches_) {\n\t\tscope.patchListener_!(scope.patches_, scope.inversePatches_!)\n\t}\n\treturn result !== NOTHING ? result : undefined\n}\n\nfunction finalize(rootScope: ImmerScope, value: any, path?: PatchPath) {\n\t// Don't recurse in tho recursive data structures\n\tif (Object.isFrozen(value)) return value\n\n\tconst state: ImmerState = value[DRAFT_STATE]\n\t// A plain object, might need freezing, might contain drafts\n\tif (!state) {\n\t\teach(value, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, value, key, childValue, path)\n\t\t)\n\t\treturn value\n\t}\n\t// Never finalize drafts owned by another scope.\n\tif (state.scope_ !== rootScope) return value\n\t// Unmodified draft, return the (frozen) original\n\tif (!state.modified_) {\n\t\tmaybeFreeze(rootScope, state.base_, true)\n\t\treturn state.base_\n\t}\n\t// Not finalized yet, let's do that now\n\tif (!state.finalized_) {\n\t\tstate.finalized_ = true\n\t\tstate.scope_.unfinalizedDrafts_--\n\t\tconst result =\n\t\t\t// For ES5, create a good copy from the draft first, with added keys and without deleted keys.\n\t\t\tstate.type_ === ProxyTypeES5Object || state.type_ === ProxyTypeES5Array\n\t\t\t\t? (state.copy_ = shallowCopy(state.draft_, true))\n\t\t\t\t: state.copy_\n\t\t// finalize all children of the copy\n\t\teach(result as any, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, result, key, childValue, path)\n\t\t)\n\t\t// everything inside is frozen, we can freeze here\n\t\tmaybeFreeze(rootScope, result, false)\n\t\t// first time finalizing, let's create those patches\n\t\tif (path && rootScope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generatePatches_(\n\t\t\t\tstate,\n\t\t\t\tpath,\n\t\t\t\trootScope.patches_,\n\t\t\t\trootScope.inversePatches_!\n\t\t\t)\n\t\t}\n\t}\n\treturn state.copy_\n}\n\nfunction finalizeProperty(\n\trootScope: ImmerScope,\n\tparentState: undefined | ImmerState,\n\ttargetObject: any,\n\tprop: string | number,\n\tchildValue: any,\n\trootPath?: PatchPath\n) {\n\tif (__DEV__ && childValue === targetObject) die(5)\n\tif (isDraft(childValue)) {\n\t\tconst path =\n\t\t\trootPath &&\n\t\t\tparentState &&\n\t\t\tparentState!.type_ !== ProxyTypeSet && // Set objects are atomic since they have no keys.\n\t\t\t!has((parentState as Exclude<ImmerState, SetState>).assigned_!, prop) // Skip deep patches for assigned keys.\n\t\t\t\t? rootPath!.concat(prop)\n\t\t\t\t: undefined\n\t\t// Drafts owned by `scope` are finalized here.\n\t\tconst res = finalize(rootScope, childValue, path)\n\t\tset(targetObject, prop, res)\n\t\t// Drafts from another scope must prevented to be frozen\n\t\t// if we got a draft back from finalize, we're in a nested produce and shouldn't freeze\n\t\tif (isDraft(res)) {\n\t\t\trootScope.canAutoFreeze_ = false\n\t\t} else return\n\t}\n\t// Unchanged draft properties are ignored.\n\tif (parentState && is(childValue, get(parentState!.base_, prop))) {\n\t\treturn\n\t}\n\t// Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n\tif (isDraftable(childValue)) {\n\t\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t\t// This benefits especially adding large data tree's without further processing.\n\t\t\t// See add-data.js perf test\n\t\t\treturn\n\t\t}\n\t\tfinalize(rootScope, childValue)\n\t\t// immer deep freezes plain objects, so if there is no parent state, we freeze as well\n\t\tif (!parentState || !parentState.scope_.parent_)\n\t\t\tmaybeFreeze(rootScope, childValue)\n\t}\n}\n\nfunction maybeFreeze(scope: ImmerScope, value: any, deep = false) {\n\tif (scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n\t\tfreeze(value, deep)\n\t}\n}\n","\"use strict\"\nimport {\n\teach,\n\thas,\n\tis,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tImmerBaseState,\n\tImmerState,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tObjectish,\n\tgetCurrentScope,\n\tDRAFT_STATE,\n\tdie,\n\tcreateProxy,\n\tProxyTypeProxyObject,\n\tProxyTypeProxyArray\n} from \"../internal\"\n\ninterface ProxyBaseState extends ImmerBaseState {\n\tassigned_: {\n\t\t[property: string]: boolean\n\t}\n\tparent_?: ImmerState\n\tdrafts_?: {\n\t\t[property: string]: Drafted<any, any>\n\t}\n\trevoke_(): void\n}\n\nexport interface ProxyObjectState extends ProxyBaseState {\n\ttype_: typeof ProxyTypeProxyObject\n\tbase_: AnyObject\n\tcopy_: AnyObject | null\n\tdraft_: Drafted<AnyObject, ProxyObjectState>\n}\n\nexport interface ProxyArrayState extends ProxyBaseState {\n\ttype_: typeof ProxyTypeProxyArray\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n\tdraft_: Drafted<AnyArray, ProxyArrayState>\n}\n\ntype ProxyState = ProxyObjectState | ProxyArrayState\n\n/**\n * Returns a new draft of the `base` object.\n *\n * The second argument is the parent draft-state (used internally).\n */\nexport function createProxyProxy<T extends Objectish>(\n\tbase: T,\n\tparent?: ImmerState\n): Drafted<T, ProxyState> {\n\tconst isArray = Array.isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: isArray ? ProxyTypeProxyArray : (ProxyTypeProxyObject as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\tassigned_: {},\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// Any property proxies.\n\t\tdrafts_: {},\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler<object | Array<any>> = objectTraps\n\tif (isArray) {\n\t\ttarget = [state] as any\n\t\ttraps = arrayTraps\n\t}\n\n\tconst {revoke, proxy} = Proxy.revocable(target, traps)\n\tstate.draft_ = proxy as any\n\tstate.revoke_ = revoke\n\treturn proxy as any\n}\n\n/**\n * Object drafts\n */\nconst objectTraps: ProxyHandler<ProxyState> = {\n\tget(state, prop) {\n\t\tif (prop === DRAFT_STATE) return state\n\t\tlet {drafts_: drafts} = state\n\n\t\t// Check for existing draft in unmodified state.\n\t\tif (!state.modified_ && has(drafts, prop)) {\n\t\t\treturn drafts![prop as any]\n\t\t}\n\n\t\tconst value = latest(state)[prop]\n\t\tif (state.finalized_ || !isDraftable(value)) {\n\t\t\treturn value\n\t\t}\n\n\t\t// Check for existing draft in modified state.\n\t\tif (state.modified_) {\n\t\t\t// Assigned values are never drafted. This catches any drafts we created, too.\n\t\t\tif (value !== peek(state.base_, prop)) return value\n\t\t\t// Store drafts on the copy (when one exists).\n\t\t\t// @ts-ignore\n\t\t\tdrafts = state.copy_\n\t\t}\n\n\t\treturn (drafts![prop as any] = createProxy(\n\t\t\tstate.scope_.immer_,\n\t\t\tvalue,\n\t\t\tstate\n\t\t))\n\t},\n\thas(state, prop) {\n\t\treturn prop in latest(state)\n\t},\n\townKeys(state) {\n\t\treturn Reflect.ownKeys(latest(state))\n\t},\n\tset(state, prop: string /* strictly not, but helps TS */, value) {\n\t\tif (!state.modified_) {\n\t\t\tconst baseValue = peek(state.base_, prop)\n\t\t\t// Optimize based on value's truthiness. Truthy values are guaranteed to\n\t\t\t// never be undefined, so we can avoid the `in` operator. Lastly, truthy\n\t\t\t// values may be drafts, but falsy values are never drafts.\n\t\t\tconst isUnchanged = value\n\t\t\t\t? is(baseValue, value) || value === state.drafts_![prop]\n\t\t\t\t: is(baseValue, value) && prop in state.base_\n\t\t\tif (isUnchanged) return true\n\t\t\tprepareCopy(state)\n\t\t\tmarkChangedProxy(state)\n\t\t}\n\t\tstate.assigned_[prop] = true\n\t\t// @ts-ignore\n\t\tstate.copy_![prop] = value\n\t\treturn true\n\t},\n\tdeleteProperty(state, prop: string) {\n\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\tif (peek(state.base_, prop) !== undefined || prop in state.base_) {\n\t\t\tstate.assigned_[prop] = false\n\t\t\tprepareCopy(state)\n\t\t\tmarkChangedProxy(state)\n\t\t} else if (state.assigned_[prop]) {\n\t\t\t// if an originally not assigned property was deleted\n\t\t\tdelete state.assigned_[prop]\n\t\t}\n\t\t// @ts-ignore\n\t\tif (state.copy_) delete state.copy_[prop]\n\t\treturn true\n\t},\n\t// Note: We never coerce `desc.value` into an Immer draft, because we can't make\n\t// the same guarantee in ES5 mode.\n\tgetOwnPropertyDescriptor(state, prop) {\n\t\tconst owner = latest(state)\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(owner, prop)\n\t\tif (desc) {\n\t\t\tdesc.writable = true\n\t\t\tdesc.configurable =\n\t\t\t\tstate.type_ !== ProxyTypeProxyArray || prop !== \"length\"\n\t\t}\n\t\treturn desc\n\t},\n\tdefineProperty() {\n\t\tdie(11)\n\t},\n\tgetPrototypeOf(state) {\n\t\treturn Object.getPrototypeOf(state.base_)\n\t},\n\tsetPrototypeOf() {\n\t\tdie(12)\n\t}\n}\n\n/**\n * Array drafts\n */\n\nconst arrayTraps: ProxyHandler<[ProxyArrayState]> = {}\neach(objectTraps, (key, fn) => {\n\t// @ts-ignore\n\tarrayTraps[key] = function() {\n\t\targuments[0] = arguments[0][0]\n\t\treturn fn.apply(this, arguments)\n\t}\n})\narrayTraps.deleteProperty = function(state, prop) {\n\tif (__DEV__ && isNaN(parseInt(prop as any))) die(13)\n\treturn objectTraps.deleteProperty!.call(this, state[0], prop)\n}\narrayTraps.set = function(state, prop, value) {\n\tif (__DEV__ && prop !== \"length\" && isNaN(parseInt(prop as any))) die(14)\n\treturn objectTraps.set!.call(this, state[0], prop, value, state[0])\n}\n\n/**\n * Map drafts\n */\n\n// Access a property without creating an Immer draft.\nfunction peek(draft: Drafted, prop: PropertyKey): any {\n\tconst state = draft[DRAFT_STATE]\n\tconst desc = Reflect.getOwnPropertyDescriptor(\n\t\tstate ? latest(state) : draft,\n\t\tprop\n\t)\n\treturn desc && desc.value\n}\n\nexport function markChangedProxy(state: ImmerState) {\n\tif (!state.modified_) {\n\t\tstate.modified_ = true\n\t\tif (\n\t\t\tstate.type_ === ProxyTypeProxyObject ||\n\t\t\tstate.type_ === ProxyTypeProxyArray\n\t\t) {\n\t\t\tconst copy = (state.copy_ = shallowCopy(state.base_))\n\t\t\teach(state.drafts_!, (key, value) => {\n\t\t\t\t// @ts-ignore\n\t\t\t\tcopy[key] = value\n\t\t\t})\n\t\t\tstate.drafts_ = undefined\n\t\t}\n\n\t\tif (state.parent_) {\n\t\t\tmarkChangedProxy(state.parent_)\n\t\t}\n\t}\n}\n\nfunction prepareCopy(state: ProxyState) {\n\tif (!state.copy_) {\n\t\tstate.copy_ = shallowCopy(state.base_)\n\t}\n}\n","import {\n\tIProduceWithPatches,\n\tIProduce,\n\tImmerState,\n\tDrafted,\n\tisDraftable,\n\tprocessResult,\n\tNOTHING,\n\tPatch,\n\tObjectish,\n\tDRAFT_STATE,\n\tDraft,\n\tPatchListener,\n\tisDraft,\n\tisMap,\n\tisSet,\n\tmarkChangedProxy,\n\tcreateProxyProxy,\n\tfreeze,\n\tgetPlugin,\n\tdie,\n\thasProxies,\n\tisMinified,\n\tenterScope,\n\trevokeScope,\n\tleaveScope,\n\tusePatchesInScope,\n\tgetCurrentScope\n} from \"../internal\"\n\ninterface ProducersFns {\n\tproduce: IProduce\n\tproduceWithPatches: IProduceWithPatches\n}\n\nexport class Immer implements ProducersFns {\n\tuseProxies_: boolean = hasProxies\n\n\tautoFreeze_: boolean = __DEV__ ? true /* istanbul ignore next */ : !isMinified\n\n\tconstructor(config?: {useProxies?: boolean; autoFreeze?: boolean}) {\n\t\tif (typeof config?.useProxies === \"boolean\")\n\t\t\tthis.setUseProxies(config!.useProxies)\n\t\tif (typeof config?.autoFreeze === \"boolean\")\n\t\t\tthis.setAutoFreeze(config!.autoFreeze)\n\t\tthis.produce = this.produce.bind(this)\n\t\tthis.produceWithPatches = this.produceWithPatches.bind(this)\n\t}\n\n\t/**\n\t * The `produce` function takes a value and a \"recipe function\" (whose\n\t * return value often depends on the base state). The recipe function is\n\t * free to mutate its first argument however it wants. All mutations are\n\t * only ever applied to a __copy__ of the base state.\n\t *\n\t * Pass only a function to create a \"curried producer\" which relieves you\n\t * from passing the recipe function every time.\n\t *\n\t * Only plain objects and arrays are made mutable. All other objects are\n\t * considered uncopyable.\n\t *\n\t * Note: This function is __bound__ to its `Immer` instance.\n\t *\n\t * @param {any} base - the initial state\n\t * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n\t * @param {Function} patchListener - optional function that will be called with all the patches produced here\n\t * @returns {any} a new state, or the initial state if nothing was modified\n\t */\n\tproduce(base: any, recipe?: any, patchListener?: any) {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\" && typeof recipe !== \"function\") {\n\t\t\tconst defaultBase = recipe\n\t\t\trecipe = base\n\n\t\t\tconst self = this\n\t\t\treturn function curriedProduce(\n\t\t\t\tthis: any,\n\t\t\t\tbase = defaultBase,\n\t\t\t\t...args: any[]\n\t\t\t) {\n\t\t\t\treturn self.produce(base, (draft: Drafted) => recipe.call(this, draft, ...args)) // prettier-ignore\n\t\t\t}\n\t\t}\n\n\t\tif (typeof recipe !== \"function\") die(6)\n\t\tif (patchListener !== undefined && typeof patchListener !== \"function\")\n\t\t\tdie(7)\n\n\t\tlet result\n\n\t\t// Only plain objects, arrays, and \"immerable classes\" are drafted.\n\t\tif (isDraftable(base)) {\n\t\t\tconst scope = enterScope(this)\n\t\t\tconst proxy = createProxy(this, base, undefined)\n\t\t\tlet hasError = true\n\t\t\ttry {\n\t\t\t\tresult = recipe(proxy)\n\t\t\t\thasError = false\n\t\t\t} finally {\n\t\t\t\t// finally instead of catch + rethrow better preserves original stack\n\t\t\t\tif (hasError) revokeScope(scope)\n\t\t\t\telse leaveScope(scope)\n\t\t\t}\n\t\t\tif (typeof Promise !== \"undefined\" && result instanceof Promise) {\n\t\t\t\treturn result.then(\n\t\t\t\t\tresult => {\n\t\t\t\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\t\t\t\treturn processResult(result, scope)\n\t\t\t\t\t},\n\t\t\t\t\terror => {\n\t\t\t\t\t\trevokeScope(scope)\n\t\t\t\t\t\tthrow error\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\treturn processResult(result, scope)\n\t\t} else {\n\t\t\tresult = recipe(base)\n\t\t\tif (result === NOTHING) return undefined\n\t\t\tif (result === undefined) result = base\n\t\t\tif (this.autoFreeze_) freeze(result, true)\n\t\t\treturn result\n\t\t}\n\t}\n\n\tproduceWithPatches(arg1: any, arg2?: any, arg3?: any): any {\n\t\tif (typeof arg1 === \"function\") {\n\t\t\treturn (state: any, ...args: any[]) =>\n\t\t\t\tthis.produceWithPatches(state, (draft: any) => arg1(draft, ...args))\n\t\t}\n\n\t\tlet patches: Patch[], inversePatches: Patch[]\n\t\tconst nextState = this.produce(arg1, arg2, (p: Patch[], ip: Patch[]) => {\n\t\t\tpatches = p\n\t\t\tinversePatches = ip\n\t\t})\n\t\treturn [nextState, patches!, inversePatches!]\n\t}\n\n\tcreateDraft<T extends Objectish>(base: T): Draft<T> {\n\t\tif (!isDraftable(base)) die(8)\n\t\tconst scope = enterScope(this)\n\t\tconst proxy = createProxy(this, base, undefined)\n\t\tproxy[DRAFT_STATE].isManual_ = true\n\t\tleaveScope(scope)\n\t\treturn proxy as any\n\t}\n\n\tfinishDraft<D extends Draft<any>>(\n\t\tdraft: D,\n\t\tpatchListener?: PatchListener\n\t): D extends Draft<infer T> ? T : never {\n\t\tconst state: ImmerState = draft && draft[DRAFT_STATE]\n\t\tif (__DEV__) {\n\t\t\tif (!state || !state.isManual_) die(9)\n\t\t\tif (state.finalized_) die(10)\n\t\t}\n\t\tconst {scope_: scope} = state\n\t\tusePatchesInScope(scope, patchListener)\n\t\treturn processResult(undefined, scope)\n\t}\n\n\t/**\n\t * Pass true to automatically freeze all copies created by Immer.\n\t *\n\t * By default, auto-freezing is disabled in production.\n\t */\n\tsetAutoFreeze(value: boolean) {\n\t\tthis.autoFreeze_ = value\n\t}\n\n\t/**\n\t * Pass true to use the ES2015 `Proxy` class when creating drafts, which is\n\t * always faster than using ES5 proxies.\n\t *\n\t * By default, feature detection is used, so calling this is rarely necessary.\n\t */\n\tsetUseProxies(value: boolean) {\n\t\tif (!hasProxies) {\n\t\t\tdie(20)\n\t\t}\n\t\tthis.useProxies_ = value\n\t}\n\n\tapplyPatches(base: Objectish, patches: Patch[]) {\n\t\t// If a patch replaces the entire state, take that replacement as base\n\t\t// before applying patches\n\t\tlet i: number\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i]\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tconst applyPatchesImpl = getPlugin(\"Patches\").applyPatches_\n\t\tif (isDraft(base)) {\n\t\t\t// N.B: never hits if some patch a replacement, patches are never drafts\n\t\t\treturn applyPatchesImpl(base, patches)\n\t\t}\n\t\t// Otherwise, produce a copy of the base state.\n\t\treturn this.produce(base, (draft: Drafted) =>\n\t\t\tapplyPatchesImpl(draft, patches.slice(i + 1))\n\t\t)\n\t}\n}\n\nexport function createProxy<T extends Objectish>(\n\timmer: Immer,\n\tvalue: T,\n\tparent?: ImmerState\n): Drafted<T, ImmerState> {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\tconst draft: Drafted = isMap(value)\n\t\t? getPlugin(\"MapSet\").proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(\"MapSet\").proxySet_(value, parent)\n\t\t: immer.useProxies_\n\t\t? createProxyProxy(value, parent)\n\t\t: getPlugin(\"ES5\").createES5Proxy_(value, parent)\n\n\tconst scope = parent ? parent.scope_ : getCurrentScope()\n\tscope.drafts_.push(draft)\n\treturn draft\n}\n\nexport function markChanged(immer: Immer, state: ImmerState) {\n\tif (immer.useProxies_) {\n\t\tmarkChangedProxy(state)\n\t} else {\n\t\tgetPlugin(\"ES5\").markChangedES5_(state)\n\t}\n}\n","// Should be no imports here!\n\n// SOme things that should be evaluated before all else...\nconst hasSymbol = typeof Symbol !== \"undefined\"\nexport const hasMap = typeof Map !== \"undefined\"\nexport const hasSet = typeof Set !== \"undefined\"\nexport const hasProxies =\n\ttypeof Proxy !== \"undefined\" &&\n\ttypeof Proxy.revocable !== \"undefined\" &&\n\ttypeof Reflect !== \"undefined\"\n\n/* istanbul ignore next */\nfunction mini() {}\nexport const isMinified = mini.name !== \"mini\"\n\n/**\n * The sentinel value returned by producers to replace the draft with undefined.\n */\nexport const NOTHING: Nothing = hasSymbol\n\t? Symbol(\"immer-nothing\")\n\t: ({[\"immer-nothing\"]: true} as any)\n\n/**\n * To let Immer treat your class instances as plain immutable objects\n * (albeit with a custom prototype), you must define either an instance property\n * or a static property on each of your custom classes.\n *\n * Otherwise, your class instance will never be drafted, which means it won't be\n * safe to mutate in a produce callback.\n */\nexport const DRAFTABLE: unique symbol = hasSymbol\n\t? Symbol(\"immer-draftable\")\n\t: (\"__$immer_draftable\" as any)\n\nexport const DRAFT_STATE: unique symbol = hasSymbol\n\t? Symbol(\"immer-state\")\n\t: (\"__$immer_state\" as any)\n\nexport const iteratorSymbol: typeof Symbol.iterator = hasSymbol\n\t? Symbol.iterator\n\t: (\"@@iterator\" as any)\n\n/** Use a class type for `nothing` so its type is unique */\nexport class Nothing {\n\t// This lets us do `Exclude<T, Nothing>`\n\t// @ts-ignore\n\tprivate _!: unique symbol\n}\n","import {\n\tIProduce,\n\tIProduceWithPatches,\n\tImmer,\n\tDraft,\n\tImmutable\n} from \"./internal\"\n\nexport {\n\tDraft,\n\tImmutable,\n\tPatch,\n\tPatchListener,\n\toriginal,\n\tisDraft,\n\tisDraftable,\n\tNOTHING as nothing,\n\tDRAFTABLE as immerable\n} from \"./internal\"\n\nconst immer = new Immer()\n\n/**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\nexport const produce: IProduce = immer.produce\nexport default produce\n\n/**\n * Like `produce`, but `produceWithPatches` always returns a tuple\n * [nextState, patches, inversePatches] (instead of just the next state)\n */\nexport const produceWithPatches: IProduceWithPatches = immer.produceWithPatches.bind(\n\timmer\n)\n\n/**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is disabled in production.\n */\nexport const setAutoFreeze = immer.setAutoFreeze.bind(immer)\n\n/**\n * Pass true to use the ES2015 `Proxy` class when creating drafts, which is\n * always faster than using ES5 proxies.\n *\n * By default, feature detection is used, so calling this is rarely necessary.\n */\nexport const setUseProxies = immer.setUseProxies.bind(immer)\n\n/**\n * Apply an array of Immer patches to the first argument.\n *\n * This function is a producer, which means copy-on-write is in effect.\n */\nexport const applyPatches = immer.applyPatches.bind(immer)\n\n/**\n * Create an Immer draft from the given base state, which may be a draft itself.\n * The draft can be modified until you finalize it with the `finishDraft` function.\n */\nexport const createDraft = immer.createDraft.bind(immer)\n\n/**\n * Finalize an Immer draft from a `createDraft` call, returning the base state\n * (if no changes were made) or a modified copy. The draft must *not* be\n * mutated afterwards.\n *\n * Pass a function as the 2nd argument to generate Immer patches based on the\n * changes that were made.\n */\nexport const finishDraft = immer.finishDraft.bind(immer)\n\n/**\n * This function is actually a no-op, but can be used to cast an immutable type\n * to an draft type and make TypeScript happy\n *\n * @param value\n */\nexport function castDraft<T>(value: T): Draft<T> {\n\treturn value as any\n}\n\n/**\n * This function is actually a no-op, but can be used to cast a mutable type\n * to an immutable type and make TypeScript happy\n * @param value\n */\nexport function castImmutable<T>(value: T): Immutable<T> {\n\treturn value as any\n}\n\nexport {Immer}\n\nexport {enableES5} from \"./plugins/es5\"\nexport {enablePatches} from \"./plugins/patches\"\nexport {enableMapSet} from \"./plugins/mapset\"\nexport {enableAllPlugins} from \"./plugins/all\"\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","import $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error('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.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('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-reference/store#subscribe(listener) for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && \"action \\\"\" + String(actionType) + \"\\\"\" || 'an action';\n return \"Given \" + actionDescription + \", reducer \\\"\" + 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.\";\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n 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.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(\"Reducer \\\"\" + 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.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(\"Reducer \\\"\" + 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.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers);\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(\"bindActionCreators expected an object or a function, instead received \" + (actionCreators === null ? 'null' : typeof actionCreators) + \". \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(\"Dispatching while constructing your middleware is not allowed. \" + \"Other middleware would not be applied to this dispatch.\");\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { createStore, combineReducers, bindActionCreators, applyMiddleware, compose, ActionTypes as __DO_NOT_USE__ActionTypes };\n","function defaultEqualityCheck(a, b) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(equalityCheck, prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n var length = prev.length;\n for (var i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function defaultMemoize(func) {\n var equalityCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultEqualityCheck;\n\n var lastArgs = null;\n var lastResult = null;\n // we reference arguments instead of spreading them for performance reasons\n return function () {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = func.apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n };\n}\n\nfunction getDependencies(funcs) {\n var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;\n\n if (!dependencies.every(function (dep) {\n return typeof dep === 'function';\n })) {\n var dependencyTypes = dependencies.map(function (dep) {\n return typeof dep;\n }).join(', ');\n throw new Error('Selector creators expect all input-selectors to be functions, ' + ('instead received the following types: [' + dependencyTypes + ']'));\n }\n\n return dependencies;\n}\n\nexport function createSelectorCreator(memoize) {\n for (var _len = arguments.length, memoizeOptions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n memoizeOptions[_key - 1] = arguments[_key];\n }\n\n return function () {\n for (var _len2 = arguments.length, funcs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n funcs[_key2] = arguments[_key2];\n }\n\n var recomputations = 0;\n var resultFunc = funcs.pop();\n var dependencies = getDependencies(funcs);\n\n var memoizedResultFunc = memoize.apply(undefined, [function () {\n recomputations++;\n // apply arguments instead of spreading for performance.\n return resultFunc.apply(null, arguments);\n }].concat(memoizeOptions));\n\n // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.\n var selector = memoize(function () {\n var params = [];\n var length = dependencies.length;\n\n for (var i = 0; i < length; i++) {\n // apply arguments instead of spreading and mutate a local list of params for performance.\n params.push(dependencies[i].apply(null, arguments));\n }\n\n // apply arguments instead of spreading for performance.\n return memoizedResultFunc.apply(null, params);\n });\n\n selector.resultFunc = resultFunc;\n selector.dependencies = dependencies;\n selector.recomputations = function () {\n return recomputations;\n };\n selector.resetRecomputations = function () {\n return recomputations = 0;\n };\n return selector;\n };\n}\n\nexport var createSelector = createSelectorCreator(defaultMemoize);\n\nexport function createStructuredSelector(selectors) {\n var selectorCreator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createSelector;\n\n if (typeof selectors !== 'object') {\n throw new Error('createStructuredSelector expects first argument to be an object ' + ('where each property is a selector, instead received a ' + typeof selectors));\n }\n var objectKeys = Object.keys(selectors);\n return selectorCreator(objectKeys.map(function (key) {\n return selectors[key];\n }), function () {\n for (var _len3 = arguments.length, values = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n values[_key3] = arguments[_key3];\n }\n\n return values.reduce(function (composition, value, index) {\n composition[objectKeys[index]] = value;\n return composition;\n }, {});\n });\n}","import { Action, ActionCreator, StoreEnhancer, compose } from 'redux'\r\n\r\n/**\r\n * @public\r\n */\r\nexport interface EnhancerOptions {\r\n /**\r\n * the instance name to be showed on the monitor page. Default value is `document.title`.\r\n * If not specified and there's no document title, it will consist of `tabId` and `instanceId`.\r\n */\r\n name?: string\r\n /**\r\n * action creators functions to be available in the Dispatcher.\r\n */\r\n actionCreators?: ActionCreator<any>[] | { [key: string]: ActionCreator<any> }\r\n /**\r\n * if more than one action is dispatched in the indicated interval, all new actions will be collected and sent at once.\r\n * It is the joint between performance and speed. When set to `0`, all actions will be sent instantly.\r\n * Set it to a higher value when experiencing perf issues (also `maxAge` to a lower value).\r\n *\r\n * @default 500 ms.\r\n */\r\n latency?: number\r\n /**\r\n * (> 1) - maximum allowed actions to be stored in the history tree. The oldest actions are removed once maxAge is reached. It's critical for performance.\r\n *\r\n * @default 50\r\n */\r\n maxAge?: number\r\n /**\r\n * - `undefined` - will use regular `JSON.stringify` to send data (it's the fast mode).\r\n * - `false` - will handle also circular references.\r\n * - `true` - will handle also date, regex, undefined, error objects, symbols, maps, sets and functions.\r\n * - object, which contains `date`, `regex`, `undefined`, `error`, `symbol`, `map`, `set` and `function` keys.\r\n * For each of them you can indicate if to include (by setting as `true`).\r\n * For `function` key you can also specify a custom function which handles serialization.\r\n * See [`jsan`](https://github.com/kolodny/jsan) for more details.\r\n */\r\n serialize?:\r\n | boolean\r\n | {\r\n date?: boolean\r\n regex?: boolean\r\n undefined?: boolean\r\n error?: boolean\r\n symbol?: boolean\r\n map?: boolean\r\n set?: boolean\r\n function?: boolean | Function\r\n }\r\n /**\r\n * function which takes `action` object and id number as arguments, and should return `action` object back.\r\n */\r\n actionSanitizer?: <A extends Action>(action: A, id: number) => A\r\n /**\r\n * function which takes `state` object and index as arguments, and should return `state` object back.\r\n */\r\n stateSanitizer?: <S>(state: S, index: number) => S\r\n /**\r\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\r\n * If `actionsWhitelist` specified, `actionsBlacklist` is ignored.\r\n */\r\n actionsBlacklist?: string | string[]\r\n /**\r\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\r\n * If `actionsWhitelist` specified, `actionsBlacklist` is ignored.\r\n */\r\n actionsWhitelist?: string | string[]\r\n /**\r\n * called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor.\r\n * Use it as a more advanced version of `actionsBlacklist`/`actionsWhitelist` parameters.\r\n */\r\n predicate?: <S, A extends Action>(state: S, action: A) => boolean\r\n /**\r\n * if specified as `false`, it will not record the changes till clicking on `Start recording` button.\r\n * Available only for Redux enhancer, for others use `autoPause`.\r\n *\r\n * @default true\r\n */\r\n shouldRecordChanges?: boolean\r\n /**\r\n * if specified, whenever clicking on `Pause recording` button and there are actions in the history log, will add this action type.\r\n * If not specified, will commit when paused. Available only for Redux enhancer.\r\n *\r\n * @default \"@@PAUSED\"\"\r\n */\r\n pauseActionType?: string\r\n /**\r\n * auto pauses when the extension’s window is not opened, and so has zero impact on your app when not in use.\r\n * Not available for Redux enhancer (as it already does it but storing the data to be sent).\r\n *\r\n * @default false\r\n */\r\n autoPause?: boolean\r\n /**\r\n * if specified as `true`, it will not allow any non-monitor actions to be dispatched till clicking on `Unlock changes` button.\r\n * Available only for Redux enhancer.\r\n *\r\n * @default false\r\n */\r\n shouldStartLocked?: boolean\r\n /**\r\n * if set to `false`, will not recompute the states on hot reloading (or on replacing the reducers). Available only for Redux enhancer.\r\n *\r\n * @default true\r\n */\r\n shouldHotReload?: boolean\r\n /**\r\n * if specified as `true`, whenever there's an exception in reducers, the monitors will show the error message, and next actions will not be dispatched.\r\n *\r\n * @default false\r\n */\r\n shouldCatchErrors?: boolean\r\n /**\r\n * If you want to restrict the extension, specify the features you allow.\r\n * If not specified, all of the features are enabled. When set as an object, only those included as `true` will be allowed.\r\n * Note that except `true`/`false`, `import` and `export` can be set as `custom` (which is by default for Redux enhancer), meaning that the importing/exporting occurs on the client side.\r\n * Otherwise, you'll get/set the data right from the monitor part.\r\n */\r\n features?: {\r\n /**\r\n * start/pause recording of dispatched actions\r\n */\r\n pause?: boolean\r\n /**\r\n * lock/unlock dispatching actions and side effects\r\n */\r\n lock?: boolean\r\n /**\r\n * persist states on page reloading\r\n */\r\n persist?: boolean\r\n /**\r\n * export history of actions in a file\r\n */\r\n export?: boolean | 'custom'\r\n /**\r\n * import history of actions from a file\r\n */\r\n import?: boolean | 'custom'\r\n /**\r\n * jump back and forth (time travelling)\r\n */\r\n jump?: boolean\r\n /**\r\n * skip (cancel) actions\r\n */\r\n skip?: boolean\r\n /**\r\n * drag and drop actions in the history list\r\n */\r\n reorder?: boolean\r\n /**\r\n * dispatch custom actions or action creators\r\n */\r\n dispatch?: boolean\r\n /**\r\n * generate tests for the selected actions\r\n */\r\n test?: boolean\r\n }\r\n /**\r\n * Set to true or a stacktrace-returning function to record call stack traces for dispatched actions.\r\n * Defaults to false.\r\n */\r\n trace?: boolean | (<A extends Action>(action: A) => string)\r\n /**\r\n * The maximum number of stack trace entries to record per action. Defaults to 10.\r\n */\r\n traceLimit?: number\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport const composeWithDevTools: {\r\n (options: EnhancerOptions): typeof compose\r\n <StoreExt>(...funcs: Array<StoreEnhancer<StoreExt>>): StoreEnhancer<StoreExt>\r\n} =\r\n typeof window !== 'undefined' &&\r\n (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\r\n ? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\r\n : function() {\r\n if (arguments.length === 0) return undefined\r\n if (typeof arguments[0] === 'object') return compose\r\n return compose.apply(null, (arguments as any) as Function[])\r\n }\r\n\r\n/**\r\n * @public\r\n */\r\nexport const devToolsEnhancer: {\r\n (options: EnhancerOptions): StoreEnhancer<any>\r\n} =\r\n typeof window !== 'undefined' && (window as any).__REDUX_DEVTOOLS_EXTENSION__\r\n ? (window as any).__REDUX_DEVTOOLS_EXTENSION__\r\n : function() {\r\n return function(noop) {\r\n return noop\r\n }\r\n }\r\n","/**\r\n * Returns true if the passed value is \"plain\" object, i.e. an object whose\r\n * protoype is the root `Object.prototype`. This includes objects created\r\n * using object literals, but not for instance for class instances.\r\n *\r\n * @param {any} value The value to inspect.\r\n * @returns {boolean} True if the argument appears to be a plain object.\r\n */\r\nexport default function isPlainObject(value: unknown): value is object {\r\n if (typeof value !== 'object' || value === null) return false\r\n\r\n let proto = value\r\n while (Object.getPrototypeOf(proto) !== null) {\r\n proto = Object.getPrototypeOf(proto)\r\n }\r\n\r\n return Object.getPrototypeOf(value) === proto\r\n}\r\n","function createThunkMiddleware(extraArgument) {\n return function (_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n if (typeof action === 'function') {\n return action(dispatch, getState, extraArgument);\n }\n\n return next(action);\n };\n };\n };\n}\n\nvar thunk = createThunkMiddleware();\nthunk.withExtraArgument = createThunkMiddleware;\n\nexport default thunk;","import isPlainObject from './isPlainObject'\r\nimport { Middleware } from 'redux'\r\n\r\n/**\r\n * Returns true if the passed value is \"plain\", i.e. a value that is either\r\n * directly JSON-serializable (boolean, number, string, array, plain object)\r\n * or `undefined`.\r\n *\r\n * @param val The value to check.\r\n *\r\n * @public\r\n */\r\nexport function isPlain(val: any) {\r\n return (\r\n typeof val === 'undefined' ||\r\n val === null ||\r\n typeof val === 'string' ||\r\n typeof val === 'boolean' ||\r\n typeof val === 'number' ||\r\n Array.isArray(val) ||\r\n isPlainObject(val)\r\n )\r\n}\r\n\r\ninterface NonSerializableValue {\r\n keyPath: string\r\n value: unknown\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport function findNonSerializableValue(\r\n value: unknown,\r\n path: ReadonlyArray<string> = [],\r\n isSerializable: (value: unknown) => boolean = isPlain,\r\n getEntries?: (value: unknown) => [string, any][],\r\n ignoredPaths: string[] = []\r\n): NonSerializableValue | false {\r\n let foundNestedSerializable: NonSerializableValue | false\r\n\r\n if (!isSerializable(value)) {\r\n return {\r\n keyPath: path.join('.') || '<root>',\r\n value: value\r\n }\r\n }\r\n\r\n if (typeof value !== 'object' || value === null) {\r\n return false\r\n }\r\n\r\n const entries = getEntries != null ? getEntries(value) : Object.entries(value)\r\n\r\n const hasIgnoredPaths = ignoredPaths.length > 0\r\n\r\n for (const [property, nestedValue] of entries) {\r\n const nestedPath = path.concat(property)\r\n\r\n if (hasIgnoredPaths && ignoredPaths.indexOf(nestedPath.join('.')) >= 0) {\r\n continue\r\n }\r\n\r\n if (!isSerializable(nestedValue)) {\r\n return {\r\n keyPath: nestedPath.join('.'),\r\n value: nestedValue\r\n }\r\n }\r\n\r\n if (typeof nestedValue === 'object') {\r\n foundNestedSerializable = findNonSerializableValue(\r\n nestedValue,\r\n nestedPath,\r\n isSerializable,\r\n getEntries,\r\n ignoredPaths\r\n )\r\n\r\n if (foundNestedSerializable) {\r\n return foundNestedSerializable\r\n }\r\n }\r\n }\r\n\r\n return false\r\n}\r\n\r\n/**\r\n * Options for `createSerializableStateInvariantMiddleware()`.\r\n *\r\n * @public\r\n */\r\nexport interface SerializableStateInvariantMiddlewareOptions {\r\n /**\r\n * The function to check if a value is considered serializable. This\r\n * function is applied recursively to every value contained in the\r\n * state. Defaults to `isPlain()`.\r\n */\r\n isSerializable?: (value: any) => boolean\r\n /**\r\n * The function that will be used to retrieve entries from each\r\n * value. If unspecified, `Object.entries` will be used. Defaults\r\n * to `undefined`.\r\n */\r\n getEntries?: (value: any) => [string, any][]\r\n\r\n /**\r\n * An array of action types to ignore when checking for serializability, Defaults to []\r\n */\r\n ignoredActions?: string[]\r\n\r\n /**\r\n * An array of dot-separated path strings to ignore when checking for serializability, Defaults to []\r\n */\r\n ignoredPaths?: string[]\r\n}\r\n\r\n/**\r\n * Creates a middleware that, after every state change, checks if the new\r\n * state is serializable. If a non-serializable value is found within the\r\n * state, an error is printed to the console.\r\n *\r\n * @param options Middleware options.\r\n *\r\n * @public\r\n */\r\nexport function createSerializableStateInvariantMiddleware(\r\n options: SerializableStateInvariantMiddlewareOptions = {}\r\n): Middleware {\r\n const {\r\n isSerializable = isPlain,\r\n getEntries,\r\n ignoredActions = [],\r\n ignoredPaths = []\r\n } = options\r\n\r\n return storeAPI => next => action => {\r\n if (ignoredActions.length && ignoredActions.indexOf(action.type) !== -1) {\r\n return next(action)\r\n }\r\n\r\n const foundActionNonSerializableValue = findNonSerializableValue(\r\n action,\r\n [],\r\n isSerializable,\r\n getEntries\r\n )\r\n\r\n if (foundActionNonSerializableValue) {\r\n const { keyPath, value } = foundActionNonSerializableValue\r\n\r\n console.error(\r\n `A non-serializable value was detected in an action, in the path: \\`${keyPath}\\`. Value:`,\r\n value,\r\n '\\nTake a look at the logic that dispatched this action: ',\r\n action,\r\n '\\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)'\r\n )\r\n }\r\n\r\n const result = next(action)\r\n\r\n const state = storeAPI.getState()\r\n\r\n const foundStateNonSerializableValue = findNonSerializableValue(\r\n state,\r\n [],\r\n isSerializable,\r\n getEntries,\r\n ignoredPaths\r\n )\r\n\r\n if (foundStateNonSerializableValue) {\r\n const { keyPath, value } = foundStateNonSerializableValue\r\n\r\n console.error(\r\n `A non-serializable value was detected in the state, in the path: \\`${keyPath}\\`. Value:`,\r\n value,\r\n `\r\nTake a look at the reducer(s) handling this action type: ${action.type}.\r\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`\r\n )\r\n }\r\n\r\n return result\r\n }\r\n}\r\n","import { Middleware, AnyAction } from 'redux'\r\nimport thunkMiddleware, { ThunkMiddleware } from 'redux-thunk'\r\nimport {\r\n /* PROD_START_REMOVE_UMD */\r\n createImmutableStateInvariantMiddleware,\r\n /* PROD_STOP_REMOVE_UMD */\r\n ImmutableStateInvariantMiddlewareOptions\r\n} from './immutableStateInvariantMiddleware'\r\n\r\nimport {\r\n createSerializableStateInvariantMiddleware,\r\n SerializableStateInvariantMiddlewareOptions\r\n} from './serializableStateInvariantMiddleware'\r\n\r\nfunction isBoolean(x: any): x is boolean {\r\n return typeof x === 'boolean'\r\n}\r\n\r\ninterface ThunkOptions<E = any> {\r\n extraArgument: E\r\n}\r\n\r\ninterface GetDefaultMiddlewareOptions {\r\n thunk?: boolean | ThunkOptions\r\n immutableCheck?: boolean | ImmutableStateInvariantMiddlewareOptions\r\n serializableCheck?: boolean | SerializableStateInvariantMiddlewareOptions\r\n}\r\n\r\nexport type ThunkMiddlewareFor<\r\n S,\r\n O extends GetDefaultMiddlewareOptions = {}\r\n> = O extends {\r\n thunk: false\r\n}\r\n ? never\r\n : O extends { thunk: { extraArgument: infer E } }\r\n ? ThunkMiddleware<S, AnyAction, E>\r\n :\r\n | ThunkMiddleware<S, AnyAction, null> //The ThunkMiddleware with a `null` ExtraArgument is here to provide backwards-compatibility.\r\n | ThunkMiddleware<S, AnyAction>\r\n\r\n/**\r\n * Returns any array containing the default middleware installed by\r\n * `configureStore()`. Useful if you want to configure your store with a custom\r\n * `middleware` array but still keep the default set.\r\n *\r\n * @return The default middleware used by `configureStore()`.\r\n *\r\n * @public\r\n */\r\nexport function getDefaultMiddleware<\r\n S = any,\r\n O extends Partial<GetDefaultMiddlewareOptions> = {\r\n thunk: true\r\n immutableCheck: true\r\n serializableCheck: true\r\n }\r\n>(options: O = {} as O): Array<Middleware<{}, S> | ThunkMiddlewareFor<S, O>> {\r\n const {\r\n thunk = true,\r\n immutableCheck = true,\r\n serializableCheck = true\r\n } = options\r\n\r\n let middlewareArray: Middleware<{}, S>[] = []\r\n\r\n if (thunk) {\r\n if (isBoolean(thunk)) {\r\n middlewareArray.push(thunkMiddleware)\r\n } else {\r\n middlewareArray.push(\r\n thunkMiddleware.withExtraArgument(thunk.extraArgument)\r\n )\r\n }\r\n }\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (immutableCheck) {\r\n /* PROD_START_REMOVE_UMD */\r\n let immutableOptions: ImmutableStateInvariantMiddlewareOptions = {}\r\n\r\n if (!isBoolean(immutableCheck)) {\r\n immutableOptions = immutableCheck\r\n }\r\n\r\n middlewareArray.unshift(\r\n createImmutableStateInvariantMiddleware(immutableOptions)\r\n )\r\n /* PROD_STOP_REMOVE_UMD */\r\n }\r\n\r\n if (serializableCheck) {\r\n let serializableOptions: SerializableStateInvariantMiddlewareOptions = {}\r\n\r\n if (!isBoolean(serializableCheck)) {\r\n serializableOptions = serializableCheck\r\n }\r\n\r\n middlewareArray.push(\r\n createSerializableStateInvariantMiddleware(serializableOptions)\r\n )\r\n }\r\n }\r\n\r\n return middlewareArray as any\r\n}\r\n","import { Action } from 'redux'\r\nimport {\r\n IsUnknownOrNonInferrable,\r\n IfMaybeUndefined,\r\n IfVoid,\r\n IsAny\r\n} from './tsHelpers'\r\nimport isPlainObject from './isPlainObject'\r\n\r\n/**\r\n * An action with a string type and an associated payload. This is the\r\n * type of action returned by `createAction()` action creators.\r\n *\r\n * @template P The type of the action's payload.\r\n * @template T the type used for the action type.\r\n * @template M The type of the action's meta (optional)\r\n * @template E The type of the action's error (optional)\r\n *\r\n * @public\r\n */\r\nexport type PayloadAction<\r\n P = void,\r\n T extends string = string,\r\n M = never,\r\n E = never\r\n> = {\r\n payload: P\r\n type: T\r\n} & ([M] extends [never]\r\n ? {}\r\n : {\r\n meta: M\r\n }) &\r\n ([E] extends [never]\r\n ? {}\r\n : {\r\n error: E\r\n })\r\n\r\n/**\r\n * A \"prepare\" method to be used as the second parameter of `createAction`.\r\n * Takes any number of arguments and returns a Flux Standard Action without\r\n * type (will be added later) that *must* contain a payload (might be undefined).\r\n *\r\n * @public\r\n */\r\nexport type PrepareAction<P> =\r\n | ((...args: any[]) => { payload: P })\r\n | ((...args: any[]) => { payload: P; meta: any })\r\n | ((...args: any[]) => { payload: P; error: any })\r\n | ((...args: any[]) => { payload: P; meta: any; error: any })\r\n\r\n/**\r\n * Internal version of `ActionCreatorWithPreparedPayload`. Not to be used externally.\r\n *\r\n * @internal\r\n */\r\nexport type _ActionCreatorWithPreparedPayload<\r\n PA extends PrepareAction<any> | void,\r\n T extends string = string\r\n> = PA extends PrepareAction<infer P>\r\n ? ActionCreatorWithPreparedPayload<\r\n Parameters<PA>,\r\n P,\r\n T,\r\n ReturnType<PA> extends {\r\n error: infer E\r\n }\r\n ? E\r\n : never,\r\n ReturnType<PA> extends {\r\n meta: infer M\r\n }\r\n ? M\r\n : never\r\n >\r\n : void\r\n\r\n/**\r\n * Basic type for all action creators.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n */\r\ninterface BaseActionCreator<P, T extends string, M = never, E = never> {\r\n type: T\r\n match(action: Action<unknown>): action is PayloadAction<P, T, M, E>\r\n}\r\n\r\n/**\r\n * An action creator that takes multiple arguments that are passed\r\n * to a `PrepareAction` method to create the final Action.\r\n * @typeParam Args arguments for the action creator function\r\n * @typeParam P `payload` type\r\n * @typeParam T `type` name\r\n * @typeParam E optional `error` type\r\n * @typeParam M optional `meta` type\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithPreparedPayload<\r\n Args extends unknown[],\r\n P,\r\n T extends string = string,\r\n E = never,\r\n M = never\r\n> extends BaseActionCreator<P, T, M, E> {\r\n /**\r\n * Calling this {@link redux#ActionCreator} with `Args` will return\r\n * an Action with a payload of type `P` and (depending on the `PrepareAction`\r\n * method used) a `meta`- and `error` property of types `M` and `E` respectively.\r\n */\r\n (...args: Args): PayloadAction<P, T, M, E>\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that takes an optional payload of type `P`.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithOptionalPayload<P, T extends string = string>\r\n extends BaseActionCreator<P, T> {\r\n /**\r\n * Calling this {@link redux#ActionCreator} without arguments will\r\n * return a {@link PayloadAction} of type `T` with a payload of `undefined`\r\n */\r\n (payload?: undefined): PayloadAction<undefined, T>\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload of `P`\r\n */\r\n <PT extends Diff<P, undefined>>(payload?: PT): PayloadAction<PT, T>\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that takes no payload.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithoutPayload<T extends string = string>\r\n extends BaseActionCreator<undefined, T> {\r\n /**\r\n * Calling this {@link redux#ActionCreator} will\r\n * return a {@link PayloadAction} of type `T` with a payload of `undefined`\r\n */\r\n (): PayloadAction<undefined, T>\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that requires a payload of type P.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithPayload<P, T extends string = string>\r\n extends BaseActionCreator<P, T> {\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload of `P`\r\n * If possible, `P` will be narrowed down to the exact type of the payload argument.\r\n */\r\n <PT extends P>(payload: PT): PayloadAction<PT, T>\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload of `P`\r\n */\r\n (payload: P): PayloadAction<P, T>\r\n}\r\n\r\n/**\r\n * An action creator of type `T` whose `payload` type could not be inferred. Accepts everything as `payload`.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithNonInferrablePayload<\r\n T extends string = string\r\n> extends BaseActionCreator<unknown, T> {\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload\r\n * of exactly the type of the argument.\r\n */\r\n <PT extends unknown>(payload: PT): PayloadAction<PT, T>\r\n}\r\n\r\n/**\r\n * An action creator that produces actions with a `payload` attribute.\r\n *\r\n * @typeParam P the `payload` type\r\n * @typeParam T the `type` of the resulting action\r\n * @typeParam PA if the resulting action is preprocessed by a `prepare` method, the signature of said method.\r\n *\r\n * @public\r\n */\r\nexport type PayloadActionCreator<\r\n P = void,\r\n T extends string = string,\r\n PA extends PrepareAction<P> | void = void\r\n> = IfPrepareActionMethodProvided<\r\n PA,\r\n _ActionCreatorWithPreparedPayload<PA, T>,\r\n // else\r\n IsAny<\r\n P,\r\n ActionCreatorWithPayload<any, T>,\r\n IsUnknownOrNonInferrable<\r\n P,\r\n ActionCreatorWithNonInferrablePayload<T>,\r\n // else\r\n IfVoid<\r\n P,\r\n ActionCreatorWithoutPayload<T>,\r\n // else\r\n IfMaybeUndefined<\r\n P,\r\n ActionCreatorWithOptionalPayload<P, T>,\r\n // else\r\n ActionCreatorWithPayload<P, T>\r\n >\r\n >\r\n >\r\n >\r\n>\r\n\r\n/**\r\n * A utility function to create an action creator for the given action type\r\n * string. The action creator accepts a single argument, which will be included\r\n * in the action object as a field called payload. The action creator function\r\n * will also have its toString() overriden so that it returns the action type,\r\n * allowing it to be used in reducer logic that is looking for that action type.\r\n *\r\n * @param type The action type to use for created actions.\r\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\r\n * If this is given, the resulting action creator will pass it's arguments to this method to calculate payload & meta.\r\n *\r\n * @public\r\n */\r\nexport function createAction<P = void, T extends string = string>(\r\n type: T\r\n): PayloadActionCreator<P, T>\r\n\r\n/**\r\n * A utility function to create an action creator for the given action type\r\n * string. The action creator accepts a single argument, which will be included\r\n * in the action object as a field called payload. The action creator function\r\n * will also have its toString() overriden so that it returns the action type,\r\n * allowing it to be used in reducer logic that is looking for that action type.\r\n *\r\n * @param type The action type to use for created actions.\r\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\r\n * If this is given, the resulting action creator will pass it's arguments to this method to calculate payload & meta.\r\n *\r\n * @public\r\n */\r\nexport function createAction<\r\n PA extends PrepareAction<any>,\r\n T extends string = string\r\n>(\r\n type: T,\r\n prepareAction: PA\r\n): PayloadActionCreator<ReturnType<PA>['payload'], T, PA>\r\n\r\nexport function createAction(type: string, prepareAction?: Function): any {\r\n function actionCreator(...args: any[]) {\r\n if (prepareAction) {\r\n let prepared = prepareAction(...args)\r\n if (!prepared) {\r\n throw new Error('prepareAction did not return an object')\r\n }\r\n\r\n return {\r\n type,\r\n payload: prepared.payload,\r\n ...('meta' in prepared && { meta: prepared.meta }),\r\n ...('error' in prepared && { error: prepared.error })\r\n }\r\n }\r\n return { type, payload: args[0] }\r\n }\r\n\r\n actionCreator.toString = () => `${type}`\r\n\r\n actionCreator.type = type\r\n\r\n actionCreator.match = (action: Action<unknown>): action is PayloadAction =>\r\n action.type === type\r\n\r\n return actionCreator\r\n}\r\n\r\nexport function isFSA(\r\n action: unknown\r\n): action is {\r\n type: string\r\n payload?: unknown\r\n error?: unknown\r\n meta?: unknown\r\n} {\r\n return (\r\n isPlainObject(action) &&\r\n typeof (action as any).type === 'string' &&\r\n Object.keys(action).every(isValidKey)\r\n )\r\n}\r\n\r\nfunction isValidKey(key: string) {\r\n return ['type', 'payload', 'error', 'meta'].indexOf(key) > -1\r\n}\r\n\r\n/**\r\n * Returns the action type of the actions created by the passed\r\n * `createAction()`-generated action creator (arbitrary action creators\r\n * are not supported).\r\n *\r\n * @param action The action creator whose action type to get.\r\n * @returns The action type used by the action creator.\r\n *\r\n * @public\r\n */\r\nexport function getType<T extends string>(\r\n actionCreator: PayloadActionCreator<any, T>\r\n): T {\r\n return `${actionCreator}` as T\r\n}\r\n\r\n// helper types for more readable typings\r\n\r\ntype Diff<T, U> = T extends U ? never : T\r\n\r\ntype IfPrepareActionMethodProvided<\r\n PA extends PrepareAction<any> | void,\r\n True,\r\n False\r\n> = PA extends (...args: any[]) => any ? True : False\r\n","import { Action } from 'redux'\r\nimport { CaseReducer, CaseReducers } from './createReducer'\r\n\r\nexport interface TypedActionCreator<Type extends string> {\r\n (...args: any[]): Action<Type>\r\n type: Type\r\n}\r\n\r\n/**\r\n * A builder for an action <-> reducer map.\r\n *\r\n * @public\r\n */\r\nexport interface ActionReducerMapBuilder<State> {\r\n /**\r\n * Add a case reducer for actions created by this action creator.\r\n * @param actionCreator\r\n * @param reducer\r\n */\r\n addCase<ActionCreator extends TypedActionCreator<string>>(\r\n actionCreator: ActionCreator,\r\n reducer: CaseReducer<State, ReturnType<ActionCreator>>\r\n ): ActionReducerMapBuilder<State>\r\n /**\r\n * Add a case reducer for actions with the specified type.\r\n * @param type\r\n * @param reducer\r\n */\r\n addCase<Type extends string, A extends Action<Type>>(\r\n type: Type,\r\n reducer: CaseReducer<State, A>\r\n ): ActionReducerMapBuilder<State>\r\n}\r\n\r\nexport function executeReducerBuilderCallback<S>(\r\n builderCallback: (builder: ActionReducerMapBuilder<S>) => void\r\n): CaseReducers<S, any> {\r\n const actionsMap: CaseReducers<S, any> = {}\r\n const builder = {\r\n addCase(\r\n typeOrActionCreator: string | TypedActionCreator<any>,\r\n reducer: CaseReducer<S>\r\n ) {\r\n const type =\r\n typeof typeOrActionCreator === 'string'\r\n ? typeOrActionCreator\r\n : typeOrActionCreator.type\r\n if (type in actionsMap) {\r\n throw new Error(\r\n 'addCase cannot be called with two reducers for the same action type'\r\n )\r\n }\r\n actionsMap[type] = reducer\r\n return builder\r\n }\r\n }\r\n builderCallback(builder)\r\n return actionsMap\r\n}\r\n","import createNextState, { Draft } from 'immer'\r\nimport { AnyAction, Action, Reducer } from 'redux'\r\nimport {\r\n executeReducerBuilderCallback,\r\n ActionReducerMapBuilder\r\n} from './mapBuilders'\r\n\r\n/**\r\n * Defines a mapping from action types to corresponding action object shapes.\r\n *\r\n * @deprecated This should not be used manually - it is only used for internal\r\n * inference purposes and should not have any further value.\r\n * It might be removed in the future.\r\n * @public\r\n */\r\nexport type Actions<T extends keyof any = string> = Record<T, Action>\r\n\r\n/**\r\n * An *case reducer* is a reducer function for a specific action type. Case\r\n * reducers can be composed to full reducers using `createReducer()`.\r\n *\r\n * Unlike a normal Redux reducer, a case reducer is never called with an\r\n * `undefined` state to determine the initial state. Instead, the initial\r\n * state is explicitly specified as an argument to `createReducer()`.\r\n *\r\n * In addition, a case reducer can choose to mutate the passed-in `state`\r\n * value directly instead of returning a new state. This does not actually\r\n * cause the store state to be mutated directly; instead, thanks to\r\n * [immer](https://github.com/mweststrate/immer), the mutations are\r\n * translated to copy operations that result in a new state.\r\n *\r\n * @public\r\n */\r\nexport type CaseReducer<S = any, A extends Action = AnyAction> = (\r\n state: Draft<S>,\r\n action: A\r\n) => S | void\r\n\r\n/**\r\n * A mapping from action types to case reducers for `createReducer()`.\r\n *\r\n * @deprecated This should not be used manually - it is only used\r\n * for internal inference purposes and using it manually\r\n * would lead to type erasure.\r\n * It might be removed in the future.\r\n * @public\r\n */\r\nexport type CaseReducers<S, AS extends Actions> = {\r\n [T in keyof AS]: AS[T] extends Action ? CaseReducer<S, AS[T]> : void\r\n}\r\n\r\n/**\r\n * A utility function that allows defining a reducer as a mapping from action\r\n * type to *case reducer* functions that handle these action types. The\r\n * reducer's initial state is passed as the first argument.\r\n *\r\n * The body of every case reducer is implicitly wrapped with a call to\r\n * `produce()` from the [immer](https://github.com/mweststrate/immer) library.\r\n * This means that rather than returning a new state object, you can also\r\n * mutate the passed-in state object directly; these mutations will then be\r\n * automatically and efficiently translated into copies, giving you both\r\n * convenience and immutability.\r\n *\r\n * @param initialState The initial state to be returned by the reducer.\r\n * @param actionsMap A mapping from action types to action-type-specific\r\n * case reducers.\r\n *\r\n * @public\r\n */\r\nexport function createReducer<\r\n S,\r\n CR extends CaseReducers<S, any> = CaseReducers<S, any>\r\n>(initialState: S, actionsMap: CR): Reducer<S>\r\n/**\r\n * A utility function that allows defining a reducer as a mapping from action\r\n * type to *case reducer* functions that handle these action types. The\r\n * reducer's initial state is passed as the first argument.\r\n *\r\n * The body of every case reducer is implicitly wrapped with a call to\r\n * `produce()` from the [immer](https://github.com/mweststrate/immer) library.\r\n * This means that rather than returning a new state object, you can also\r\n * mutate the passed-in state object directly; these mutations will then be\r\n * automatically and efficiently translated into copies, giving you both\r\n * convenience and immutability.\r\n * @param initialState The initial state to be returned by the reducer.\r\n * @param builderCallback A callback that receives a *builder* object to define\r\n * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`.\r\n *\r\n * @public\r\n */\r\nexport function createReducer<S>(\r\n initialState: S,\r\n builderCallback: (builder: ActionReducerMapBuilder<S>) => void\r\n): Reducer<S>\r\n\r\nexport function createReducer<S>(\r\n initialState: S,\r\n mapOrBuilderCallback:\r\n | CaseReducers<S, any>\r\n | ((builder: ActionReducerMapBuilder<S>) => void)\r\n): Reducer<S> {\r\n let actionsMap =\r\n typeof mapOrBuilderCallback === 'function'\r\n ? executeReducerBuilderCallback(mapOrBuilderCallback)\r\n : mapOrBuilderCallback\r\n\r\n return function(state = initialState, action): S {\r\n // @ts-ignore createNextState() produces an Immutable<Draft<S>> rather\r\n // than an Immutable<S>, and TypeScript cannot find out how to reconcile\r\n // these two types.\r\n return createNextState(state, (draft: Draft<S>) => {\r\n const caseReducer = actionsMap[action.type]\r\n return caseReducer ? caseReducer(draft, action) : undefined\r\n })\r\n }\r\n}\r\n","import createNextState, { isDraft } from 'immer'\r\nimport { EntityState } from './models'\r\nimport { PayloadAction, isFSA } from '../createAction'\r\n\r\nexport function createStateOperator<V, R>(\r\n mutator: (arg: R, state: EntityState<V>) => void\r\n) {\r\n return function operation<S extends EntityState<V>>(\r\n state: S,\r\n arg: R | PayloadAction<R>\r\n ): S {\r\n function isPayloadActionArgument(\r\n arg: R | PayloadAction<R>\r\n ): arg is PayloadAction<R> {\r\n return isFSA(arg)\r\n }\r\n\r\n const runMutator = (draft: EntityState<V>) => {\r\n if (isPayloadActionArgument(arg)) {\r\n mutator(arg.payload, draft)\r\n } else {\r\n mutator(arg, draft)\r\n }\r\n }\r\n\r\n if (isDraft(state)) {\r\n // we must already be inside a `createNextState` call, likely because\r\n // this is being wrapped in `createReducer` or `createSlice`.\r\n // It's safe to just pass the draft to the mutator.\r\n runMutator(state)\r\n\r\n // since it's a draft, we'll just return it\r\n return state\r\n } else {\r\n // @ts-ignore createNextState() produces an Immutable<Draft<S>> rather\r\n // than an Immutable<S>, and TypeScript cannot find out how to reconcile\r\n // these two types.\r\n return createNextState(state, runMutator)\r\n }\r\n }\r\n}\r\n","import { IdSelector } from './models'\r\n\r\nexport function selectIdValue<T>(entity: T, selectId: IdSelector<T>) {\r\n const key = selectId(entity)\r\n\r\n if (process.env.NODE_ENV !== 'production' && key === undefined) {\r\n console.warn(\r\n 'The entity passed to the `selectId` implementation returned undefined.',\r\n 'You should probably provide your own `selectId` implementation.',\r\n 'The entity that was passed:',\r\n entity,\r\n 'The `selectId` implementation:',\r\n selectId.toString()\r\n )\r\n }\r\n\r\n return key\r\n}\r\n","import {\r\n EntityState,\r\n EntityStateAdapter,\r\n IdSelector,\r\n Update,\r\n EntityMap,\r\n EntityId\r\n} from './models'\r\nimport { createStateOperator } from './state_adapter'\r\nimport { selectIdValue } from './utils'\r\n\r\nexport function createUnsortedStateAdapter<T>(\r\n selectId: IdSelector<T>\r\n): EntityStateAdapter<T> {\r\n type R = EntityState<T>\r\n\r\n function addOneMutably(entity: T, state: EntityState<T>): void {\r\n const key = selectIdValue(entity, selectId)\r\n\r\n if (key in state.entities) {\r\n return\r\n }\r\n\r\n state.ids.push(key)\r\n state.entities[key] = entity\r\n }\r\n\r\n function addManyMutably(entities: T[], state: R): void {\r\n for (const entity of entities) {\r\n addOneMutably(entity, state)\r\n }\r\n }\r\n\r\n function setAllMutably(entities: T[], state: R): void {\r\n state.ids = []\r\n state.entities = {}\r\n\r\n addManyMutably(entities, state)\r\n }\r\n\r\n function removeOneMutably(key: EntityId, state: R): void {\r\n return removeManyMutably([key], state)\r\n }\r\n\r\n function removeManyMutably(keys: EntityId[], state: R): void {\r\n let didMutate = false\r\n\r\n keys.forEach(key => {\r\n if (key in state.entities) {\r\n delete state.entities[key]\r\n didMutate = true\r\n }\r\n })\r\n\r\n if (didMutate) {\r\n state.ids = state.ids.filter(id => id in state.entities)\r\n }\r\n }\r\n\r\n function removeAll<S extends R>(state: S): S {\r\n return Object.assign({}, state, {\r\n ids: [],\r\n entities: {}\r\n })\r\n }\r\n\r\n function takeNewKey(\r\n keys: { [id: string]: EntityId },\r\n update: Update<T>,\r\n state: R\r\n ): boolean {\r\n const original = state.entities[update.id]\r\n const updated: T = Object.assign({}, original, update.changes)\r\n const newKey = selectIdValue(updated, selectId)\r\n const hasNewKey = newKey !== update.id\r\n\r\n if (hasNewKey) {\r\n keys[update.id] = newKey\r\n delete state.entities[update.id]\r\n }\r\n\r\n state.entities[newKey] = updated\r\n\r\n return hasNewKey\r\n }\r\n\r\n function updateOneMutably(update: Update<T>, state: R): void {\r\n return updateManyMutably([update], state)\r\n }\r\n\r\n function updateManyMutably(updates: Update<T>[], state: R): void {\r\n const newKeys: { [id: string]: EntityId } = {}\r\n\r\n const updatesPerEntity: { [id: string]: Update<T> } = {}\r\n\r\n updates.forEach(update => {\r\n // Only apply updates to entities that currently exist\r\n if (update.id in state.entities) {\r\n // If there are multiple updates to one entity, merge them together\r\n updatesPerEntity[update.id] = {\r\n // Spreads ignore falsy values, so this works even if there isn't\r\n // an existing update already at this key\r\n ...updatesPerEntity[update.id],\r\n ...update\r\n }\r\n }\r\n })\r\n\r\n updates = Object.values(updatesPerEntity)\r\n\r\n const didMutateEntities = updates.length > 0\r\n\r\n if (didMutateEntities) {\r\n const didMutateIds =\r\n updates.filter(update => takeNewKey(newKeys, update, state)).length > 0\r\n\r\n if (didMutateIds) {\r\n state.ids = state.ids.map(id => newKeys[id] || id)\r\n }\r\n }\r\n }\r\n\r\n function mapMutably(map: EntityMap<T>, state: R): void {\r\n const changes: Update<T>[] = state.ids.reduce(\r\n (changes: Update<T>[], id: EntityId) => {\r\n const change = map(state.entities[id]!)\r\n if (change !== state.entities[id]) {\r\n changes.push({ id, changes: change })\r\n }\r\n return changes\r\n },\r\n []\r\n )\r\n const updates = changes.filter(({ id }) => id in state.entities)\r\n\r\n return updateManyMutably(updates, state)\r\n }\r\n\r\n function upsertOneMutably(entity: T, state: R): void {\r\n return upsertManyMutably([entity], state)\r\n }\r\n\r\n function upsertManyMutably(entities: T[], state: R): void {\r\n const added: T[] = []\r\n const updated: Update<T>[] = []\r\n\r\n for (const entity of entities) {\r\n const id = selectIdValue(entity, selectId)\r\n if (id in state.entities) {\r\n updated.push({ id, changes: entity })\r\n } else {\r\n added.push(entity)\r\n }\r\n }\r\n\r\n updateManyMutably(updated, state)\r\n addManyMutably(added, state)\r\n }\r\n\r\n return {\r\n removeAll,\r\n addOne: createStateOperator(addOneMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n upsertMany: createStateOperator(upsertManyMutably),\r\n removeOne: createStateOperator(removeOneMutably),\r\n removeMany: createStateOperator(removeManyMutably),\r\n map: createStateOperator(mapMutably)\r\n }\r\n}\r\n","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","// Borrowed from https://github.com/ai/nanoid/tree/master/non-secure\r\n// This alphabet uses a-z A-Z 0-9 _- symbols.\r\n// Symbols are generated for smaller size.\r\n// -_zyxwvutsrqponmlkjihgfedcba9876543210ZYXWVUTSRQPONMLKJIHGFEDCBA\r\nlet url = '-_'\r\n// Loop from 36 to 0 (from z to a and 9 to 0 in Base36).\r\nlet i = 36\r\nwhile (i--) {\r\n // 36 is radix. Number.prototype.toString(36) returns number\r\n // in Base36 representation. Base36 is like hex, but it uses 0–9 and a-z.\r\n url += i.toString(36)\r\n}\r\n// Loop from 36 to 10 (from Z to A in Base36).\r\ni = 36\r\nwhile (i-- - 10) {\r\n url += i.toString(36).toUpperCase()\r\n}\r\n\r\nexport function nanoid(size = 21) {\r\n let id = ''\r\n // Compact alternative for `for (var i = 0; i < size; i++)`\r\n while (size--) {\r\n // `| 0` is compact and faster alternative for `Math.floor()`\r\n id += url[(Math.random() * 64) | 0]\r\n }\r\n return id\r\n}\r\n","import { Dispatch, AnyAction } from 'redux'\r\nimport {\r\n createAction,\r\n PayloadAction,\r\n ActionCreatorWithPreparedPayload\r\n} from './createAction'\r\nimport { ThunkDispatch } from 'redux-thunk'\r\nimport { FallbackIfUnknown } from './tsHelpers'\r\nimport { nanoid } from './nanoid'\r\n\r\n// @ts-ignore we need the import of these types due to a bundling issue.\r\ntype _Keep = PayloadAction | ActionCreatorWithPreparedPayload<any, unknown>\r\n\r\nexport type BaseThunkAPI<S, E, D extends Dispatch = Dispatch> = {\r\n dispatch: D\r\n getState: () => S\r\n extra: E\r\n requestId: string\r\n signal: AbortSignal\r\n}\r\n\r\n/**\r\n * @alpha\r\n */\r\nexport interface SerializedError {\r\n name?: string\r\n message?: string\r\n stack?: string\r\n code?: string\r\n}\r\n\r\nconst commonProperties: (keyof SerializedError)[] = [\r\n 'name',\r\n 'message',\r\n 'stack',\r\n 'code'\r\n]\r\n\r\n// Reworked from https://github.com/sindresorhus/serialize-error\r\nexport const miniSerializeError = (value: any): any => {\r\n if (typeof value === 'object' && value !== null) {\r\n const simpleError: SerializedError = {}\r\n for (const property of commonProperties) {\r\n if (typeof value[property] === 'string') {\r\n simpleError[property] = value[property]\r\n }\r\n }\r\n\r\n return simpleError\r\n }\r\n\r\n return value\r\n}\r\n\r\ntype AsyncThunkConfig = {\r\n state?: unknown\r\n dispatch?: Dispatch\r\n extra?: unknown\r\n}\r\n\r\ntype GetState<ThunkApiConfig> = ThunkApiConfig extends {\r\n state: infer State\r\n}\r\n ? State\r\n : unknown\r\ntype GetExtra<ThunkApiConfig> = ThunkApiConfig extends { extra: infer Extra }\r\n ? Extra\r\n : unknown\r\ntype GetDispatch<ThunkApiConfig> = ThunkApiConfig extends {\r\n dispatch: infer Dispatch\r\n}\r\n ? FallbackIfUnknown<\r\n Dispatch,\r\n ThunkDispatch<\r\n GetState<ThunkApiConfig>,\r\n GetExtra<ThunkApiConfig>,\r\n AnyAction\r\n >\r\n >\r\n : ThunkDispatch<GetState<ThunkApiConfig>, GetExtra<ThunkApiConfig>, AnyAction>\r\n\r\ntype GetThunkAPI<ThunkApiConfig> = BaseThunkAPI<\r\n GetState<ThunkApiConfig>,\r\n GetExtra<ThunkApiConfig>,\r\n GetDispatch<ThunkApiConfig>\r\n>\r\n\r\n/**\r\n *\r\n * @param type\r\n * @param payloadCreator\r\n *\r\n * @alpha\r\n */\r\nexport function createAsyncThunk<\r\n Returned,\r\n ThunkArg = void,\r\n ThunkApiConfig extends AsyncThunkConfig = {}\r\n>(\r\n type: string,\r\n payloadCreator: (\r\n arg: ThunkArg,\r\n thunkAPI: GetThunkAPI<ThunkApiConfig>\r\n ) => Promise<Returned> | Returned\r\n) {\r\n const fulfilled = createAction(\r\n type + '/fulfilled',\r\n (result: Returned, requestId: string, arg: ThunkArg) => {\r\n return {\r\n payload: result,\r\n meta: { arg, requestId }\r\n }\r\n }\r\n )\r\n\r\n const pending = createAction(\r\n type + '/pending',\r\n (requestId: string, arg: ThunkArg) => {\r\n return {\r\n payload: undefined,\r\n meta: { arg, requestId }\r\n }\r\n }\r\n )\r\n\r\n const rejected = createAction(\r\n type + '/rejected',\r\n (error: Error, requestId: string, arg: ThunkArg) => {\r\n const aborted = error && error.name === 'AbortError'\r\n return {\r\n payload: undefined,\r\n error: miniSerializeError(error),\r\n meta: {\r\n arg,\r\n requestId,\r\n aborted\r\n }\r\n }\r\n }\r\n )\r\n\r\n function actionCreator(arg: ThunkArg) {\r\n return (\r\n dispatch: GetDispatch<ThunkApiConfig>,\r\n getState: () => GetState<ThunkApiConfig>,\r\n extra: GetExtra<ThunkApiConfig>\r\n ) => {\r\n const requestId = nanoid()\r\n\r\n const abortController = new AbortController()\r\n let abortReason: string | undefined\r\n\r\n const abortedPromise = new Promise<never>((_, reject) =>\r\n abortController.signal.addEventListener('abort', () =>\r\n reject({ name: 'AbortError', message: abortReason || 'Aborted' })\r\n )\r\n )\r\n\r\n function abort(reason?: string) {\r\n abortReason = reason\r\n abortController.abort()\r\n }\r\n\r\n const promise = (async function() {\r\n let finalAction: ReturnType<typeof fulfilled | typeof rejected>\r\n try {\r\n dispatch(pending(requestId, arg))\r\n finalAction = await Promise.race([\r\n abortedPromise,\r\n Promise.resolve(\r\n payloadCreator(arg, {\r\n dispatch,\r\n getState,\r\n extra,\r\n requestId,\r\n signal: abortController.signal\r\n })\r\n ).then(result => fulfilled(result, requestId, arg))\r\n ])\r\n } catch (err) {\r\n finalAction = rejected(err, requestId, arg)\r\n }\r\n // We dispatch the result action _after_ the catch, to avoid having any errors\r\n // here get swallowed by the try/catch block,\r\n // per https://twitter.com/dan_abramov/status/770914221638942720\r\n // and https://redux-toolkit.js.org/tutorials/advanced-tutorial#async-error-handling-logic-in-thunks\r\n\r\n dispatch(finalAction)\r\n return finalAction\r\n })()\r\n return Object.assign(promise, { abort })\r\n }\r\n }\r\n\r\n return Object.assign(actionCreator, {\r\n pending,\r\n rejected,\r\n fulfilled\r\n })\r\n}\r\n\r\n/**\r\n * @alpha\r\n */\r\nexport function unwrapResult<T>(\r\n returned: { error: any } | { payload: NonNullable<T> }\r\n): NonNullable<T> {\r\n if ('error' in returned) {\r\n throw returned.error\r\n }\r\n return returned.payload\r\n}\r\n","import {\n\tImmerState,\n\tDrafted,\n\tObjectish,\n\tES5ArrayState,\n\tES5ObjectState,\n\teach,\n\thas,\n\tisDraft,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tDRAFT_STATE,\n\tis,\n\tloadPlugin,\n\tImmerScope,\n\tcreateProxy,\n\tProxyTypeES5Array,\n\tProxyTypeES5Object,\n\tAnyObject,\n\tgetCurrentScope,\n\tdie\n} from \"../internal\"\n\ntype ES5State = ES5ArrayState | ES5ObjectState\n\nexport function enableES5() {\n\tfunction willFinalizeES5_(\n\t\tscope: ImmerScope,\n\t\tresult: any,\n\t\tisReplaced: boolean\n\t) {\n\t\tscope.drafts_!.forEach((draft: any) => {\n\t\t\t;(draft[DRAFT_STATE] as ES5State).finalizing_ = true\n\t\t})\n\t\tif (!isReplaced) {\n\t\t\tif (scope.patches_) {\n\t\t\t\tmarkChangesRecursively(scope.drafts_![0])\n\t\t\t}\n\t\t\t// This is faster when we don't care about which attributes changed.\n\t\t\tmarkChangesSweep(scope.drafts_)\n\t\t}\n\t\t// When a child draft is returned, look for changes.\n\t\telse if (\n\t\t\tisDraft(result) &&\n\t\t\t(result[DRAFT_STATE] as ES5State).scope_ === scope\n\t\t) {\n\t\t\tmarkChangesSweep(scope.drafts_)\n\t\t}\n\t}\n\n\tfunction createES5Proxy_<T>(\n\t\tbase: T,\n\t\tparent?: ImmerState\n\t): Drafted<T, ES5ObjectState | ES5ArrayState> {\n\t\tconst isArray = Array.isArray(base)\n\t\tconst draft: any = clonePotentialDraft(base)\n\n\t\teach(draft, prop => {\n\t\t\tproxyProperty(draft, prop, isArray || isEnumerable(base, prop))\n\t\t})\n\n\t\tconst state: ES5ObjectState | ES5ArrayState = {\n\t\t\ttype_: isArray ? ProxyTypeES5Array : (ProxyTypeES5Object as any),\n\t\t\tscope_: parent ? parent.scope_ : getCurrentScope(),\n\t\t\tmodified_: false,\n\t\t\tfinalizing_: false,\n\t\t\tfinalized_: false,\n\t\t\tassigned_: {},\n\t\t\tparent_: parent,\n\t\t\tbase_: base,\n\t\t\tdraft_: draft,\n\t\t\tcopy_: null,\n\t\t\trevoked_: false,\n\t\t\tisManual_: false\n\t\t}\n\n\t\tObject.defineProperty(draft, DRAFT_STATE, {\n\t\t\tvalue: state,\n\t\t\t// enumerable: false <- the default\n\t\t\twritable: true\n\t\t})\n\t\treturn draft\n\t}\n\n\t// Access a property without creating an Immer draft.\n\tfunction peek(draft: Drafted, prop: PropertyKey) {\n\t\tconst state: ES5State = draft[DRAFT_STATE]\n\t\tif (state && !state.finalizing_) {\n\t\t\tstate.finalizing_ = true\n\t\t\tconst value = draft[prop]\n\t\t\tstate.finalizing_ = false\n\t\t\treturn value\n\t\t}\n\t\treturn draft[prop]\n\t}\n\n\tfunction get(state: ES5State, prop: string | number) {\n\t\tassertUnrevoked(state)\n\t\tconst value = peek(latest(state), prop)\n\t\tif (state.finalizing_) return value\n\t\t// Create a draft if the value is unmodified.\n\t\tif (value === peek(state.base_, prop) && isDraftable(value)) {\n\t\t\tprepareCopy(state)\n\t\t\t// @ts-ignore\n\t\t\treturn (state.copy_![prop] = createProxy(\n\t\t\t\tstate.scope_.immer_,\n\t\t\t\tvalue,\n\t\t\t\tstate\n\t\t\t))\n\t\t}\n\t\treturn value\n\t}\n\n\tfunction set(state: ES5State, prop: string | number, value: any) {\n\t\tassertUnrevoked(state)\n\t\tstate.assigned_[prop] = true\n\t\tif (!state.modified_) {\n\t\t\tif (is(value, peek(latest(state), prop))) return\n\t\t\tmarkChangedES5_(state)\n\t\t\tprepareCopy(state)\n\t\t}\n\t\t// @ts-ignore\n\t\tstate.copy_![prop] = value\n\t}\n\n\tfunction markChangedES5_(state: ImmerState) {\n\t\tif (!state.modified_) {\n\t\t\tstate.modified_ = true\n\t\t\tif (state.parent_) markChangedES5_(state.parent_)\n\t\t}\n\t}\n\n\tfunction prepareCopy(state: ES5State) {\n\t\tif (!state.copy_) state.copy_ = clonePotentialDraft(state.base_)\n\t}\n\n\tfunction clonePotentialDraft(base: Objectish) {\n\t\tconst state: ES5State | undefined = base && (base as any)[DRAFT_STATE]\n\t\tif (state) {\n\t\t\tstate.finalizing_ = true\n\t\t\tconst draft = shallowCopy(state.draft_, true)\n\t\t\tstate.finalizing_ = false\n\t\t\treturn draft\n\t\t}\n\t\treturn shallowCopy(base)\n\t}\n\n\t// property descriptors are recycled to make sure we don't create a get and set closure per property,\n\t// but share them all instead\n\tconst descriptors: {[prop: string]: PropertyDescriptor} = {}\n\n\tfunction proxyProperty(\n\t\tdraft: Drafted<any, ES5State>,\n\t\tprop: string | number,\n\t\tenumerable: boolean\n\t) {\n\t\tlet desc = descriptors[prop]\n\t\tif (desc) {\n\t\t\tdesc.enumerable = enumerable\n\t\t} else {\n\t\t\tdescriptors[prop] = desc = {\n\t\t\t\t// configurable: true,\n\t\t\t\tenumerable,\n\t\t\t\tget(this: any) {\n\t\t\t\t\treturn get(this[DRAFT_STATE], prop)\n\t\t\t\t},\n\t\t\t\tset(this: any, value) {\n\t\t\t\t\tset(this[DRAFT_STATE], prop, value)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tObject.defineProperty(draft, prop, desc)\n\t}\n\n\t// This looks expensive, but only proxies are visited, and only objects without known changes are scanned.\n\tfunction markChangesSweep(drafts: Drafted<any, ImmerState>[]) {\n\t\t// The natural order of drafts in the `scope` array is based on when they\n\t\t// were accessed. By processing drafts in reverse natural order, we have a\n\t\t// better chance of processing leaf nodes first. When a leaf node is known to\n\t\t// have changed, we can avoid any traversal of its ancestor nodes.\n\t\tfor (let i = drafts.length - 1; i >= 0; i--) {\n\t\t\tconst state: ES5State = drafts[i][DRAFT_STATE]\n\t\t\tif (!state.modified_) {\n\t\t\t\tswitch (state.type_) {\n\t\t\t\t\tcase ProxyTypeES5Array:\n\t\t\t\t\t\tif (hasArrayChanges(state)) markChangedES5_(state)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase ProxyTypeES5Object:\n\t\t\t\t\t\tif (hasObjectChanges(state)) markChangedES5_(state)\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction markChangesRecursively(object: any) {\n\t\tif (!object || typeof object !== \"object\") return\n\t\tconst state: ES5State | undefined = object[DRAFT_STATE]\n\t\tif (!state) return\n\t\tconst {base_, draft_, assigned_, type_} = state\n\t\tif (type_ === ProxyTypeES5Object) {\n\t\t\t// Look for added keys.\n\t\t\t// TODO: looks quite duplicate to hasObjectChanges,\n\t\t\t// probably there is a faster way to detect changes, as sweep + recurse seems to do some\n\t\t\t// unnecessary work.\n\t\t\t// also: probably we can store the information we detect here, to speed up tree finalization!\n\t\t\teach(draft_, key => {\n\t\t\t\tif ((key as any) === DRAFT_STATE) return\n\t\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\t\tif ((base_ as any)[key] === undefined && !has(base_, key)) {\n\t\t\t\t\tassigned_[key] = true\n\t\t\t\t\tmarkChangedES5_(state)\n\t\t\t\t} else if (!assigned_[key]) {\n\t\t\t\t\t// Only untouched properties trigger recursion.\n\t\t\t\t\tmarkChangesRecursively(draft_[key])\n\t\t\t\t}\n\t\t\t})\n\t\t\t// Look for removed keys.\n\t\t\teach(base_, key => {\n\t\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\t\tif (draft_[key] === undefined && !has(draft_, key)) {\n\t\t\t\t\tassigned_[key] = false\n\t\t\t\t\tmarkChangedES5_(state)\n\t\t\t\t}\n\t\t\t})\n\t\t} else if (type_ === ProxyTypeES5Array) {\n\t\t\tif (hasArrayChanges(state as ES5ArrayState)) {\n\t\t\t\tmarkChangedES5_(state)\n\t\t\t\tassigned_.length = true\n\t\t\t}\n\n\t\t\tif (draft_.length < base_.length) {\n\t\t\t\tfor (let i = draft_.length; i < base_.length; i++) assigned_[i] = false\n\t\t\t} else {\n\t\t\t\tfor (let i = base_.length; i < draft_.length; i++) assigned_[i] = true\n\t\t\t}\n\n\t\t\t// Minimum count is enough, the other parts has been processed.\n\t\t\tconst min = Math.min(draft_.length, base_.length)\n\n\t\t\tfor (let i = 0; i < min; i++) {\n\t\t\t\t// Only untouched indices trigger recursion.\n\t\t\t\tif (assigned_[i] === undefined) markChangesRecursively(draft_[i])\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction hasObjectChanges(state: ES5ObjectState) {\n\t\tconst {base_, draft_} = state\n\n\t\t// Search for added keys and changed keys. Start at the back, because\n\t\t// non-numeric keys are ordered by time of definition on the object.\n\t\tconst keys = Object.keys(draft_)\n\t\tfor (let i = keys.length - 1; i >= 0; i--) {\n\t\t\tconst key = keys[i]\n\t\t\tconst baseValue = base_[key]\n\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\tif (baseValue === undefined && !has(base_, key)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\t// Once a base key is deleted, future changes go undetected, because its\n\t\t\t// descriptor is erased. This branch detects any missed changes.\n\t\t\telse {\n\t\t\t\tconst value = draft_[key]\n\t\t\t\tconst state: ImmerState = value && value[DRAFT_STATE]\n\t\t\t\tif (state ? state.base_ !== baseValue : !is(value, baseValue)) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// At this point, no keys were added or changed.\n\t\t// Compare key count to determine if keys were deleted.\n\t\treturn keys.length !== Object.keys(base_).length\n\t}\n\n\tfunction hasArrayChanges(state: ES5ArrayState) {\n\t\tconst {draft_} = state\n\t\tif (draft_.length !== state.base_.length) return true\n\t\t// See #116\n\t\t// If we first shorten the length, our array interceptors will be removed.\n\t\t// If after that new items are added, result in the same original length,\n\t\t// those last items will have no intercepting property.\n\t\t// So if there is no own descriptor on the last position, we know that items were removed and added\n\t\t// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check\n\t\t// the last one\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(\n\t\t\tdraft_,\n\t\t\tdraft_.length - 1\n\t\t)\n\t\t// descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)\n\t\tif (descriptor && !descriptor.get) return true\n\t\t// For all other cases, we don't have to compare, as they would have been picked up by the index setters\n\t\treturn false\n\t}\n\n\t/*#__PURE__*/\n\tfunction isEnumerable(base: AnyObject, prop: PropertyKey): boolean {\n\t\tconst desc = Object.getOwnPropertyDescriptor(base, prop)\n\t\treturn desc && desc.enumerable ? true : false\n\t}\n\n\tfunction assertUnrevoked(state: any /*ES5State | MapState | SetState*/) {\n\t\tif (state.revoked_) die(3, JSON.stringify(latest(state)))\n\t}\n\n\tloadPlugin(\"ES5\", {\n\t\tcreateES5Proxy_,\n\t\tmarkChangedES5_,\n\t\twillFinalizeES5_\n\t})\n}\n","import { enableES5 } from 'immer'\r\nexport * from 'redux'\r\nexport { default as createNextState, Draft } from 'immer'\r\nexport { createSelector } from 'reselect'\r\nexport { ThunkAction } from 'redux-thunk'\r\n\r\n// We deliberately enable Immer's ES5 support, on the grounds that\r\n// we assume RTK will be used with React Native and other Proxy-less\r\n// environments. In addition, that's how Immer 4 behaved, and since\r\n// we want to ship this in an RTK minor, we should keep the same behavior.\r\nenableES5()\r\n\r\nexport {\r\n // js\r\n configureStore,\r\n // types\r\n ConfigureEnhancersCallback,\r\n ConfigureStoreOptions,\r\n EnhancedStore\r\n} from './configureStore'\r\nexport {\r\n // js\r\n createAction,\r\n getType,\r\n // types\r\n PayloadAction,\r\n PayloadActionCreator,\r\n ActionCreatorWithNonInferrablePayload,\r\n ActionCreatorWithOptionalPayload,\r\n ActionCreatorWithPayload,\r\n ActionCreatorWithoutPayload,\r\n ActionCreatorWithPreparedPayload,\r\n PrepareAction\r\n} from './createAction'\r\nexport {\r\n // js\r\n createReducer,\r\n // types\r\n Actions,\r\n CaseReducer,\r\n CaseReducers\r\n} from './createReducer'\r\nexport {\r\n // js\r\n createSlice,\r\n // types\r\n CreateSliceOptions,\r\n Slice,\r\n CaseReducerActions,\r\n SliceCaseReducers,\r\n ValidateSliceCaseReducers,\r\n CaseReducerWithPrepare,\r\n SliceActionCreator\r\n} from './createSlice'\r\nexport {\r\n // js\r\n createSerializableStateInvariantMiddleware,\r\n findNonSerializableValue,\r\n isPlain,\r\n // types\r\n SerializableStateInvariantMiddlewareOptions\r\n} from './serializableStateInvariantMiddleware'\r\nexport {\r\n // js\r\n getDefaultMiddleware\r\n} from './getDefaultMiddleware'\r\nexport {\r\n // types\r\n ActionReducerMapBuilder\r\n} from './mapBuilders'\r\n\r\nexport { createEntityAdapter } from './entities/create_adapter'\r\nexport {\r\n Dictionary,\r\n EntityState,\r\n EntityAdapter,\r\n Update,\r\n EntityMap,\r\n IdSelector,\r\n Comparer\r\n} from './entities/models'\r\n\r\nexport {\r\n createAsyncThunk,\r\n unwrapResult,\r\n SerializedError\r\n} from './createAsyncThunk'\r\n","import {\r\n createStore,\r\n compose,\r\n applyMiddleware,\r\n combineReducers,\r\n Reducer,\r\n ReducersMapObject,\r\n Middleware,\r\n Action,\r\n AnyAction,\r\n StoreEnhancer,\r\n Store,\r\n DeepPartial,\r\n Dispatch\r\n} from 'redux'\r\nimport {\r\n composeWithDevTools,\r\n EnhancerOptions as DevToolsOptions\r\n} from './devtoolsExtension'\r\n\r\nimport isPlainObject from './isPlainObject'\r\nimport {\r\n getDefaultMiddleware,\r\n ThunkMiddlewareFor\r\n} from './getDefaultMiddleware'\r\nimport { DispatchForMiddlewares } from './tsHelpers'\r\n\r\nconst IS_PRODUCTION = process.env.NODE_ENV === 'production'\r\n\r\n/**\r\n * Callback function type, to be used in `ConfigureStoreOptions.enhancers`\r\n *\r\n * @public\r\n */\r\nexport type ConfigureEnhancersCallback = (\r\n defaultEnhancers: StoreEnhancer[]\r\n) => StoreEnhancer[]\r\n\r\n/**\r\n * Options for `configureStore()`.\r\n *\r\n * @public\r\n */\r\nexport interface ConfigureStoreOptions<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares<S> = Middlewares<S>\r\n> {\r\n /**\r\n * A single reducer function that will be used as the root reducer, or an\r\n * object of slice reducers that will be passed to `combineReducers()`.\r\n */\r\n reducer: Reducer<S, A> | ReducersMapObject<S, A>\r\n\r\n /**\r\n * An array of Redux middleware to install. If not supplied, defaults to\r\n * the set of middleware returned by `getDefaultMiddleware()`.\r\n */\r\n middleware?: M\r\n\r\n /**\r\n * Whether to enable Redux DevTools integration. Defaults to `true`.\r\n *\r\n * Additional configuration can be done by passing Redux DevTools options\r\n */\r\n devTools?: boolean | DevToolsOptions\r\n\r\n /**\r\n * The initial state, same as Redux's createStore.\r\n * You may optionally specify it to hydrate the state\r\n * from the server in universal apps, or to restore a previously serialized\r\n * user session. If you use `combineReducers()` to produce the root reducer\r\n * function (either directly or indirectly by passing an object as `reducer`),\r\n * this must be an object with the same shape as the reducer map keys.\r\n */\r\n // NOTE: The needlessly complicated `S extends any ? S : S` instead of just\r\n // `S` ensures that the TypeScript compiler doesn't attempt to infer `S`\r\n // based on the value passed as `preloadedState`, which might be a partial\r\n // state rather than the full thing.\r\n preloadedState?: DeepPartial<S extends any ? S : S>\r\n\r\n /**\r\n * The store enhancers to apply. See Redux's `createStore()`.\r\n * All enhancers will be included before the DevTools Extension enhancer.\r\n * If you need to customize the order of enhancers, supply a callback\r\n * function that will receive the original array (ie, `[applyMiddleware]`),\r\n * and should return a new array (such as `[applyMiddleware, offline]`).\r\n * If you only need to add middleware, you can use the `middleware` parameter instaead.\r\n */\r\n enhancers?: StoreEnhancer[] | ConfigureEnhancersCallback\r\n}\r\n\r\ntype Middlewares<S> = ReadonlyArray<Middleware<{}, S>>\r\n\r\n/**\r\n * A Redux store returned by `configureStore()`. Supports dispatching\r\n * side-effectful _thunks_ in addition to plain actions.\r\n *\r\n * @public\r\n */\r\nexport interface EnhancedStore<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares<S> = Middlewares<S>\r\n> extends Store<S, A> {\r\n /**\r\n * The `dispatch` method of your store, enhanced by all it's middlewares.\r\n *\r\n * @inheritdoc\r\n */\r\n dispatch: DispatchForMiddlewares<M> & Dispatch<A>\r\n}\r\n\r\n/**\r\n * A friendly abstraction over the standard Redux `createStore()` function.\r\n *\r\n * @param config The store configuration.\r\n * @returns A configured Redux store.\r\n *\r\n * @public\r\n */\r\nexport function configureStore<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares<S> = [ThunkMiddlewareFor<S>]\r\n>(options: ConfigureStoreOptions<S, A, M>): EnhancedStore<S, A, M> {\r\n const {\r\n reducer = undefined,\r\n middleware = getDefaultMiddleware(),\r\n devTools = true,\r\n preloadedState = undefined,\r\n enhancers = undefined\r\n } = options || {}\r\n\r\n let rootReducer: Reducer<S, A>\r\n\r\n if (typeof reducer === 'function') {\r\n rootReducer = reducer\r\n } else if (isPlainObject(reducer)) {\r\n rootReducer = combineReducers(reducer)\r\n } else {\r\n throw new Error(\r\n '\"reducer\" is a required argument, and must be a function or an object of functions that can be passed to combineReducers'\r\n )\r\n }\r\n\r\n const middlewareEnhancer = applyMiddleware(...middleware)\r\n\r\n let finalCompose = compose\r\n\r\n if (devTools) {\r\n finalCompose = composeWithDevTools({\r\n // Enable capture of stack traces for dispatched Redux actions\r\n trace: !IS_PRODUCTION,\r\n ...(typeof devTools === 'object' && devTools)\r\n })\r\n }\r\n\r\n let storeEnhancers: StoreEnhancer[] = [middlewareEnhancer]\r\n\r\n if (Array.isArray(enhancers)) {\r\n storeEnhancers = [middlewareEnhancer, ...enhancers]\r\n } else if (typeof enhancers === 'function') {\r\n storeEnhancers = enhancers(storeEnhancers)\r\n }\r\n\r\n const composedEnhancer = finalCompose(...storeEnhancers) as any\r\n\r\n return createStore(\r\n rootReducer,\r\n preloadedState as DeepPartial<S>,\r\n composedEnhancer\r\n )\r\n}\r\n","import { EntityDefinition, Comparer, IdSelector, EntityAdapter } from './models'\r\nimport { createInitialStateFactory } from './entity_state'\r\nimport { createSelectorsFactory } from './state_selectors'\r\nimport { createSortedStateAdapter } from './sorted_state_adapter'\r\nimport { createUnsortedStateAdapter } from './unsorted_state_adapter'\r\n\r\n/**\r\n *\r\n * @param options\r\n *\r\n * @alpha\r\n */\r\nexport function createEntityAdapter<T>(\r\n options: {\r\n selectId?: IdSelector<T>\r\n sortComparer?: false | Comparer<T>\r\n } = {}\r\n): EntityAdapter<T> {\r\n const { selectId, sortComparer }: EntityDefinition<T> = {\r\n sortComparer: false,\r\n selectId: (instance: any) => instance.id,\r\n ...options\r\n }\r\n\r\n const stateFactory = createInitialStateFactory<T>()\r\n const selectorsFactory = createSelectorsFactory<T>()\r\n const stateAdapter = sortComparer\r\n ? createSortedStateAdapter(selectId, sortComparer)\r\n : createUnsortedStateAdapter(selectId)\r\n\r\n return {\r\n selectId,\r\n sortComparer,\r\n ...stateFactory,\r\n ...selectorsFactory,\r\n ...stateAdapter\r\n }\r\n}\r\n","import { EntityState } from './models'\r\n\r\nexport function getInitialEntityState<V>(): EntityState<V> {\r\n return {\r\n ids: [],\r\n entities: {}\r\n }\r\n}\r\n\r\nexport function createInitialStateFactory<V>() {\r\n function getInitialState(): EntityState<V>\r\n function getInitialState<S extends object>(\r\n additionalState: S\r\n ): EntityState<V> & S\r\n function getInitialState(additionalState: any = {}): any {\r\n return Object.assign(getInitialEntityState(), additionalState)\r\n }\r\n\r\n return { getInitialState }\r\n}\r\n","import { createSelector } from 'reselect'\r\nimport { EntityState, EntitySelectors, Dictionary } from './models'\r\n\r\nexport function createSelectorsFactory<T>() {\r\n function getSelectors(): EntitySelectors<T, EntityState<T>>\r\n function getSelectors<V>(\r\n selectState: (state: V) => EntityState<T>\r\n ): EntitySelectors<T, V>\r\n function getSelectors(\r\n selectState?: (state: any) => EntityState<T>\r\n ): EntitySelectors<T, any> {\r\n const selectIds = (state: any) => state.ids\r\n const selectEntities = (state: EntityState<T>) => state.entities\r\n const selectAll = createSelector(\r\n selectIds,\r\n selectEntities,\r\n (ids: T[], entities: Dictionary<T>): any =>\r\n ids.map((id: any) => (entities as any)[id])\r\n )\r\n\r\n const selectTotal = createSelector(selectIds, ids => ids.length)\r\n\r\n if (!selectState) {\r\n return {\r\n selectIds,\r\n selectEntities,\r\n selectAll,\r\n selectTotal\r\n }\r\n }\r\n\r\n return {\r\n selectIds: createSelector(selectState, selectIds),\r\n selectEntities: createSelector(selectState, selectEntities),\r\n selectAll: createSelector(selectState, selectAll),\r\n selectTotal: createSelector(selectState, selectTotal)\r\n }\r\n }\r\n\r\n return { getSelectors }\r\n}\r\n","import {\r\n EntityState,\r\n IdSelector,\r\n Comparer,\r\n EntityStateAdapter,\r\n Update,\r\n EntityMap,\r\n EntityId\r\n} from './models'\r\nimport { createStateOperator } from './state_adapter'\r\nimport { createUnsortedStateAdapter } from './unsorted_state_adapter'\r\nimport { selectIdValue } from './utils'\r\n\r\nexport function createSortedStateAdapter<T>(\r\n selectId: IdSelector<T>,\r\n sort: Comparer<T>\r\n): EntityStateAdapter<T> {\r\n type R = EntityState<T>\r\n\r\n const { removeOne, removeMany, removeAll } = createUnsortedStateAdapter(\r\n selectId\r\n )\r\n\r\n function addOneMutably(entity: T, state: R): void {\r\n return addManyMutably([entity], state)\r\n }\r\n\r\n function addManyMutably(newModels: T[], state: R): void {\r\n const models = newModels.filter(\r\n model => !(selectIdValue(model, selectId) in state.entities)\r\n )\r\n\r\n if (models.length !== 0) {\r\n merge(models, state)\r\n }\r\n }\r\n\r\n function setAllMutably(models: T[], state: R): void {\r\n state.entities = {}\r\n state.ids = []\r\n\r\n addManyMutably(models, state)\r\n }\r\n\r\n function updateOneMutably(update: Update<T>, state: R): void {\r\n return updateManyMutably([update], state)\r\n }\r\n\r\n function takeUpdatedModel(models: T[], update: Update<T>, state: R): boolean {\r\n if (!(update.id in state.entities)) {\r\n return false\r\n }\r\n\r\n const original = state.entities[update.id]\r\n const updated = Object.assign({}, original, update.changes)\r\n const newKey = selectIdValue(updated, selectId)\r\n\r\n delete state.entities[update.id]\r\n\r\n models.push(updated)\r\n\r\n return newKey !== update.id\r\n }\r\n\r\n function updateManyMutably(updates: Update<T>[], state: R): void {\r\n const models: T[] = []\r\n\r\n updates.forEach(update => takeUpdatedModel(models, update, state))\r\n\r\n if (models.length !== 0) {\r\n merge(models, state)\r\n }\r\n }\r\n\r\n function mapMutably(updatesOrMap: EntityMap<T>, state: R): void {\r\n const updates: Update<T>[] = state.ids.reduce(\r\n (changes: Update<T>[], id: EntityId) => {\r\n const change = updatesOrMap(state.entities[id]!)\r\n if (change !== state.entities[id]) {\r\n changes.push({ id, changes: change })\r\n }\r\n return changes\r\n },\r\n []\r\n )\r\n\r\n updateManyMutably(updates, state)\r\n }\r\n\r\n function upsertOneMutably(entity: T, state: R): void {\r\n return upsertManyMutably([entity], state)\r\n }\r\n\r\n function upsertManyMutably(entities: T[], state: R): void {\r\n const added: T[] = []\r\n const updated: Update<T>[] = []\r\n\r\n for (const entity of entities) {\r\n const id = selectIdValue(entity, selectId)\r\n if (id in state.entities) {\r\n updated.push({ id, changes: entity })\r\n } else {\r\n added.push(entity)\r\n }\r\n }\r\n\r\n updateManyMutably(updated, state)\r\n addManyMutably(added, state)\r\n }\r\n\r\n function areArraysEqual(a: unknown[], b: unknown[]) {\r\n if (a.length !== b.length) {\r\n return false\r\n }\r\n\r\n for (let i = 0; i < a.length && i < b.length; i++) {\r\n if (a[i] === b[i]) {\r\n continue\r\n }\r\n return false\r\n }\r\n return true\r\n }\r\n\r\n function merge(models: T[], state: R): void {\r\n models.sort(sort)\r\n\r\n // Insert/overwrite all new/updated\r\n models.forEach(model => {\r\n state.entities[selectId(model)] = model\r\n })\r\n\r\n const allEntities = Object.values(state.entities) as T[]\r\n allEntities.sort(sort)\r\n\r\n const newSortedIds = allEntities.map(selectId)\r\n const { ids } = state\r\n\r\n if (!areArraysEqual(ids, newSortedIds)) {\r\n state.ids = newSortedIds\r\n }\r\n }\r\n\r\n return {\r\n removeOne,\r\n removeMany,\r\n removeAll,\r\n addOne: createStateOperator(addOneMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertMany: createStateOperator(upsertManyMutably),\r\n map: createStateOperator(mapMutably)\r\n }\r\n}\r\n","import { Reducer } from 'redux'\r\nimport {\r\n ActionCreatorWithoutPayload,\r\n createAction,\r\n PayloadAction,\r\n PayloadActionCreator,\r\n PrepareAction,\r\n _ActionCreatorWithPreparedPayload\r\n} from './createAction'\r\nimport { CaseReducer, CaseReducers, createReducer } from './createReducer'\r\nimport {\r\n ActionReducerMapBuilder,\r\n executeReducerBuilderCallback\r\n} from './mapBuilders'\r\nimport { Omit } from './tsHelpers'\r\n\r\n/**\r\n * An action creator atttached to a slice.\r\n *\r\n * @deprecated please use PayloadActionCreator directly\r\n *\r\n * @public\r\n */\r\nexport type SliceActionCreator<P> = PayloadActionCreator<P>\r\n\r\n/**\r\n * The return value of `createSlice`\r\n *\r\n * @public\r\n */\r\nexport interface Slice<\r\n State = any,\r\n CaseReducers extends SliceCaseReducers<State> = SliceCaseReducers<State>,\r\n Name extends string = string\r\n> {\r\n /**\r\n * The slice name.\r\n */\r\n name: Name\r\n\r\n /**\r\n * The slice's reducer.\r\n */\r\n reducer: Reducer<State>\r\n\r\n /**\r\n * Action creators for the types of actions that are handled by the slice\r\n * reducer.\r\n */\r\n actions: CaseReducerActions<CaseReducers>\r\n\r\n /**\r\n * The individual case reducer functions that were passed in the `reducers` parameter.\r\n * This enables reuse and testing if they were defined inline when calling `createSlice`.\r\n */\r\n caseReducers: SliceDefinedCaseReducers<CaseReducers>\r\n}\r\n\r\n/**\r\n * Options for `createSlice()`.\r\n *\r\n * @public\r\n */\r\nexport interface CreateSliceOptions<\r\n State = any,\r\n CR extends SliceCaseReducers<State> = SliceCaseReducers<State>,\r\n Name extends string = string\r\n> {\r\n /**\r\n * The slice's name. Used to namespace the generated action types.\r\n */\r\n name: Name\r\n\r\n /**\r\n * The initial state to be returned by the slice reducer.\r\n */\r\n initialState: State\r\n\r\n /**\r\n * A mapping from action types to action-type-specific *case reducer*\r\n * functions. For every action type, a matching action creator will be\r\n * generated using `createAction()`.\r\n */\r\n reducers: ValidateSliceCaseReducers<State, CR>\r\n\r\n /**\r\n * A mapping from action types to action-type-specific *case reducer*\r\n * functions. These reducers should have existing action types used\r\n * as the keys, and action creators will _not_ be generated.\r\n * Alternatively, a callback that receives a *builder* object to define\r\n * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`.\r\n */\r\n extraReducers?:\r\n | CaseReducers<NoInfer<State>, any>\r\n | ((builder: ActionReducerMapBuilder<NoInfer<State>>) => void)\r\n}\r\n\r\n/**\r\n * A CaseReducer with a `prepare` method.\r\n *\r\n * @public\r\n */\r\nexport type CaseReducerWithPrepare<State, Action extends PayloadAction> = {\r\n reducer: CaseReducer<State, Action>\r\n prepare: PrepareAction<Action['payload']>\r\n}\r\n\r\n/**\r\n * The type describing a slice's `reducers` option.\r\n *\r\n * @public\r\n */\r\nexport type SliceCaseReducers<State> = {\r\n [K: string]:\r\n | CaseReducer<State, PayloadAction<any>>\r\n | CaseReducerWithPrepare<State, PayloadAction<any, string, any, any>>\r\n}\r\n\r\n/**\r\n * Derives the slice's `actions` property from the `reducers` options\r\n *\r\n * @public\r\n */\r\nexport type CaseReducerActions<CaseReducers extends SliceCaseReducers<any>> = {\r\n [Type in keyof CaseReducers]: CaseReducers[Type] extends { prepare: any }\r\n ? ActionCreatorForCaseReducerWithPrepare<CaseReducers[Type]>\r\n : ActionCreatorForCaseReducer<CaseReducers[Type]>\r\n}\r\n\r\n/**\r\n * Get a `PayloadActionCreator` type for a passed `CaseReducerWithPrepare`\r\n *\r\n * @internal\r\n */\r\ntype ActionCreatorForCaseReducerWithPrepare<\r\n CR extends { prepare: any }\r\n> = _ActionCreatorWithPreparedPayload<CR['prepare'], string>\r\n\r\n/**\r\n * Get a `PayloadActionCreator` type for a passed `CaseReducer`\r\n *\r\n * @internal\r\n */\r\ntype ActionCreatorForCaseReducer<CR> = CR extends (\r\n state: any,\r\n action: infer Action\r\n) => any\r\n ? Action extends { payload: infer P }\r\n ? PayloadActionCreator<P>\r\n : ActionCreatorWithoutPayload\r\n : ActionCreatorWithoutPayload\r\n\r\n/**\r\n * Extracts the CaseReducers out of a `reducers` object, even if they are\r\n * tested into a `CaseReducerWithPrepare`.\r\n *\r\n * @internal\r\n */\r\ntype SliceDefinedCaseReducers<CaseReducers extends SliceCaseReducers<any>> = {\r\n [Type in keyof CaseReducers]: CaseReducers[Type] extends {\r\n reducer: infer Reducer\r\n }\r\n ? Reducer\r\n : CaseReducers[Type]\r\n}\r\n\r\n/**\r\n * Helper type. Passes T out again, but boxes it in a way that it cannot\r\n * \"widen\" the type by accident if it is a generic that should be inferred\r\n * from elsewhere.\r\n *\r\n * @internal\r\n */\r\ntype NoInfer<T> = [T][T extends any ? 0 : never]\r\n\r\n/**\r\n * Used on a SliceCaseReducers object.\r\n * Ensures that if a CaseReducer is a `CaseReducerWithPrepare`, that\r\n * the `reducer` and the `prepare` function use the same type of `payload`.\r\n *\r\n * Might do additional such checks in the future.\r\n *\r\n * This type is only ever useful if you want to write your own wrapper around\r\n * `createSlice`. Please don't use it otherwise!\r\n *\r\n * @public\r\n */\r\nexport type ValidateSliceCaseReducers<\r\n S,\r\n ACR extends SliceCaseReducers<S>\r\n> = ACR &\r\n {\r\n [T in keyof ACR]: ACR[T] extends {\r\n reducer(s: S, action?: infer A): any\r\n }\r\n ? {\r\n prepare(...a: never[]): Omit<A, 'type'>\r\n }\r\n : {}\r\n }\r\n\r\nfunction getType(slice: string, actionKey: string): string {\r\n return `${slice}/${actionKey}`\r\n}\r\n\r\n/**\r\n * A function that accepts an initial state, an object full of reducer\r\n * functions, and a \"slice name\", and automatically generates\r\n * action creators and action types that correspond to the\r\n * reducers and state.\r\n *\r\n * The `reducer` argument is passed to `createReducer()`.\r\n *\r\n * @public\r\n */\r\nexport function createSlice<\r\n State,\r\n CaseReducers extends SliceCaseReducers<State>,\r\n Name extends string = string\r\n>(\r\n options: CreateSliceOptions<State, CaseReducers, Name>\r\n): Slice<State, CaseReducers, Name> {\r\n const { name, initialState } = options\r\n if (!name) {\r\n throw new Error('`name` is a required option for createSlice')\r\n }\r\n const reducers = options.reducers || {}\r\n const extraReducers =\r\n typeof options.extraReducers === 'undefined'\r\n ? {}\r\n : typeof options.extraReducers === 'function'\r\n ? executeReducerBuilderCallback(options.extraReducers)\r\n : options.extraReducers\r\n\r\n const reducerNames = Object.keys(reducers)\r\n\r\n const sliceCaseReducersByName: Record<string, CaseReducer> = {}\r\n const sliceCaseReducersByType: Record<string, CaseReducer> = {}\r\n const actionCreators: Record<string, Function> = {}\r\n\r\n reducerNames.forEach(reducerName => {\r\n const maybeReducerWithPrepare = reducers[reducerName]\r\n const type = getType(name, reducerName)\r\n\r\n let caseReducer: CaseReducer<State, any>\r\n let prepareCallback: PrepareAction<any> | undefined\r\n\r\n if ('reducer' in maybeReducerWithPrepare) {\r\n caseReducer = maybeReducerWithPrepare.reducer\r\n prepareCallback = maybeReducerWithPrepare.prepare\r\n } else {\r\n caseReducer = maybeReducerWithPrepare\r\n }\r\n\r\n sliceCaseReducersByName[reducerName] = caseReducer\r\n sliceCaseReducersByType[type] = caseReducer\r\n actionCreators[reducerName] = prepareCallback\r\n ? createAction(type, prepareCallback)\r\n : createAction(type)\r\n })\r\n\r\n const finalCaseReducers = { ...extraReducers, ...sliceCaseReducersByType }\r\n const reducer = createReducer(initialState, finalCaseReducers as any)\r\n\r\n return {\r\n name,\r\n reducer,\r\n actions: actionCreators as any,\r\n caseReducers: sliceCaseReducersByName as any\r\n }\r\n}\r\n"],"names":["die","error","args","Error","length","join","isDraft","value","DRAFT_STATE","isDraftable","proto","Object","getPrototypeOf","prototype","Array","isArray","DRAFTABLE","constructor","isMap","isSet","each","obj","iter","getArchtype","ownKeys","forEach","key","entry","index","thing","state","type_","has","prop","hasOwnProperty","call","is","x","y","target","hasMap","Map","hasSet","Set","latest","copy_","base_","shallowCopy","base","invokeGetters","slice","clone","create","desc","getOwnPropertyDescriptor","get","enumerable","defineProperty","writable","configurable","freeze","deep","isFrozen","set","add","clear","delete","dontMutateFrozenCollections","_","getPlugin","pluginKey","plugin","plugins","getCurrentScope","currentScope","usePatchesInScope","scope","patchListener","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","drafts_","revokeDraft","parent_","enterScope","immer","immer_","canAutoFreeze_","unfinalizedDrafts_","draft","revoke_","revoked_","processResult","result","baseDraft","isReplaced","useProxies_","willFinalizeES5_","modified_","finalize","maybeFreeze","generateReplacementPatches_","NOTHING","rootScope","path","childValue","finalizeProperty","scope_","finalized_","draft_","generatePatches_","parentState","targetObject","rootPath","res","assigned_","concat","propOrOldValue","t","autoFreeze_","peek","Reflect","markChangedProxy","copy","prepareCopy","createProxy","parent","proxyMap_","proxySet_","isManual_","traps","objectTraps","arrayTraps","Proxy","revocable","revoke","proxy","createES5Proxy_","push","hasSymbol","Symbol","hasProxies","getOwnPropertySymbols","getOwnPropertyNames","drafts","baseValue","deleteProperty","owner","setPrototypeOf","fn","arguments","apply","this","config","useProxies","setUseProxies","autoFreeze","setAutoFreeze","produce","bind","produceWithPatches","recipe","defaultBase","self","_this","hasError","Promise","then","arg1","arg2","patches","inversePatches","_this2","p","ip","createDraft","finishDraft","applyPatches","i","patch","op","applyPatchesImpl","applyPatches_","root","window","global","module","Function","observable","ponyfill","randomString","Math","random","toString","substring","split","ActionTypes","INIT","REPLACE","PROBE_UNKNOWN_ACTION","isPlainObject","createStore","reducer","preloadedState","enhancer","_ref2","undefined","currentReducer","currentState","currentListeners","nextListeners","isDispatching","ensureCanMutateNextListeners","getState","subscribe","listener","isSubscribed","indexOf","splice","dispatch","action","type","listeners","replaceReducer","nextReducer","_ref","outerSubscribe","observer","TypeError","observeState","next","unsubscribe","$$observable","getUndefinedStateErrorMessage","actionType","String","combineReducers","reducers","reducerKeys","keys","finalReducers","shapeAssertionError","finalReducerKeys","assertReducerShape","e","hasChanged","nextState","_i","_key","previousStateForKey","nextStateForKey","errorMessage","bindActionCreator","actionCreator","_defineProperty","_objectSpread","source","filter","sym","compose","_len","funcs","arg","reduce","a","b","applyMiddleware","middlewares","store","_dispatch","middlewareAPI","chain","map","middleware","defaultEqualityCheck","areArgumentsShallowlyEqual","equalityCheck","prev","getDependencies","dependencies","every","dep","dependencyTypes","createSelector","memoize","memoizeOptions","_len2","_key2","recomputations","resultFunc","pop","memoizedResultFunc","selector","params","resetRecomputations","createSelectorCreator","func","lastArgs","lastResult","composeWithDevTools","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","createThunkMiddleware","extraArgument","thunk","isPlain","val","findNonSerializableValue","isSerializable","getEntries","ignoredPaths","foundNestedSerializable","keyPath","entries","hasIgnoredPaths","nestedValue","nestedPath","getDefaultMiddleware","options","middlewareArray","isBoolean","thunkMiddleware","withExtraArgument","createAction","prepareAction","prepared","payload","meta","match","isValidKey","executeReducerBuilderCallback","builderCallback","actionsMap","builder","addCase","typeOrActionCreator","createReducer","initialState","mapOrBuilderCallback","createNextState","caseReducer","createStateOperator","mutator","runMutator","isPayloadActionArgument","selectIdValue","entity","selectId","createUnsortedStateAdapter","addOneMutably","entities","ids","addManyMutably","removeManyMutably","didMutate","id","updateManyMutably","updates","newKeys","updatesPerEntity","update","values","updated","assign","changes","newKey","hasNewKey","takeNewKey","upsertManyMutably","added","removeAll","addOne","addMany","setAll","updateOne","updateMany","upsertOne","upsertMany","removeOne","removeMany","change","iterator","asyncIterator","url","toUpperCase","commonProperties","miniSerializeError","simpleError","finalizing_","markChangedES5_","clonePotentialDraft","markChangesSweep","hasArrayChanges","hasObjectChanges","descriptor","assertUnrevoked","JSON","stringify","descriptors","implementation","loadPlugin","markChangesRecursively","object","min","enableES5","actionCreators","boundActionCreators","rootReducer","devTools","enhancers","middlewareEnhancer","finalCompose","trace","storeEnhancers","payloadCreator","fulfilled","requestId","pending","rejected","aborted","name","extra","abortReason","size","nanoid","abortController","AbortController","abortedPromise","reject","signal","addEventListener","message","promise","finalAction","body","recover","race","resolve","err","abort","reason","sortComparer","instance","getInitialState","additionalState","getSelectors","selectState","selectIds","selectEntities","selectAll","selectTotal","sort","newModels","models","model","merge","takeUpdatedModel","allEntities","newSortedIds","areArraysEqual","updatesOrMap","createSortedStateAdapter","ignoredActions","storeAPI","foundActionNonSerializableValue","console","foundStateNonSerializableValue","extraReducers","reducerNames","sliceCaseReducersByName","sliceCaseReducersByType","reducerName","prepareCallback","maybeReducerWithPrepare","prepare","actions","caseReducers","returned"],"mappings":"0MAmCgBA,EAAIC,8BAA+BC,+BAAAA,0BAUxCC,oCACqBF,GAC7BC,EAAKE,OAAS,IAAMF,EAAKG,KAAK,KAAO,iEC1BxBC,EAAQC,WACdA,KAAWA,EAAMC,YAKXC,EAAYF,WACtBA,aAYwBA,OACxBA,GAA0B,iBAAVA,EAAoB,aACnCG,EAAQC,OAAOC,eAAeL,UAC5BG,GAASA,IAAUC,OAAOE,WAbnBN,IACdO,MAAMC,QAAQR,MACZA,EAAMS,MACNT,EAAMU,YAAYD,IACpBE,EAAMX,IACNY,EAAMZ,aAoCQa,EAAKC,EAAUC,GCpDD,IDqDzBC,EAAYF,GACfG,EAAQH,GAAKI,kBAAQC,UAAOJ,EAAKI,EAAKL,EAAIK,GAAML,MAEhDA,EAAII,kBAASE,EAAYC,UAAeN,EAAKM,EAAOD,EAAON,eAK7CE,EAAYM,OAErBC,EAAgCD,EAAMrB,UACrCsB,EACJA,EAAMC,EAAQ,EACbD,EAAMC,EAAQ,EACbD,EAAMC,EACRjB,MAAMC,QAAQc,GCnEW,EDqEzBX,EAAMW,GCpEiB,EDsEvBV,EAAMU,GCrEiB,EAHG,WD8EdG,EAAIH,EAAYI,UC5EL,ID6EnBV,EAAYM,GAChBA,EAAMG,IAAIC,GACVtB,OAAOE,UAAUqB,eAAeC,KAAKN,EAAOI,YAoBhCG,EAAGC,EAAQC,UAEtBD,IAAMC,EACI,IAAND,GAAW,EAAIA,GAAM,EAAIC,EAEzBD,GAAMA,GAAKC,GAAMA,WAKVpB,EAAMqB,UACdC,GAAUD,aAAkBE,aAIpBtB,EAAMoB,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