@reduxjs/toolkit
Advanced tools
Comparing version 1.9.2 to 1.9.7
import type { Reducer, ReducersMapObject, Middleware, Action, AnyAction, StoreEnhancer, Store, Dispatch, PreloadedState, CombinedState } from 'redux'; | ||
import type { DevToolsEnhancerOptions as DevToolsOptions } from './devtoolsExtension'; | ||
import type { ThunkMiddlewareFor, CurriedGetDefaultMiddleware } from './getDefaultMiddleware'; | ||
import type { NoInfer, ExtractDispatchExtensions, ExtractStoreExtensions } from './tsHelpers'; | ||
import type { NoInfer, ExtractDispatchExtensions, ExtractStoreExtensions, ExtractStateExtensions } from './tsHelpers'; | ||
import { EnhancerArray } from './utils'; | ||
/** | ||
@@ -10,3 +11,3 @@ * Callback function type, to be used in `ConfigureStoreOptions.enhancers` | ||
*/ | ||
export declare type ConfigureEnhancersCallback<E extends Enhancers = Enhancers> = (defaultEnhancers: readonly StoreEnhancer[]) => [...E]; | ||
export declare type ConfigureEnhancersCallback<E extends Enhancers = Enhancers> = (defaultEnhancers: EnhancerArray<[StoreEnhancer<{}, {}>]>) => E; | ||
/** | ||
@@ -72,3 +73,3 @@ * Options for `configureStore()`. | ||
*/ | ||
export declare type EnhancedStore<S = any, A extends Action = AnyAction, M extends Middlewares<S> = Middlewares<S>, E extends Enhancers = Enhancers> = ToolkitStore<S, A, M> & ExtractStoreExtensions<E>; | ||
export declare type EnhancedStore<S = any, A extends Action = AnyAction, M extends Middlewares<S> = Middlewares<S>, E extends Enhancers = Enhancers> = ToolkitStore<S & ExtractStateExtensions<E>, A, M> & ExtractStoreExtensions<E>; | ||
/** | ||
@@ -75,0 +76,0 @@ * A friendly abstraction over the standard Redux `createStore()` function. |
@@ -154,3 +154,3 @@ import type { Action } from 'redux'; | ||
* in the action object as a field called payload. The action creator function | ||
* will also have its toString() overriden so that it returns the action type, | ||
* will also have its toString() overridden so that it returns the action type, | ||
* allowing it to be used in reducer logic that is looking for that action type. | ||
@@ -169,3 +169,3 @@ * | ||
* in the action object as a field called payload. The action creator function | ||
* will also have its toString() overriden so that it returns the action type, | ||
* will also have its toString() overridden so that it returns the action type, | ||
* allowing it to be used in reducer logic that is looking for that action type. | ||
@@ -180,2 +180,13 @@ * | ||
export declare function createAction<PA extends PrepareAction<any>, T extends string = string>(type: T, prepareAction: PA): PayloadActionCreator<ReturnType<PA>['payload'], T, PA>; | ||
/** | ||
* Returns true if value is a plain object with a `type` property. | ||
*/ | ||
export declare function isAction(action: unknown): action is Action<unknown>; | ||
/** | ||
* Returns true if value is an RTK-like action creator, with a static type property and match method. | ||
*/ | ||
export declare function isActionCreator(action: unknown): action is BaseActionCreator<unknown, string> & Function; | ||
/** | ||
* Returns true if value is an action with a string type and valid Flux Standard Action keys. | ||
*/ | ||
export declare function isFSA(action: unknown): action is { | ||
@@ -182,0 +193,0 @@ type: string; |
@@ -5,3 +5,3 @@ import type { Dispatch, AnyAction } from 'redux'; | ||
import type { FallbackIfUnknown, Id, IsAny, IsUnknown } from './tsHelpers'; | ||
export declare type BaseThunkAPI<S, E, D extends Dispatch = Dispatch, RejectedValue = undefined, RejectedMeta = unknown, FulfilledMeta = unknown> = { | ||
export declare type BaseThunkAPI<S, E, D extends Dispatch = Dispatch, RejectedValue = unknown, RejectedMeta = unknown, FulfilledMeta = unknown> = { | ||
dispatch: D; | ||
@@ -63,3 +63,3 @@ getState: () => S; | ||
} ? FallbackIfUnknown<Dispatch, ThunkDispatch<GetState<ThunkApiConfig>, GetExtra<ThunkApiConfig>, AnyAction>> : ThunkDispatch<GetState<ThunkApiConfig>, GetExtra<ThunkApiConfig>, AnyAction>; | ||
declare type GetThunkAPI<ThunkApiConfig> = BaseThunkAPI<GetState<ThunkApiConfig>, GetExtra<ThunkApiConfig>, GetDispatch<ThunkApiConfig>, GetRejectValue<ThunkApiConfig>, GetRejectedMeta<ThunkApiConfig>, GetFulfilledMeta<ThunkApiConfig>>; | ||
export declare type GetThunkAPI<ThunkApiConfig> = BaseThunkAPI<GetState<ThunkApiConfig>, GetExtra<ThunkApiConfig>, GetDispatch<ThunkApiConfig>, GetRejectValue<ThunkApiConfig>, GetRejectedMeta<ThunkApiConfig>, GetFulfilledMeta<ThunkApiConfig>>; | ||
declare type GetRejectValue<ThunkApiConfig> = ThunkApiConfig extends { | ||
@@ -66,0 +66,0 @@ rejectValue: infer RejectValue; |
import type { AnyAction } from 'redux'; | ||
import type { ThunkMiddleware } from 'redux-thunk'; | ||
import type { ActionCreatorInvariantMiddlewareOptions } from './actionCreatorInvariantMiddleware'; | ||
import type { ImmutableStateInvariantMiddlewareOptions } from './immutableStateInvariantMiddleware'; | ||
@@ -14,2 +15,3 @@ import type { SerializableStateInvariantMiddlewareOptions } from './serializableStateInvariantMiddleware'; | ||
serializableCheck?: boolean | SerializableStateInvariantMiddlewareOptions; | ||
actionCreatorCheck?: boolean | ActionCreatorInvariantMiddlewareOptions; | ||
} | ||
@@ -27,2 +29,3 @@ export declare type ThunkMiddlewareFor<S, O extends GetDefaultMiddlewareOptions = {}> = O extends { | ||
serializableCheck: true; | ||
actionCreatorCheck: true; | ||
}>(options?: O) => MiddlewareArray<ExcludeFromTuple<[ThunkMiddlewareFor<S, O>], never>>; | ||
@@ -46,3 +49,4 @@ export declare function curryGetDefaultMiddleware<S = any>(): CurriedGetDefaultMiddleware<S>; | ||
serializableCheck: true; | ||
actionCreatorCheck: true; | ||
}>(options?: O): MiddlewareArray<ExcludeFromTuple<[ThunkMiddlewareFor<S, O>], never>>; | ||
export {}; |
@@ -11,3 +11,3 @@ export * from 'redux'; | ||
export type { DevToolsEnhancerOptions } from './devtoolsExtension'; | ||
export { createAction, getType, } from './createAction'; | ||
export { createAction, getType, isAction, isActionCreator, isFSA as isFluxStandardAction, } from './createAction'; | ||
export type { PayloadAction, PayloadActionCreator, ActionCreatorWithNonInferrablePayload, ActionCreatorWithOptionalPayload, ActionCreatorWithPayload, ActionCreatorWithoutPayload, ActionCreatorWithPreparedPayload, PrepareAction, } from './createAction'; | ||
@@ -18,2 +18,4 @@ export { createReducer, } from './createReducer'; | ||
export type { CreateSliceOptions, Slice, CaseReducerActions, SliceCaseReducers, ValidateSliceCaseReducers, CaseReducerWithPrepare, SliceActionCreator, } from './createSlice'; | ||
export type { ActionCreatorInvariantMiddlewareOptions } from './actionCreatorInvariantMiddleware'; | ||
export { createActionCreatorInvariantMiddleware } from './actionCreatorInvariantMiddleware'; | ||
export { createImmutableStateInvariantMiddleware, isImmutableDefault, } from './immutableStateInvariantMiddleware'; | ||
@@ -25,3 +27,3 @@ export type { ImmutableStateInvariantMiddlewareOptions, } from './immutableStateInvariantMiddleware'; | ||
export type { ActionReducerMapBuilder, } from './mapBuilders'; | ||
export { MiddlewareArray } from './utils'; | ||
export { MiddlewareArray, EnhancerArray } from './utils'; | ||
export { createEntityAdapter } from './entities/create_adapter'; | ||
@@ -40,1 +42,2 @@ export type { Dictionary, EntityState, EntityAdapter, EntitySelectors, EntityStateAdapter, EntityId, Update, IdSelector, Comparer, } from './entities/models'; | ||
export type { AutoBatchOptions } from './autoBatchEnhancer'; | ||
export type { ExtractDispatchExtensions as TSHelpersExtractDispatchExtensions } from './tsHelpers'; |
@@ -103,2 +103,10 @@ import type { PayloadAction, BaseActionCreator } from '../createAction'; | ||
/** @public */ | ||
export interface ForkOptions { | ||
/** | ||
* If true, causes the parent task to not be marked as complete until | ||
* all autoJoined forks have completed or failed. | ||
*/ | ||
autoJoin: boolean; | ||
} | ||
/** @public */ | ||
export interface ListenerEffectAPI<State, Dispatch extends ReduxDispatch<AnyAction>, ExtraArgument = unknown> extends MiddlewareAPI<Dispatch, State> { | ||
@@ -206,4 +214,5 @@ /** | ||
* @param executor | ||
* @param options | ||
*/ | ||
fork<T>(executor: ForkedTaskExecutor<T>): ForkedTask<T>; | ||
fork<T>(executor: ForkedTaskExecutor<T>, options?: ForkOptions): ForkedTask<T>; | ||
/** | ||
@@ -210,0 +219,0 @@ * Returns a promise that resolves when `waitFor` resolves or |
@@ -36,3 +36,3 @@ import type { Action, AnyAction } from 'redux'; | ||
* All calls to `builder.addMatcher` must come after any calls to `builder.addCase` and before any calls to `builder.addDefaultCase`. | ||
* @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/advanced-types.html#using-type-predicates) | ||
* @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) | ||
* function | ||
@@ -39,0 +39,0 @@ * @param reducer - The actual case reducer function. |
@@ -1,2 +0,2 @@ | ||
import type { EndpointDefinitions, EndpointBuilder, EndpointDefinition, ReplaceTagTypes } from './endpointDefinitions'; | ||
import type { EndpointDefinitions, EndpointBuilder, EndpointDefinition, UpdateDefinitions } from './endpointDefinitions'; | ||
import type { UnionToIntersection, NoInfer, WithRequiredProp } from './tsHelpers'; | ||
@@ -35,8 +35,8 @@ import type { CoreModule } from './core/module'; | ||
*/ | ||
enhanceEndpoints<NewTagTypes extends string = never>(_: { | ||
enhanceEndpoints<NewTagTypes extends string = never, NewDefinitions extends EndpointDefinitions = never>(_: { | ||
addTagTypes?: readonly NewTagTypes[]; | ||
endpoints?: ReplaceTagTypes<Definitions, TagTypes | NoInfer<NewTagTypes>> extends infer NewDefinitions ? { | ||
endpoints?: UpdateDefinitions<Definitions, TagTypes | NoInfer<NewTagTypes>, NewDefinitions> extends infer NewDefinitions ? { | ||
[K in keyof NewDefinitions]?: Partial<NewDefinitions[K]> | ((definition: NewDefinitions[K]) => void); | ||
} : never; | ||
}): Api<BaseQuery, ReplaceTagTypes<Definitions, TagTypes | NewTagTypes>, ReducerPath, TagTypes | NewTagTypes, Enhancers>; | ||
}): Api<BaseQuery, UpdateDefinitions<Definitions, TagTypes | NewTagTypes, NewDefinitions>, ReducerPath, TagTypes | NewTagTypes, Enhancers>; | ||
}; |
import type { AnyAction } from '@reduxjs/toolkit'; | ||
import type { CombinedState as CombinedQueryState, QuerySubstateIdentifier, MutationSubstateIdentifier, Subscribers, ConfigState } from './apiState'; | ||
import type { CombinedState as CombinedQueryState, QuerySubstateIdentifier, MutationSubstateIdentifier, Subscribers, QueryCacheKey, ConfigState } from './apiState'; | ||
import type { MutationThunk, QueryThunk } from './buildThunks'; | ||
import type { AssertTagTypes, EndpointDefinitions } from '../endpointDefinitions'; | ||
import type { AssertTagTypes, EndpointDefinitions, FullTagDescription } from '../endpointDefinitions'; | ||
import type { Patch } from 'immer'; | ||
@@ -30,4 +30,11 @@ import type { ApiContext } from '../apiTypes'; | ||
resetApiState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>; | ||
updateProvidedBy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: { | ||
queryCacheKey: QueryCacheKey; | ||
providedTags: readonly FullTagDescription<string>[]; | ||
}], { | ||
queryCacheKey: QueryCacheKey; | ||
providedTags: readonly FullTagDescription<string>[]; | ||
}, `${string}/updateProvidedBy`, never, unknown>; | ||
removeMutationResult: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: MutationSubstateIdentifier], MutationSubstateIdentifier, `${string}/removeMutationResult`, never, unknown>; | ||
subscriptionsUpdated: import("@reduxjs/toolkit").ActionCreatorWithPayload<Patch[], `${string}/subscriptionsUpdated`>; | ||
subscriptionsUpdated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: Patch[]], Patch[], `${string}/subscriptionsUpdated`, never, unknown>; | ||
updateSubscriptionOptions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{ | ||
@@ -46,5 +53,7 @@ endpointName: string; | ||
removeQueryResult: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: QuerySubstateIdentifier], QuerySubstateIdentifier, `${string}/removeQueryResult`, never, unknown>; | ||
queryResultPatched: import("@reduxjs/toolkit").ActionCreatorWithPayload<QuerySubstateIdentifier & { | ||
queryResultPatched: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: QuerySubstateIdentifier & { | ||
patches: readonly Patch[]; | ||
}, `${string}/queryResultPatched`>; | ||
}], QuerySubstateIdentifier & { | ||
patches: readonly Patch[]; | ||
}, `${string}/queryResultPatched`, never, unknown>; | ||
middlewareRegistered: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, `${string}/middlewareRegistered`>; | ||
@@ -51,0 +60,0 @@ }; |
@@ -6,3 +6,3 @@ import type { InternalSerializeQueryArgs } from '../defaultSerializeQueryArgs'; | ||
import type { StartQueryActionCreatorOptions, QueryActionCreatorResult } from './buildInitiate'; | ||
import type { AssertTagTypes, EndpointDefinition, EndpointDefinitions, MutationDefinition, QueryArgFrom, QueryDefinition, ResultTypeFrom } from '../endpointDefinitions'; | ||
import type { AssertTagTypes, EndpointDefinition, EndpointDefinitions, MutationDefinition, QueryArgFrom, QueryDefinition, ResultTypeFrom, FullTagDescription } from '../endpointDefinitions'; | ||
import type { Draft } from '@reduxjs/toolkit'; | ||
@@ -67,4 +67,4 @@ import type { Patch } from 'immer'; | ||
export declare type UpsertRecipe<T> = (data: MaybeDrafted<T> | undefined) => void | MaybeDrafted<T>; | ||
export declare type PatchQueryDataThunk<Definitions extends EndpointDefinitions, PartialState> = <EndpointName extends QueryKeys<Definitions>>(endpointName: EndpointName, args: QueryArgFrom<Definitions[EndpointName]>, patches: readonly Patch[]) => ThunkAction<void, PartialState, any, AnyAction>; | ||
export declare type UpdateQueryDataThunk<Definitions extends EndpointDefinitions, PartialState> = <EndpointName extends QueryKeys<Definitions>>(endpointName: EndpointName, args: QueryArgFrom<Definitions[EndpointName]>, updateRecipe: Recipe<ResultTypeFrom<Definitions[EndpointName]>>) => ThunkAction<PatchCollection, PartialState, any, AnyAction>; | ||
export declare type PatchQueryDataThunk<Definitions extends EndpointDefinitions, PartialState> = <EndpointName extends QueryKeys<Definitions>>(endpointName: EndpointName, args: QueryArgFrom<Definitions[EndpointName]>, patches: readonly Patch[], updateProvided?: boolean) => ThunkAction<void, PartialState, any, AnyAction>; | ||
export declare type UpdateQueryDataThunk<Definitions extends EndpointDefinitions, PartialState> = <EndpointName extends QueryKeys<Definitions>>(endpointName: EndpointName, args: QueryArgFrom<Definitions[EndpointName]>, updateRecipe: Recipe<ResultTypeFrom<Definitions[EndpointName]>>, updateProvided?: boolean) => ThunkAction<PatchCollection, PartialState, any, AnyAction>; | ||
export declare type UpsertQueryDataThunk<Definitions extends EndpointDefinitions, PartialState> = <EndpointName extends QueryKeys<Definitions>>(endpointName: EndpointName, args: QueryArgFrom<Definitions[EndpointName]>, value: ResultTypeFrom<Definitions[EndpointName]>) => ThunkAction<QueryActionCreatorResult<Definitions[EndpointName] extends QueryDefinition<any, any, any, any> ? Definitions[EndpointName] : never>, PartialState, any, AnyAction>; | ||
@@ -88,3 +88,3 @@ /** | ||
}; | ||
export declare function buildThunks<BaseQuery extends BaseQueryFn, ReducerPath extends string, Definitions extends EndpointDefinitions>({ reducerPath, baseQuery, context: { endpointDefinitions }, serializeQueryArgs, api, }: { | ||
export declare function buildThunks<BaseQuery extends BaseQueryFn, ReducerPath extends string, Definitions extends EndpointDefinitions>({ reducerPath, baseQuery, context: { endpointDefinitions }, serializeQueryArgs, api, assertTagType, }: { | ||
baseQuery: BaseQuery; | ||
@@ -95,2 +95,3 @@ reducerPath: ReducerPath; | ||
api: Api<BaseQuery, Definitions, ReducerPath, any>; | ||
assertTagType: AssertTagTypes; | ||
}): { | ||
@@ -143,3 +144,3 @@ queryThunk: AsyncThunk<unknown, QueryThunkArg, { | ||
}; | ||
export declare function calculateProvidedByThunk(action: UnwrapPromise<ReturnType<ReturnType<QueryThunk>> | ReturnType<ReturnType<MutationThunk>>>, type: 'providesTags' | 'invalidatesTags', endpointDefinitions: EndpointDefinitions, assertTagType: AssertTagTypes): readonly import("../endpointDefinitions").FullTagDescription<string>[]; | ||
export declare function calculateProvidedByThunk(action: UnwrapPromise<ReturnType<ReturnType<QueryThunk>> | ReturnType<ReturnType<MutationThunk>>>, type: 'providesTags' | 'invalidatesTags', endpointDefinitions: EndpointDefinitions, assertTagType: AssertTagTypes): readonly FullTagDescription<string>[]; | ||
export {}; |
import { CreateApi } from '../createApi'; | ||
import { coreModule, coreModuleName } from './module'; | ||
declare const createApi: CreateApi<typeof coreModuleName>; | ||
export { createApi, coreModule }; | ||
export { createApi, coreModule, coreModuleName }; |
@@ -5,4 +5,5 @@ import type { AnyAction, ThunkDispatch } from '@reduxjs/toolkit'; | ||
import type { BaseQueryExtraOptions, BaseQueryFn, BaseQueryResult, BaseQueryArg, BaseQueryApi, QueryReturnValue, BaseQueryError, BaseQueryMeta } from './baseQueryTypes'; | ||
import type { HasRequiredProps, MaybePromise, OmitFromUnion, CastAny } from './tsHelpers'; | ||
import type { HasRequiredProps, MaybePromise, OmitFromUnion, CastAny, NonUndefined, UnwrapPromise } from './tsHelpers'; | ||
import type { NEVER } from './fakeBaseQuery'; | ||
import type { Api } from '@reduxjs/toolkit/query'; | ||
declare const resultType: unique symbol; | ||
@@ -294,3 +295,3 @@ declare const baseQuery: unique symbol; | ||
* | ||
* Since this is wrapped with Immer, you , you may either mutate the `currentCacheValue` directly, | ||
* Since this is wrapped with Immer, you may either mutate the `currentCacheValue` directly, | ||
* or return a new value, but _not_ both at once. | ||
@@ -534,5 +535,9 @@ * | ||
export declare type TagTypesFrom<D extends EndpointDefinition<any, any, any, any>> = D extends EndpointDefinition<any, any, infer RP, any> ? RP : unknown; | ||
export declare type ReplaceTagTypes<Definitions extends EndpointDefinitions, NewTagTypes extends string> = { | ||
[K in keyof Definitions]: Definitions[K] extends QueryDefinition<infer QueryArg, infer BaseQuery, any, infer ResultType, infer ReducerPath> ? QueryDefinition<QueryArg, BaseQuery, NewTagTypes, ResultType, ReducerPath> : Definitions[K] extends MutationDefinition<infer QueryArg, infer BaseQuery, any, infer ResultType, infer ReducerPath> ? MutationDefinition<QueryArg, BaseQuery, NewTagTypes, ResultType, ReducerPath> : never; | ||
export declare type TagTypesFromApi<T> = T extends Api<any, any, any, infer TagTypes> ? TagTypes : never; | ||
export declare type DefinitionsFromApi<T> = T extends Api<any, infer Definitions, any, any> ? Definitions : never; | ||
export declare type TransformedResponse<NewDefinitions extends EndpointDefinitions, K, ResultType> = K extends keyof NewDefinitions ? NewDefinitions[K]['transformResponse'] extends undefined ? ResultType : UnwrapPromise<ReturnType<NonUndefined<NewDefinitions[K]['transformResponse']>>> : ResultType; | ||
export declare type OverrideResultType<Definition, NewResultType> = Definition extends QueryDefinition<infer QueryArg, infer BaseQuery, infer TagTypes, any, infer ReducerPath> ? QueryDefinition<QueryArg, BaseQuery, TagTypes, NewResultType, ReducerPath> : Definition extends MutationDefinition<infer QueryArg, infer BaseQuery, infer TagTypes, any, infer ReducerPath> ? MutationDefinition<QueryArg, BaseQuery, TagTypes, NewResultType, ReducerPath> : never; | ||
export declare type UpdateDefinitions<Definitions extends EndpointDefinitions, NewTagTypes extends string, NewDefinitions extends EndpointDefinitions> = { | ||
[K in keyof Definitions]: Definitions[K] extends QueryDefinition<infer QueryArg, infer BaseQuery, any, infer ResultType, infer ReducerPath> ? QueryDefinition<QueryArg, BaseQuery, NewTagTypes, TransformedResponse<NewDefinitions, K, ResultType>, ReducerPath> : Definitions[K] extends MutationDefinition<infer QueryArg, infer BaseQuery, any, infer ResultType, infer ReducerPath> ? MutationDefinition<QueryArg, BaseQuery, NewTagTypes, TransformedResponse<NewDefinitions, K, ResultType>, ReducerPath> : never; | ||
}; | ||
export {}; |
@@ -134,3 +134,3 @@ import type { BaseQueryApi, BaseQueryFn } from './baseQueryTypes'; | ||
*/ | ||
export declare function fetchBaseQuery({ baseUrl, prepareHeaders, fetchFn, paramsSerializer, isJsonContentType, jsonContentType, jsonReplacer, timeout: defaultTimeout, validateStatus: globalValidateStatus, ...baseFetchOptions }?: FetchBaseQueryArgs): BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError, {}, FetchBaseQueryMeta>; | ||
export declare function fetchBaseQuery({ baseUrl, prepareHeaders, fetchFn, paramsSerializer, isJsonContentType, jsonContentType, jsonReplacer, timeout: defaultTimeout, responseHandler: globalResponseHandler, validateStatus: globalValidateStatus, ...baseFetchOptions }?: FetchBaseQueryArgs): BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError, {}, FetchBaseQueryMeta>; | ||
export {}; |
@@ -0,5 +1,6 @@ | ||
export type { CombinedState, QueryCacheKey, QueryKeys, QuerySubState, RootState, SubscriptionOptions, } from './core/apiState'; | ||
export { QueryStatus } from './core/apiState'; | ||
export type { Api, Module, ApiModules } from './apiTypes'; | ||
export type { Api, ApiContext, ApiModules, Module } from './apiTypes'; | ||
export type { BaseQueryApi, BaseQueryEnhancer, BaseQueryFn, } from './baseQueryTypes'; | ||
export type { EndpointDefinitions, EndpointDefinition, QueryDefinition, MutationDefinition, TagDescription, } from './endpointDefinitions'; | ||
export type { EndpointDefinitions, EndpointDefinition, QueryDefinition, MutationDefinition, TagDescription, QueryArgFrom, ResultTypeFrom, DefinitionType, } from './endpointDefinitions'; | ||
export { fetchBaseQuery } from './fetchBaseQuery'; | ||
@@ -10,3 +11,4 @@ export type { FetchBaseQueryError, FetchBaseQueryMeta, FetchArgs, } from './fetchBaseQuery'; | ||
export { skipSelector, skipToken } from './core/buildSelectors'; | ||
export type { SkipToken } from './core/buildSelectors'; | ||
export type { QueryResultSelectorResult, MutationResultSelectorResult, SkipToken, } from './core/buildSelectors'; | ||
export type { QueryActionCreatorResult, MutationActionCreatorResult, } from './core/buildInitiate'; | ||
export type { CreateApi, CreateApiOptions } from './createApi'; | ||
@@ -16,3 +18,6 @@ export { buildCreateApi } from './createApi'; | ||
export { copyWithStructuralSharing } from './utils/copyWithStructuralSharing'; | ||
export { createApi, coreModule } from './core'; | ||
export { createApi, coreModule, coreModuleName } from './core'; | ||
export type { ApiEndpointMutation, ApiEndpointQuery, CoreModule, PrefetchOptions, } from './core/module'; | ||
export { defaultSerializeQueryArgs } from './defaultSerializeQueryArgs'; | ||
export type { SerializeQueryArgs } from './defaultSerializeQueryArgs'; | ||
export type { Id as TSHelpersId, NoInfer as TSHelpersNoInfer, Override as TSHelpersOverride, } from './tsHelpers'; |
import type { Context } from 'react'; | ||
import type { ReactReduxContextValue } from 'react-redux'; | ||
import { setupListeners } from '@reduxjs/toolkit/query'; | ||
import type { Api } from '@reduxjs/toolkit/dist/query/apiTypes'; | ||
import type { Api } from '@reduxjs/toolkit/query'; | ||
/** | ||
@@ -10,3 +10,3 @@ * Can be used as a `Provider` if you **do not already have a Redux store**. | ||
* ```tsx | ||
* // codeblock-meta title="Basic usage - wrap your App with ApiProvider" | ||
* // codeblock-meta no-transpile title="Basic usage - wrap your App with ApiProvider" | ||
* import * as React from 'react'; | ||
@@ -13,0 +13,0 @@ * import { ApiProvider } from '@reduxjs/toolkit/query/react'; |
import { useEffect } from 'react'; | ||
import { QueryStatus } from '@reduxjs/toolkit/query'; | ||
import type { QuerySubState, SubscriptionOptions, QueryKeys } from '@reduxjs/toolkit/dist/query/core/apiState'; | ||
import type { EndpointDefinitions, MutationDefinition, QueryDefinition, QueryArgFrom, ResultTypeFrom } from '@reduxjs/toolkit/dist/query/endpointDefinitions'; | ||
import type { MutationResultSelectorResult, SkipToken } from '@reduxjs/toolkit/dist/query/core/buildSelectors'; | ||
import type { QueryActionCreatorResult, MutationActionCreatorResult } from '@reduxjs/toolkit/dist/query/core/buildInitiate'; | ||
import type { SerializeQueryArgs } from '@reduxjs/toolkit/dist/query/defaultSerializeQueryArgs'; | ||
import type { Api, ApiContext } from '@reduxjs/toolkit/dist/query/apiTypes'; | ||
import type { Id, NoInfer, Override } from '@reduxjs/toolkit/dist/query/tsHelpers'; | ||
import type { CoreModule, PrefetchOptions } from '@reduxjs/toolkit/dist/query/core/module'; | ||
import type { QuerySubState, SubscriptionOptions, QueryKeys } from '@reduxjs/toolkit/query'; | ||
import type { EndpointDefinitions, MutationDefinition, QueryDefinition, QueryArgFrom, ResultTypeFrom } from '@reduxjs/toolkit/query'; | ||
import type { MutationResultSelectorResult, SkipToken } from '@reduxjs/toolkit/query'; | ||
import type { QueryActionCreatorResult, MutationActionCreatorResult } from '@reduxjs/toolkit/query'; | ||
import type { SerializeQueryArgs } from '@reduxjs/toolkit/query'; | ||
import type { Api, ApiContext } from '@reduxjs/toolkit/query'; | ||
import type { TSHelpersId, TSHelpersNoInfer, TSHelpersOverride } from '@reduxjs/toolkit/query'; | ||
import type { CoreModule, PrefetchOptions } from '@reduxjs/toolkit/query'; | ||
import type { ReactHooksModuleOptions } from './module'; | ||
@@ -66,3 +66,3 @@ import type { UninitializedValue } from './constants'; | ||
* ```tsx | ||
* // codeblock-meta title="Skip example" | ||
* // codeblock-meta no-transpile title="Skip example" | ||
* const Pokemon = ({ name, skip }: { name: string; skip: boolean }) => { | ||
@@ -250,3 +250,3 @@ * const { data, error, status } = useGetPokemonByNameQuery(name, { | ||
}; | ||
export declare type UseQueryStateResult<_ extends QueryDefinition<any, any, any, any>, R> = NoInfer<R>; | ||
export declare type UseQueryStateResult<_ extends QueryDefinition<any, any, any, any>, R> = TSHelpersNoInfer<R>; | ||
/** | ||
@@ -256,3 +256,3 @@ * Helper type to manually type the result | ||
*/ | ||
export declare type TypedUseQueryStateResult<ResultType, QueryArg, BaseQuery extends BaseQueryFn, R = UseQueryStateDefaultResult<QueryDefinition<QueryArg, BaseQuery, string, ResultType, string>>> = NoInfer<R>; | ||
export declare type TypedUseQueryStateResult<ResultType, QueryArg, BaseQuery extends BaseQueryFn, R = UseQueryStateDefaultResult<QueryDefinition<QueryArg, BaseQuery, string, ResultType, string>>> = TSHelpersNoInfer<R>; | ||
declare type UseQueryStateBaseResult<D extends QueryDefinition<any, any, any, any>> = QuerySubState<D> & { | ||
@@ -286,7 +286,7 @@ /** | ||
}; | ||
declare type UseQueryStateDefaultResult<D extends QueryDefinition<any, any, any, any>> = Id<Override<Extract<UseQueryStateBaseResult<D>, { | ||
declare type UseQueryStateDefaultResult<D extends QueryDefinition<any, any, any, any>> = TSHelpersId<TSHelpersOverride<Extract<UseQueryStateBaseResult<D>, { | ||
status: QueryStatus.uninitialized; | ||
}>, { | ||
isUninitialized: true; | ||
}> | Override<UseQueryStateBaseResult<D>, { | ||
}> | TSHelpersOverride<UseQueryStateBaseResult<D>, { | ||
isLoading: true; | ||
@@ -318,3 +318,3 @@ isFetching: boolean; | ||
}; | ||
export declare type UseMutationStateResult<D extends MutationDefinition<any, any, any, any>, R> = NoInfer<R> & { | ||
export declare type UseMutationStateResult<D extends MutationDefinition<any, any, any, any>, R> = TSHelpersNoInfer<R> & { | ||
originalArgs?: QueryArgFrom<D>; | ||
@@ -321,0 +321,0 @@ /** |
@@ -1,7 +0,6 @@ | ||
import { CreateApi } from '@reduxjs/toolkit/query'; | ||
import { reactHooksModule, reactHooksModuleName } from './module'; | ||
export * from '@reduxjs/toolkit/query'; | ||
export { ApiProvider } from './ApiProvider'; | ||
declare const createApi: CreateApi<typeof import("@reduxjs/toolkit/dist/query/core/module").coreModuleName | typeof reactHooksModuleName>; | ||
declare const createApi: import("@reduxjs/toolkit/query").CreateApi<typeof import("@reduxjs/toolkit/query").coreModuleName | typeof reactHooksModuleName>; | ||
export type { TypedUseQueryHookResult, TypedUseQueryStateResult, TypedUseQuerySubscriptionResult, TypedUseMutationResult, } from './buildHooks'; | ||
export { createApi, reactHooksModule }; | ||
export { createApi, reactHooksModule, reactHooksModuleName }; |
import type { MutationHooks, QueryHooks } from './buildHooks'; | ||
import type { EndpointDefinitions, QueryDefinition, MutationDefinition, QueryArgFrom } from '@reduxjs/toolkit/dist/query/endpointDefinitions'; | ||
import type { EndpointDefinitions, QueryDefinition, MutationDefinition, QueryArgFrom } from '@reduxjs/toolkit/query'; | ||
import type { Module } from '../apiTypes'; | ||
import type { BaseQueryFn } from '@reduxjs/toolkit/dist/query/baseQueryTypes'; | ||
import type { BaseQueryFn } from '@reduxjs/toolkit/query'; | ||
import type { HooksWithUniqueNames } from './namedHooks'; | ||
@@ -10,3 +10,3 @@ import type { QueryKeys } from '../core/apiState'; | ||
export declare type ReactHooksModule = typeof reactHooksModuleName; | ||
declare module '@reduxjs/toolkit/dist/query/apiTypes' { | ||
declare module '@reduxjs/toolkit/query' { | ||
interface ApiModules<BaseQuery extends BaseQueryFn, Definitions extends EndpointDefinitions, ReducerPath extends string, TagTypes extends string> { | ||
@@ -13,0 +13,0 @@ [reactHooksModuleName]: { |
import type { UseMutation, UseLazyQuery, UseQuery } from './buildHooks'; | ||
import type { DefinitionType, EndpointDefinitions, MutationDefinition, QueryDefinition } from '@reduxjs/toolkit/dist/query/endpointDefinitions'; | ||
export declare type HooksWithUniqueNames<Definitions extends EndpointDefinitions> = keyof Definitions extends infer Keys ? Keys extends string ? Definitions[Keys] extends { | ||
type: DefinitionType.query; | ||
} ? { | ||
[K in Keys as `use${Capitalize<K>}Query`]: UseQuery<Extract<Definitions[K], QueryDefinition<any, any, any, any>>>; | ||
} & { | ||
[K in Keys as `useLazy${Capitalize<K>}Query`]: UseLazyQuery<Extract<Definitions[K], QueryDefinition<any, any, any, any>>>; | ||
} : Definitions[Keys] extends { | ||
type: DefinitionType.mutation; | ||
} ? { | ||
[K in Keys as `use${Capitalize<K>}Mutation`]: UseMutation<Extract<Definitions[K], MutationDefinition<any, any, any, any>>>; | ||
} : never : never : never; | ||
import type { DefinitionType, EndpointDefinitions, MutationDefinition, QueryDefinition } from '@reduxjs/toolkit/query'; | ||
declare type QueryHookNames<Definitions extends EndpointDefinitions> = { | ||
[K in keyof Definitions as Definitions[K] extends { | ||
type: DefinitionType.query; | ||
} ? `use${Capitalize<K & string>}Query` : never]: UseQuery<Extract<Definitions[K], QueryDefinition<any, any, any, any>>>; | ||
}; | ||
declare type LazyQueryHookNames<Definitions extends EndpointDefinitions> = { | ||
[K in keyof Definitions as Definitions[K] extends { | ||
type: DefinitionType.query; | ||
} ? `useLazy${Capitalize<K & string>}Query` : never]: UseLazyQuery<Extract<Definitions[K], QueryDefinition<any, any, any, any>>>; | ||
}; | ||
declare type MutationHookNames<Definitions extends EndpointDefinitions> = { | ||
[K in keyof Definitions as Definitions[K] extends { | ||
type: DefinitionType.mutation; | ||
} ? `use${Capitalize<K & string>}Mutation` : never]: UseMutation<Extract<Definitions[K], MutationDefinition<any, any, any, any>>>; | ||
}; | ||
export declare type HooksWithUniqueNames<Definitions extends EndpointDefinitions> = QueryHookNames<Definitions> & LazyQueryHookNames<Definitions> & MutationHookNames<Definitions>; | ||
export {}; |
@@ -56,3 +56,4 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) { | ||
createApi: function () { return createApi; }, | ||
reactHooksModule: function () { return reactHooksModule; } | ||
reactHooksModule: function () { return reactHooksModule; }, | ||
reactHooksModuleName: function () { return reactHooksModuleName; } | ||
}); | ||
@@ -72,9 +73,9 @@ var import_query3 = __toModule(require("@reduxjs/toolkit/query")); | ||
}); }, [queryArgs, serialize, endpointDefinition, endpointName]); | ||
var cache = (0, import_react.useRef)(incoming); | ||
var cache2 = (0, import_react.useRef)(incoming); | ||
(0, import_react.useEffect)(function () { | ||
if (cache.current.serialized !== incoming.serialized) { | ||
cache.current = incoming; | ||
if (cache2.current.serialized !== incoming.serialized) { | ||
cache2.current = incoming; | ||
} | ||
}, [incoming]); | ||
return cache.current.serialized === incoming.serialized ? cache.current.queryArgs : queryArgs; | ||
return cache2.current.serialized === incoming.serialized ? cache2.current.queryArgs : queryArgs; | ||
} | ||
@@ -87,18 +88,31 @@ // src/query/react/constants.ts | ||
function useShallowStableValue(value) { | ||
var cache = (0, import_react2.useRef)(value); | ||
var cache2 = (0, import_react2.useRef)(value); | ||
(0, import_react2.useEffect)(function () { | ||
if (!(0, import_react_redux.shallowEqual)(cache.current, value)) { | ||
cache.current = value; | ||
if (!(0, import_react_redux.shallowEqual)(cache2.current, value)) { | ||
cache2.current = value; | ||
} | ||
}, [value]); | ||
return (0, import_react_redux.shallowEqual)(cache.current, value) ? cache.current : value; | ||
return (0, import_react_redux.shallowEqual)(cache2.current, value) ? cache2.current : value; | ||
} | ||
// src/query/defaultSerializeQueryArgs.ts | ||
var import_toolkit = __toModule(require("@reduxjs/toolkit")); | ||
var cache = WeakMap ? new WeakMap() : void 0; | ||
var defaultSerializeQueryArgs = function (_c) { | ||
var endpointName = _c.endpointName, queryArgs = _c.queryArgs; | ||
return endpointName + "(" + JSON.stringify(queryArgs, function (key, value) { return (0, import_toolkit.isPlainObject)(value) ? Object.keys(value).sort().reduce(function (acc, key2) { | ||
acc[key2] = value[key2]; | ||
return acc; | ||
}, {}) : value; }) + ")"; | ||
var serialized = ""; | ||
var cached = cache == null ? void 0 : cache.get(queryArgs); | ||
if (typeof cached === "string") { | ||
serialized = cached; | ||
} | ||
else { | ||
var stringified = JSON.stringify(queryArgs, function (key, value) { return (0, import_toolkit.isPlainObject)(value) ? Object.keys(value).sort().reduce(function (acc, key2) { | ||
acc[key2] = value[key2]; | ||
return acc; | ||
}, {}) : value; }); | ||
if ((0, import_toolkit.isPlainObject)(queryArgs)) { | ||
cache == null ? void 0 : cache.set(queryArgs, stringified); | ||
} | ||
serialized = stringified; | ||
} | ||
return endpointName + "(" + serialized + ")"; | ||
}; | ||
@@ -138,5 +152,2 @@ // src/query/react/buildHooks.ts | ||
} | ||
if (queryArgs === import_query.skipToken) { | ||
lastResult = void 0; | ||
} | ||
var data = currentState.isSuccess ? currentState.data : lastResult == null ? void 0 : lastResult.data; | ||
@@ -194,3 +205,5 @@ if (data === void 0) | ||
usePossiblyImmediateEffect(function () { | ||
promiseRef.current = void 0; | ||
if (subscriptionRemoved) { | ||
promiseRef.current = void 0; | ||
} | ||
}, [subscriptionRemoved]); | ||
@@ -197,0 +210,0 @@ usePossiblyImmediateEffect(function () { |
@@ -1,2 +0,2 @@ | ||
var e=this&&this.__spreadArray||function(e,r){for(var t=0,n=r.length,u=e.length;t<n;t++,u++)e[u]=r[t];return e},r=Object.create,t=Object.defineProperty,n=Object.defineProperties,u=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,c=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,l=function(e,r,n){return r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n},d=function(e,r){for(var t in r||(r={}))a.call(r,t)&&l(e,t,r[t]);if(s)for(var n=0,u=s(r);n<u.length;n++)f.call(r,t=u[n])&&l(e,t,r[t]);return e},p=function(e,r){return n(e,i(r))},v=function(e){return t(e,"__esModule",{value:!0})},y=function(e,r,n){if(r&&"object"==typeof r||"function"==typeof r)for(var i=function(i){a.call(e,i)||"default"===i||t(e,i,{get:function(){return r[i]},enumerable:!(n=u(r,i))||n.enumerable})},s=0,c=o(r);s<c.length;s++)i(c[s]);return e},b=function(e){return y(v(t(null!=e?r(c(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};v(exports),function(e,r){for(var n in r)t(e,n,{get:r[n],enumerable:!0})}(exports,{ApiProvider:function(){return V},createApi:function(){return J},reactHooksModule:function(){return N}});var h=b(require("@reduxjs/toolkit/query")),g=b(require("@reduxjs/toolkit")),m=b(require("react")),q=b(require("@reduxjs/toolkit/query")),S=b(require("react-redux")),O=b(require("react"));function k(e,r,t,n){var u=(0,O.useMemo)((function(){return{queryArgs:e,serialized:"object"==typeof e?r({queryArgs:e,endpointDefinition:t,endpointName:n}):e}}),[e,r,t,n]),i=(0,O.useRef)(u);return(0,O.useEffect)((function(){i.current.serialized!==u.serialized&&(i.current=u)}),[u]),i.current.serialized===u.serialized?i.current.queryArgs:e}var E=Symbol(),j=b(require("react")),x=b(require("react-redux"));function Q(e){var r=(0,j.useRef)(e);return(0,j.useEffect)((function(){(0,x.shallowEqual)(r.current,e)||(r.current=e)}),[e]),(0,x.shallowEqual)(r.current,e)?r.current:e}var M,w,A=b(require("@reduxjs/toolkit")),R=function(e){return e.endpointName+"("+JSON.stringify(e.queryArgs,(function(e,r){return(0,A.isPlainObject)(r)?Object.keys(r).sort().reduce((function(e,t){return e[t]=r[t],e}),{}):r}))+")"},L="undefined"!=typeof window&&window.document&&window.document.createElement?m.useLayoutEffect:m.useEffect,z=function(e){return e},C=function(e){return e.isUninitialized?p(d({},e),{isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:q.QueryStatus.pending}):e};function D(e){return e.replace(e[0],e[0].toUpperCase())}function P(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,e([r],t))}(w=M||(M={})).query="query",w.mutation="mutation";var I=b(require("react-redux")),_=Symbol(),N=function(e){var r=void 0===e?{}:e,t=r.batch,n=void 0===t?I.batch:t,u=r.useDispatch,i=void 0===u?I.useDispatch:u,o=r.useSelector,s=void 0===o?I.useSelector:o,c=r.useStore,a=void 0===c?I.useStore:c,f=r.unstable__sideEffectsInRender,l=void 0!==f&&f;return{name:_,init:function(e,r,t){var u=e,o=function(e){var r=e.api,t=e.moduleOptions,n=t.batch,u=t.useDispatch,i=t.useSelector,o=t.useStore,s=e.serializeQueryArgs,c=e.context,a=t.unstable__sideEffectsInRender?function(e){return e()}:m.useEffect;return{buildQueryHooks:function(e){var t=function(t,n){var i=void 0===n?{}:n,o=i.refetchOnReconnect,s=i.refetchOnFocus,f=i.refetchOnMountOrArgChange,l=i.skip,d=void 0!==l&&l,p=i.pollingInterval,v=void 0===p?0:p,y=r.endpoints[e].initiate,b=u(),h=k(d?q.skipToken:t,R,c.endpointDefinitions[e],e),g=Q({refetchOnReconnect:o,refetchOnFocus:s,pollingInterval:v}),S=(0,m.useRef)(!1),O=(0,m.useRef)(),E=O.current||{},j=E.queryCacheKey,x=E.requestId,M=!1;if(j&&x){var w=b(r.internalActions.internal_probeSubscription({queryCacheKey:j,requestId:x}));M=!!w}var A=!M&&S.current;return a((function(){S.current=M})),a((function(){O.current=void 0}),[A]),a((function(){var e,r=O.current;if(h===q.skipToken)return null==r||r.unsubscribe(),void(O.current=void 0);var t=null==(e=O.current)?void 0:e.subscriptionOptions;if(r&&r.arg===h)g!==t&&r.updateSubscriptionOptions(g);else{null==r||r.unsubscribe();var n=b(y(h,{subscriptionOptions:g,forceRefetch:f}));O.current=n}}),[b,y,f,h,g,A]),(0,m.useEffect)((function(){return function(){var e;null==(e=O.current)||e.unsubscribe(),O.current=void 0}}),[]),(0,m.useMemo)((function(){return{refetch:function(){var e;if(!O.current)throw new Error("Cannot refetch a query that has not been started yet.");return null==(e=O.current)?void 0:e.refetch()}}}),[])},l=function(t){var i=void 0===t?{}:t,o=i.refetchOnReconnect,s=i.refetchOnFocus,c=i.pollingInterval,f=void 0===c?0:c,l=r.endpoints[e].initiate,d=u(),p=(0,m.useState)(E),v=p[0],y=p[1],b=(0,m.useRef)(),h=Q({refetchOnReconnect:o,refetchOnFocus:s,pollingInterval:f});a((function(){var e,r,t=null==(e=b.current)?void 0:e.subscriptionOptions;h!==t&&(null==(r=b.current)||r.updateSubscriptionOptions(h))}),[h]);var g=(0,m.useRef)(h);a((function(){g.current=h}),[h]);var q=(0,m.useCallback)((function(e,r){var t;return void 0===r&&(r=!1),n((function(){var n;null==(n=b.current)||n.unsubscribe(),b.current=t=d(l(e,{subscriptionOptions:g.current,forceRefetch:!r})),y(e)})),t}),[d,l]);return(0,m.useEffect)((function(){return function(){var e;null==(e=null==b?void 0:b.current)||e.unsubscribe()}}),[]),(0,m.useEffect)((function(){v===E||b.current||q(v,!0)}),[v,q]),(0,m.useMemo)((function(){return[q,v]}),[q,v])},v=function(t,n){var u=void 0===n?{}:n,a=u.skip,l=u.selectFromResult,d=r.endpoints[e].select,p=k(void 0!==a&&a?q.skipToken:t,s,c.endpointDefinitions[e],e),v=(0,m.useRef)(),y=(0,m.useMemo)((function(){return(0,g.createSelector)([d(p),function(e,r){return r},function(e){return p}],f)}),[d,p]),b=(0,m.useMemo)((function(){return l?(0,g.createSelector)([y],l):y}),[y,l]),h=i((function(e){return b(e,v.current)}),S.shallowEqual),O=o(),E=y(O.getState(),v.current);return L((function(){v.current=E}),[E]),h};return{useQueryState:v,useQuerySubscription:t,useLazyQuerySubscription:l,useLazyQuery:function(e){var r=l(e),t=r[0],n=r[1],u=v(n,p(d({},e),{skip:n===E})),i=(0,m.useMemo)((function(){return{lastArg:n}}),[n]);return(0,m.useMemo)((function(){return[t,u,i]}),[t,u,i])},useQuery:function(e,r){var n=t(e,r),u=v(e,d({selectFromResult:e===q.skipToken||(null==r?void 0:r.skip)?void 0:C},r));return(0,m.useDebugValue)({data:u.data,status:u.status,isLoading:u.isLoading,isSuccess:u.isSuccess,isError:u.isError,error:u.error}),(0,m.useMemo)((function(){return d(d({},u),n)}),[u,n])}}},buildMutationHook:function(e){return function(t){var o=void 0===t?{}:t,s=o.selectFromResult,c=void 0===s?z:s,a=o.fixedCacheKey,f=r.endpoints[e],l=f.select,v=f.initiate,y=u(),b=(0,m.useState)(),h=b[0],q=b[1];(0,m.useEffect)((function(){return function(){(null==h?void 0:h.arg.fixedCacheKey)||null==h||h.reset()}}),[h]);var O=(0,m.useCallback)((function(e){var r=y(v(e,{fixedCacheKey:a}));return q(r),r}),[y,v,a]),k=(h||{}).requestId,E=(0,m.useMemo)((function(){return(0,g.createSelector)([l({fixedCacheKey:a,requestId:null==h?void 0:h.requestId})],c)}),[l,h,c,a]),j=i(E,S.shallowEqual),x=null==a?null==h?void 0:h.arg.originalArgs:void 0,Q=(0,m.useCallback)((function(){n((function(){h&&q(void 0),a&&y(r.internalActions.removeMutationResult({requestId:k,fixedCacheKey:a}))}))}),[y,a,h,k]);(0,m.useDebugValue)({endpointName:j.endpointName,data:j.data,status:j.status,isLoading:j.isLoading,isSuccess:j.isSuccess,isError:j.isError,error:j.error});var M=(0,m.useMemo)((function(){return p(d({},j),{originalArgs:x,reset:Q})}),[j,x,Q]);return(0,m.useMemo)((function(){return[O,M]}),[O,M])}},usePrefetch:function(e,t){var n=u(),i=Q(t);return(0,m.useCallback)((function(t,u){return n(r.util.prefetch(e,t,d(d({},i),u)))}),[e,n,i])}};function f(e,r,t){if((null==r?void 0:r.endpointName)&&e.isUninitialized){var n=r.endpointName,u=c.endpointDefinitions[n];s({queryArgs:r.originalArgs,endpointDefinition:u,endpointName:n})===s({queryArgs:t,endpointDefinition:u,endpointName:n})&&(r=void 0)}t===q.skipToken&&(r=void 0);var i=e.isSuccess?e.data:null==r?void 0:r.data;void 0===i&&(i=e.data);var o=void 0!==i,a=e.isLoading,f=!o&&a,l=e.isSuccess||a&&o;return p(d({},e),{data:i,currentData:e.data,isFetching:a,isLoading:f,isSuccess:l})}}({api:e,moduleOptions:{batch:n,useDispatch:i,useSelector:s,useStore:a,unstable__sideEffectsInRender:l},serializeQueryArgs:r.serializeQueryArgs,context:t}),c=o.buildQueryHooks,f=o.buildMutationHook;return P(u,{usePrefetch:o.usePrefetch}),P(t,{batch:n}),{injectEndpoint:function(r,t){if(t.type===M.query){var n=c(r),i=n.useQuery,o=n.useLazyQuery;P(u.endpoints[r],{useQuery:i,useLazyQuery:o,useLazyQuerySubscription:n.useLazyQuerySubscription,useQueryState:n.useQueryState,useQuerySubscription:n.useQuerySubscription}),e["use"+D(r)+"Query"]=i,e["useLazy"+D(r)+"Query"]=o}else if(t.type===M.mutation){var s=f(r);P(u.endpoints[r],{useMutation:s}),e["use"+D(r)+"Mutation"]=s}}}}}};y(exports,b(require("@reduxjs/toolkit/query")));var F=b(require("@reduxjs/toolkit")),K=b(require("react")),H=b(require("react")),T=b(require("react-redux")),U=b(require("@reduxjs/toolkit/query"));function V(e){var r=H.default.useState((function(){var r;return(0,F.configureStore)({reducer:(r={},r[e.api.reducerPath]=e.api.reducer,r),middleware:function(r){return r().concat(e.api.middleware)}})}))[0];return(0,K.useEffect)((function(){return!1===e.setupListeners?void 0:(0,U.setupListeners)(r.dispatch,e.setupListeners)}),[e.setupListeners,r.dispatch]),H.default.createElement(T.Provider,{store:r,context:e.context},e.children)}var J=(0,h.buildCreateApi)((0,h.coreModule)(),N()); | ||
var e=this&&this.__spreadArray||function(e,r){for(var t=0,n=r.length,u=e.length;t<n;t++,u++)e[u]=r[t];return e},r=Object.create,t=Object.defineProperty,n=Object.defineProperties,u=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,c=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,l=function(e,r,n){return r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n},d=function(e,r){for(var t in r||(r={}))a.call(r,t)&&l(e,t,r[t]);if(s)for(var n=0,u=s(r);n<u.length;n++)f.call(r,t=u[n])&&l(e,t,r[t]);return e},p=function(e,r){return n(e,i(r))},v=function(e){return t(e,"__esModule",{value:!0})},y=function(e,r,n){if(r&&"object"==typeof r||"function"==typeof r)for(var i=function(i){a.call(e,i)||"default"===i||t(e,i,{get:function(){return r[i]},enumerable:!(n=u(r,i))||n.enumerable})},s=0,c=o(r);s<c.length;s++)i(c[s]);return e},b=function(e){return y(v(t(null!=e?r(c(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};v(exports),function(e,r){for(var n in r)t(e,n,{get:r[n],enumerable:!0})}(exports,{ApiProvider:function(){return W},createApi:function(){return J},reactHooksModule:function(){return F},reactHooksModuleName:function(){return N}});var g=b(require("@reduxjs/toolkit/query")),h=b(require("@reduxjs/toolkit")),m=b(require("react")),q=b(require("@reduxjs/toolkit/query")),O=b(require("react-redux")),S=b(require("react"));function k(e,r,t,n){var u=(0,S.useMemo)((function(){return{queryArgs:e,serialized:"object"==typeof e?r({queryArgs:e,endpointDefinition:t,endpointName:n}):e}}),[e,r,t,n]),i=(0,S.useRef)(u);return(0,S.useEffect)((function(){i.current.serialized!==u.serialized&&(i.current=u)}),[u]),i.current.serialized===u.serialized?i.current.queryArgs:e}var E=Symbol(),j=b(require("react")),M=b(require("react-redux"));function x(e){var r=(0,j.useRef)(e);return(0,j.useEffect)((function(){(0,M.shallowEqual)(r.current,e)||(r.current=e)}),[e]),(0,M.shallowEqual)(r.current,e)?r.current:e}var Q,w,A=b(require("@reduxjs/toolkit")),R=WeakMap?new WeakMap:void 0,L=function(e){var r=e.endpointName,t=e.queryArgs,n="",u=null==R?void 0:R.get(t);if("string"==typeof u)n=u;else{var i=JSON.stringify(t,(function(e,r){return(0,A.isPlainObject)(r)?Object.keys(r).sort().reduce((function(e,t){return e[t]=r[t],e}),{}):r}));(0,A.isPlainObject)(t)&&(null==R||R.set(t,i)),n=i}return r+"("+n+")"},z="undefined"!=typeof window&&window.document&&window.document.createElement?m.useLayoutEffect:m.useEffect,P=function(e){return e},C=function(e){return e.isUninitialized?p(d({},e),{isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:q.QueryStatus.pending}):e};function D(e){return e.replace(e[0],e[0].toUpperCase())}function I(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,e([r],t))}(w=Q||(Q={})).query="query",w.mutation="mutation";var _=b(require("react-redux")),N=Symbol(),F=function(e){var r=void 0===e?{}:e,t=r.batch,n=void 0===t?_.batch:t,u=r.useDispatch,i=void 0===u?_.useDispatch:u,o=r.useSelector,s=void 0===o?_.useSelector:o,c=r.useStore,a=void 0===c?_.useStore:c,f=r.unstable__sideEffectsInRender,l=void 0!==f&&f;return{name:N,init:function(e,r,t){var u=e,o=function(e){var r=e.api,t=e.moduleOptions,n=t.batch,u=t.useDispatch,i=t.useSelector,o=t.useStore,s=e.serializeQueryArgs,c=e.context,a=t.unstable__sideEffectsInRender?function(e){return e()}:m.useEffect;return{buildQueryHooks:function(e){var t=function(t,n){var i=void 0===n?{}:n,o=i.refetchOnReconnect,s=i.refetchOnFocus,f=i.refetchOnMountOrArgChange,l=i.skip,d=void 0!==l&&l,p=i.pollingInterval,v=void 0===p?0:p,y=r.endpoints[e].initiate,b=u(),g=k(d?q.skipToken:t,L,c.endpointDefinitions[e],e),h=x({refetchOnReconnect:o,refetchOnFocus:s,pollingInterval:v}),O=(0,m.useRef)(!1),S=(0,m.useRef)(),E=S.current||{},j=E.queryCacheKey,M=E.requestId,Q=!1;if(j&&M){var w=b(r.internalActions.internal_probeSubscription({queryCacheKey:j,requestId:M}));Q=!!w}var A=!Q&&O.current;return a((function(){O.current=Q})),a((function(){A&&(S.current=void 0)}),[A]),a((function(){var e,r=S.current;if(g===q.skipToken)return null==r||r.unsubscribe(),void(S.current=void 0);var t=null==(e=S.current)?void 0:e.subscriptionOptions;if(r&&r.arg===g)h!==t&&r.updateSubscriptionOptions(h);else{null==r||r.unsubscribe();var n=b(y(g,{subscriptionOptions:h,forceRefetch:f}));S.current=n}}),[b,y,f,g,h,A]),(0,m.useEffect)((function(){return function(){var e;null==(e=S.current)||e.unsubscribe(),S.current=void 0}}),[]),(0,m.useMemo)((function(){return{refetch:function(){var e;if(!S.current)throw new Error("Cannot refetch a query that has not been started yet.");return null==(e=S.current)?void 0:e.refetch()}}}),[])},l=function(t){var i=void 0===t?{}:t,o=i.refetchOnReconnect,s=i.refetchOnFocus,c=i.pollingInterval,f=void 0===c?0:c,l=r.endpoints[e].initiate,d=u(),p=(0,m.useState)(E),v=p[0],y=p[1],b=(0,m.useRef)(),g=x({refetchOnReconnect:o,refetchOnFocus:s,pollingInterval:f});a((function(){var e,r,t=null==(e=b.current)?void 0:e.subscriptionOptions;g!==t&&(null==(r=b.current)||r.updateSubscriptionOptions(g))}),[g]);var h=(0,m.useRef)(g);a((function(){h.current=g}),[g]);var q=(0,m.useCallback)((function(e,r){var t;return void 0===r&&(r=!1),n((function(){var n;null==(n=b.current)||n.unsubscribe(),b.current=t=d(l(e,{subscriptionOptions:h.current,forceRefetch:!r})),y(e)})),t}),[d,l]);return(0,m.useEffect)((function(){return function(){var e;null==(e=null==b?void 0:b.current)||e.unsubscribe()}}),[]),(0,m.useEffect)((function(){v===E||b.current||q(v,!0)}),[v,q]),(0,m.useMemo)((function(){return[q,v]}),[q,v])},v=function(t,n){var u=void 0===n?{}:n,a=u.skip,l=u.selectFromResult,d=r.endpoints[e].select,p=k(void 0!==a&&a?q.skipToken:t,s,c.endpointDefinitions[e],e),v=(0,m.useRef)(),y=(0,m.useMemo)((function(){return(0,h.createSelector)([d(p),function(e,r){return r},function(e){return p}],f)}),[d,p]),b=(0,m.useMemo)((function(){return l?(0,h.createSelector)([y],l):y}),[y,l]),g=i((function(e){return b(e,v.current)}),O.shallowEqual),S=o(),E=y(S.getState(),v.current);return z((function(){v.current=E}),[E]),g};return{useQueryState:v,useQuerySubscription:t,useLazyQuerySubscription:l,useLazyQuery:function(e){var r=l(e),t=r[0],n=r[1],u=v(n,p(d({},e),{skip:n===E})),i=(0,m.useMemo)((function(){return{lastArg:n}}),[n]);return(0,m.useMemo)((function(){return[t,u,i]}),[t,u,i])},useQuery:function(e,r){var n=t(e,r),u=v(e,d({selectFromResult:e===q.skipToken||(null==r?void 0:r.skip)?void 0:C},r));return(0,m.useDebugValue)({data:u.data,status:u.status,isLoading:u.isLoading,isSuccess:u.isSuccess,isError:u.isError,error:u.error}),(0,m.useMemo)((function(){return d(d({},u),n)}),[u,n])}}},buildMutationHook:function(e){return function(t){var o=void 0===t?{}:t,s=o.selectFromResult,c=void 0===s?P:s,a=o.fixedCacheKey,f=r.endpoints[e],l=f.select,v=f.initiate,y=u(),b=(0,m.useState)(),g=b[0],q=b[1];(0,m.useEffect)((function(){return function(){(null==g?void 0:g.arg.fixedCacheKey)||null==g||g.reset()}}),[g]);var S=(0,m.useCallback)((function(e){var r=y(v(e,{fixedCacheKey:a}));return q(r),r}),[y,v,a]),k=(g||{}).requestId,E=(0,m.useMemo)((function(){return(0,h.createSelector)([l({fixedCacheKey:a,requestId:null==g?void 0:g.requestId})],c)}),[l,g,c,a]),j=i(E,O.shallowEqual),M=null==a?null==g?void 0:g.arg.originalArgs:void 0,x=(0,m.useCallback)((function(){n((function(){g&&q(void 0),a&&y(r.internalActions.removeMutationResult({requestId:k,fixedCacheKey:a}))}))}),[y,a,g,k]);(0,m.useDebugValue)({endpointName:j.endpointName,data:j.data,status:j.status,isLoading:j.isLoading,isSuccess:j.isSuccess,isError:j.isError,error:j.error});var Q=(0,m.useMemo)((function(){return p(d({},j),{originalArgs:M,reset:x})}),[j,M,x]);return(0,m.useMemo)((function(){return[S,Q]}),[S,Q])}},usePrefetch:function(e,t){var n=u(),i=x(t);return(0,m.useCallback)((function(t,u){return n(r.util.prefetch(e,t,d(d({},i),u)))}),[e,n,i])}};function f(e,r,t){if((null==r?void 0:r.endpointName)&&e.isUninitialized){var n=r.endpointName,u=c.endpointDefinitions[n];s({queryArgs:r.originalArgs,endpointDefinition:u,endpointName:n})===s({queryArgs:t,endpointDefinition:u,endpointName:n})&&(r=void 0)}var i=e.isSuccess?e.data:null==r?void 0:r.data;void 0===i&&(i=e.data);var o=void 0!==i,a=e.isLoading,f=!o&&a,l=e.isSuccess||a&&o;return p(d({},e),{data:i,currentData:e.data,isFetching:a,isLoading:f,isSuccess:l})}}({api:e,moduleOptions:{batch:n,useDispatch:i,useSelector:s,useStore:a,unstable__sideEffectsInRender:l},serializeQueryArgs:r.serializeQueryArgs,context:t}),c=o.buildQueryHooks,f=o.buildMutationHook;return I(u,{usePrefetch:o.usePrefetch}),I(t,{batch:n}),{injectEndpoint:function(r,t){if(t.type===Q.query){var n=c(r),i=n.useQuery,o=n.useLazyQuery;I(u.endpoints[r],{useQuery:i,useLazyQuery:o,useLazyQuerySubscription:n.useLazyQuerySubscription,useQueryState:n.useQueryState,useQuerySubscription:n.useQuerySubscription}),e["use"+D(r)+"Query"]=i,e["useLazy"+D(r)+"Query"]=o}else if(t.type===Q.mutation){var s=f(r);I(u.endpoints[r],{useMutation:s}),e["use"+D(r)+"Mutation"]=s}}}}}};y(exports,b(require("@reduxjs/toolkit/query")));var K=b(require("@reduxjs/toolkit")),H=b(require("react")),T=b(require("react")),U=b(require("react-redux")),V=b(require("@reduxjs/toolkit/query"));function W(e){var r=T.default.useState((function(){var r;return(0,K.configureStore)({reducer:(r={},r[e.api.reducerPath]=e.api.reducer,r),middleware:function(r){return r().concat(e.api.middleware)}})}))[0];return(0,H.useEffect)((function(){return!1===e.setupListeners?void 0:(0,V.setupListeners)(r.dispatch,e.setupListeners)}),[e.setupListeners,r.dispatch]),T.default.createElement(U.Provider,{store:r,context:e.context},e.children)}var J=(0,g.buildCreateApi)((0,g.coreModule)(),F()); | ||
//# sourceMappingURL=rtk-query-react.cjs.production.min.js.map |
@@ -40,9 +40,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) { | ||
}); }, [queryArgs, serialize, endpointDefinition, endpointName]); | ||
var cache = useRef(incoming); | ||
var cache2 = useRef(incoming); | ||
useEffect(function () { | ||
if (cache.current.serialized !== incoming.serialized) { | ||
cache.current = incoming; | ||
if (cache2.current.serialized !== incoming.serialized) { | ||
cache2.current = incoming; | ||
} | ||
}, [incoming]); | ||
return cache.current.serialized === incoming.serialized ? cache.current.queryArgs : queryArgs; | ||
return cache2.current.serialized === incoming.serialized ? cache2.current.queryArgs : queryArgs; | ||
} | ||
@@ -55,18 +55,31 @@ // src/query/react/constants.ts | ||
function useShallowStableValue(value) { | ||
var cache = useRef2(value); | ||
var cache2 = useRef2(value); | ||
useEffect2(function () { | ||
if (!shallowEqual(cache.current, value)) { | ||
cache.current = value; | ||
if (!shallowEqual(cache2.current, value)) { | ||
cache2.current = value; | ||
} | ||
}, [value]); | ||
return shallowEqual(cache.current, value) ? cache.current : value; | ||
return shallowEqual(cache2.current, value) ? cache2.current : value; | ||
} | ||
// src/query/defaultSerializeQueryArgs.ts | ||
import { isPlainObject } from "@reduxjs/toolkit"; | ||
var cache = WeakMap ? new WeakMap() : void 0; | ||
var defaultSerializeQueryArgs = function (_c) { | ||
var endpointName = _c.endpointName, queryArgs = _c.queryArgs; | ||
return endpointName + "(" + JSON.stringify(queryArgs, function (key, value) { return isPlainObject(value) ? Object.keys(value).sort().reduce(function (acc, key2) { | ||
acc[key2] = value[key2]; | ||
return acc; | ||
}, {}) : value; }) + ")"; | ||
var serialized = ""; | ||
var cached = cache == null ? void 0 : cache.get(queryArgs); | ||
if (typeof cached === "string") { | ||
serialized = cached; | ||
} | ||
else { | ||
var stringified = JSON.stringify(queryArgs, function (key, value) { return isPlainObject(value) ? Object.keys(value).sort().reduce(function (acc, key2) { | ||
acc[key2] = value[key2]; | ||
return acc; | ||
}, {}) : value; }); | ||
if (isPlainObject(queryArgs)) { | ||
cache == null ? void 0 : cache.set(queryArgs, stringified); | ||
} | ||
serialized = stringified; | ||
} | ||
return endpointName + "(" + serialized + ")"; | ||
}; | ||
@@ -106,5 +119,2 @@ // src/query/react/buildHooks.ts | ||
} | ||
if (queryArgs === skipToken) { | ||
lastResult = void 0; | ||
} | ||
var data = currentState.isSuccess ? currentState.data : lastResult == null ? void 0 : lastResult.data; | ||
@@ -162,3 +172,5 @@ if (data === void 0) | ||
usePossiblyImmediateEffect(function () { | ||
promiseRef.current = void 0; | ||
if (subscriptionRemoved) { | ||
promiseRef.current = void 0; | ||
} | ||
}, [subscriptionRemoved]); | ||
@@ -451,3 +463,3 @@ usePossiblyImmediateEffect(function () { | ||
var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule()); | ||
export { ApiProvider, createApi, reactHooksModule }; | ||
export { ApiProvider, createApi, reactHooksModule, reactHooksModuleName }; | ||
//# sourceMappingURL=rtk-query-react.esm.js.map |
@@ -34,9 +34,9 @@ var __defProp = Object.defineProperty; | ||
}), [queryArgs, serialize, endpointDefinition, endpointName]); | ||
const cache = useRef(incoming); | ||
const cache2 = useRef(incoming); | ||
useEffect(() => { | ||
if (cache.current.serialized !== incoming.serialized) { | ||
cache.current = incoming; | ||
if (cache2.current.serialized !== incoming.serialized) { | ||
cache2.current = incoming; | ||
} | ||
}, [incoming]); | ||
return cache.current.serialized === incoming.serialized ? cache.current.queryArgs : queryArgs; | ||
return cache2.current.serialized === incoming.serialized ? cache2.current.queryArgs : queryArgs; | ||
} | ||
@@ -49,17 +49,30 @@ // src/query/react/constants.ts | ||
function useShallowStableValue(value) { | ||
const cache = useRef2(value); | ||
const cache2 = useRef2(value); | ||
useEffect2(() => { | ||
if (!shallowEqual(cache.current, value)) { | ||
cache.current = value; | ||
if (!shallowEqual(cache2.current, value)) { | ||
cache2.current = value; | ||
} | ||
}, [value]); | ||
return shallowEqual(cache.current, value) ? cache.current : value; | ||
return shallowEqual(cache2.current, value) ? cache2.current : value; | ||
} | ||
// src/query/defaultSerializeQueryArgs.ts | ||
import { isPlainObject } from "@reduxjs/toolkit"; | ||
var cache = WeakMap ? new WeakMap() : void 0; | ||
var defaultSerializeQueryArgs = ({ endpointName, queryArgs }) => { | ||
return `${endpointName}(${JSON.stringify(queryArgs, (key, value) => isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key2) => { | ||
acc[key2] = value[key2]; | ||
return acc; | ||
}, {}) : value)})`; | ||
let serialized = ""; | ||
const cached = cache == null ? void 0 : cache.get(queryArgs); | ||
if (typeof cached === "string") { | ||
serialized = cached; | ||
} | ||
else { | ||
const stringified = JSON.stringify(queryArgs, (key, value) => isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key2) => { | ||
acc[key2] = value[key2]; | ||
return acc; | ||
}, {}) : value); | ||
if (isPlainObject(queryArgs)) { | ||
cache == null ? void 0 : cache.set(queryArgs, stringified); | ||
} | ||
serialized = stringified; | ||
} | ||
return `${endpointName}(${serialized})`; | ||
}; | ||
@@ -98,5 +111,2 @@ // src/query/react/buildHooks.ts | ||
} | ||
if (queryArgs === skipToken) { | ||
lastResult = void 0; | ||
} | ||
let data = currentState.isSuccess ? currentState.data : lastResult == null ? void 0 : lastResult.data; | ||
@@ -154,3 +164,5 @@ if (data === void 0) | ||
usePossiblyImmediateEffect(() => { | ||
promiseRef.current = void 0; | ||
if (subscriptionRemoved) { | ||
promiseRef.current = void 0; | ||
} | ||
}, [subscriptionRemoved]); | ||
@@ -428,3 +440,3 @@ usePossiblyImmediateEffect(() => { | ||
var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule()); | ||
export { ApiProvider, createApi, reactHooksModule }; | ||
export { ApiProvider, createApi, reactHooksModule, reactHooksModuleName }; | ||
//# sourceMappingURL=rtk-query-react.modern.development.js.map |
@@ -34,9 +34,9 @@ var __defProp = Object.defineProperty; | ||
}), [queryArgs, serialize, endpointDefinition, endpointName]); | ||
const cache = useRef(incoming); | ||
const cache2 = useRef(incoming); | ||
useEffect(() => { | ||
if (cache.current.serialized !== incoming.serialized) { | ||
cache.current = incoming; | ||
if (cache2.current.serialized !== incoming.serialized) { | ||
cache2.current = incoming; | ||
} | ||
}, [incoming]); | ||
return cache.current.serialized === incoming.serialized ? cache.current.queryArgs : queryArgs; | ||
return cache2.current.serialized === incoming.serialized ? cache2.current.queryArgs : queryArgs; | ||
} | ||
@@ -49,17 +49,30 @@ // src/query/react/constants.ts | ||
function useShallowStableValue(value) { | ||
const cache = useRef2(value); | ||
const cache2 = useRef2(value); | ||
useEffect2(() => { | ||
if (!shallowEqual(cache.current, value)) { | ||
cache.current = value; | ||
if (!shallowEqual(cache2.current, value)) { | ||
cache2.current = value; | ||
} | ||
}, [value]); | ||
return shallowEqual(cache.current, value) ? cache.current : value; | ||
return shallowEqual(cache2.current, value) ? cache2.current : value; | ||
} | ||
// src/query/defaultSerializeQueryArgs.ts | ||
import { isPlainObject } from "@reduxjs/toolkit"; | ||
var cache = WeakMap ? new WeakMap() : void 0; | ||
var defaultSerializeQueryArgs = ({ endpointName, queryArgs }) => { | ||
return `${endpointName}(${JSON.stringify(queryArgs, (key, value) => isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key2) => { | ||
acc[key2] = value[key2]; | ||
return acc; | ||
}, {}) : value)})`; | ||
let serialized = ""; | ||
const cached = cache == null ? void 0 : cache.get(queryArgs); | ||
if (typeof cached === "string") { | ||
serialized = cached; | ||
} | ||
else { | ||
const stringified = JSON.stringify(queryArgs, (key, value) => isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key2) => { | ||
acc[key2] = value[key2]; | ||
return acc; | ||
}, {}) : value); | ||
if (isPlainObject(queryArgs)) { | ||
cache == null ? void 0 : cache.set(queryArgs, stringified); | ||
} | ||
serialized = stringified; | ||
} | ||
return `${endpointName}(${serialized})`; | ||
}; | ||
@@ -98,5 +111,2 @@ // src/query/react/buildHooks.ts | ||
} | ||
if (queryArgs === skipToken) { | ||
lastResult = void 0; | ||
} | ||
let data = currentState.isSuccess ? currentState.data : lastResult == null ? void 0 : lastResult.data; | ||
@@ -154,3 +164,5 @@ if (data === void 0) | ||
usePossiblyImmediateEffect(() => { | ||
promiseRef.current = void 0; | ||
if (subscriptionRemoved) { | ||
promiseRef.current = void 0; | ||
} | ||
}, [subscriptionRemoved]); | ||
@@ -428,3 +440,3 @@ usePossiblyImmediateEffect(() => { | ||
var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule()); | ||
export { ApiProvider, createApi, reactHooksModule }; | ||
export { ApiProvider, createApi, reactHooksModule, reactHooksModuleName }; | ||
//# sourceMappingURL=rtk-query-react.modern.js.map |
@@ -1,2 +0,2 @@ | ||
var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,o=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,u=(e,t)=>{for(var r in t||(t={}))i.call(t,r)&&o(e,r,t[r]);if(n)for(var r of n(t))s.call(t,r)&&o(e,r,t[r]);return e},c=(e,n)=>t(e,r(n));import{coreModule as a,buildCreateApi as d}from"@reduxjs/toolkit/query";import{createSelector as l}from"@reduxjs/toolkit";import{useCallback as p,useDebugValue as f,useEffect as y,useLayoutEffect as m,useMemo as b,useRef as h,useState as v}from"react";import{QueryStatus as g,skipToken as S}from"@reduxjs/toolkit/query";import{shallowEqual as O}from"react-redux";import{useEffect as q,useRef as x,useMemo as Q}from"react";function z(e,t,r,n){const i=Q((()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e})),[e,t,r,n]),s=x(i);return q((()=>{s.current.serialized!==i.serialized&&(s.current=i)}),[i]),s.current.serialized===i.serialized?s.current.queryArgs:e}var j=Symbol();import{useEffect as L,useRef as k}from"react";import{shallowEqual as A}from"react-redux";function E(e){const t=k(e);return L((()=>{A(t.current,e)||(t.current=e)}),[e]),A(t.current,e)?t.current:e}import{isPlainObject as w}from"@reduxjs/toolkit";var R,I,D=({endpointName:e,queryArgs:t})=>`${e}(${JSON.stringify(t,((e,t)=>w(t)?Object.keys(t).sort().reduce(((e,r)=>(e[r]=t[r],e)),{}):t))})`,C="undefined"!=typeof window&&window.document&&window.document.createElement?m:y,F=e=>e,N=e=>e.isUninitialized?c(u({},e),{isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:g.pending}):e;function P(e){return e.replace(e[0],e[0].toUpperCase())}function K(e,...t){Object.assign(e,...t)}(I=R||(R={})).query="query",I.mutation="mutation";import{useDispatch as M,useSelector as _,useStore as $,batch as H}from"react-redux";var U=Symbol(),J=({batch:e=H,useDispatch:t=M,useSelector:r=_,useStore:n=$,unstable__sideEffectsInRender:i=!1}={})=>({name:U,init(s,{serializeQueryArgs:o},a){const d=s,{buildQueryHooks:m,buildMutationHook:g,usePrefetch:q}=function({api:e,moduleOptions:{batch:t,useDispatch:r,useSelector:n,useStore:i,unstable__sideEffectsInRender:s},serializeQueryArgs:o,context:a}){const d=s?e=>e():y;return{buildQueryHooks:function(s){const g=(t,{refetchOnReconnect:n,refetchOnFocus:i,refetchOnMountOrArgChange:o,skip:u=!1,pollingInterval:c=0}={})=>{const{initiate:l}=e.endpoints[s],p=r(),f=z(u?S:t,D,a.endpointDefinitions[s],s),m=E({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:c}),v=h(!1),g=h();let{queryCacheKey:O,requestId:q}=g.current||{},x=!1;if(O&&q){const t=p(e.internalActions.internal_probeSubscription({queryCacheKey:O,requestId:q}));x=!!t}const Q=!x&&v.current;return d((()=>{v.current=x})),d((()=>{g.current=void 0}),[Q]),d((()=>{var e;const t=g.current;if(f===S)return null==t||t.unsubscribe(),void(g.current=void 0);const r=null==(e=g.current)?void 0:e.subscriptionOptions;if(t&&t.arg===f)m!==r&&t.updateSubscriptionOptions(m);else{null==t||t.unsubscribe();const e=p(l(f,{subscriptionOptions:m,forceRefetch:o}));g.current=e}}),[p,l,o,f,m,Q]),y((()=>()=>{var e;null==(e=g.current)||e.unsubscribe(),g.current=void 0}),[]),b((()=>({refetch:()=>{var e;if(!g.current)throw new Error("Cannot refetch a query that has not been started yet.");return null==(e=g.current)?void 0:e.refetch()}})),[])},q=({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:o=0}={})=>{const{initiate:u}=e.endpoints[s],c=r(),[a,l]=v(j),f=h(),m=E({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:o});d((()=>{var e,t;const r=null==(e=f.current)?void 0:e.subscriptionOptions;m!==r&&(null==(t=f.current)||t.updateSubscriptionOptions(m))}),[m]);const g=h(m);d((()=>{g.current=m}),[m]);const S=p((function(e,r=!1){let n;return t((()=>{var t;null==(t=f.current)||t.unsubscribe(),f.current=n=c(u(e,{subscriptionOptions:g.current,forceRefetch:!r})),l(e)})),n}),[c,u]);return y((()=>()=>{var e;null==(e=null==f?void 0:f.current)||e.unsubscribe()}),[]),y((()=>{a===j||f.current||S(a,!0)}),[a,S]),b((()=>[S,a]),[S,a])},x=(t,{skip:r=!1,selectFromResult:u}={})=>{const{select:c}=e.endpoints[s],d=z(r?S:t,o,a.endpointDefinitions[s],s),p=h(),f=b((()=>l([c(d),(e,t)=>t,e=>d],m)),[c,d]),y=b((()=>u?l([f],u):f),[f,u]),v=n((e=>y(e,p.current)),O),g=i(),q=f(g.getState(),p.current);return C((()=>{p.current=q}),[q]),v};return{useQueryState:x,useQuerySubscription:g,useLazyQuerySubscription:q,useLazyQuery(e){const[t,r]=q(e),n=x(r,c(u({},e),{skip:r===j})),i=b((()=>({lastArg:r})),[r]);return b((()=>[t,n,i]),[t,n,i])},useQuery(e,t){const r=g(e,t),n=x(e,u({selectFromResult:e===S||(null==t?void 0:t.skip)?void 0:N},t)),{data:i,status:s,isLoading:o,isSuccess:c,isError:a,error:d}=n;return f({data:i,status:s,isLoading:o,isSuccess:c,isError:a,error:d}),b((()=>u(u({},n),r)),[n,r])}}},buildMutationHook:function(i){return({selectFromResult:s=F,fixedCacheKey:o}={})=>{const{select:a,initiate:d}=e.endpoints[i],m=r(),[h,g]=v();y((()=>()=>{(null==h?void 0:h.arg.fixedCacheKey)||null==h||h.reset()}),[h]);const S=p((function(e){const t=m(d(e,{fixedCacheKey:o}));return g(t),t}),[m,d,o]),{requestId:q}=h||{},x=b((()=>l([a({fixedCacheKey:o,requestId:null==h?void 0:h.requestId})],s)),[a,h,s,o]),Q=n(x,O),z=null==o?null==h?void 0:h.arg.originalArgs:void 0,j=p((()=>{t((()=>{h&&g(void 0),o&&m(e.internalActions.removeMutationResult({requestId:q,fixedCacheKey:o}))}))}),[m,o,h,q]),{endpointName:L,data:k,status:A,isLoading:E,isSuccess:w,isError:R,error:I}=Q;f({endpointName:L,data:k,status:A,isLoading:E,isSuccess:w,isError:R,error:I});const D=b((()=>c(u({},Q),{originalArgs:z,reset:j})),[Q,z,j]);return b((()=>[S,D]),[S,D])}},usePrefetch:function(t,n){const i=r(),s=E(n);return p(((r,n)=>i(e.util.prefetch(t,r,u(u({},s),n)))),[t,i,s])}};function m(e,t,r){if((null==t?void 0:t.endpointName)&&e.isUninitialized){const{endpointName:e}=t,n=a.endpointDefinitions[e];o({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===o({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}r===S&&(t=void 0);let n=e.isSuccess?e.data:null==t?void 0:t.data;void 0===n&&(n=e.data);const i=void 0!==n,s=e.isLoading,d=!i&&s,l=e.isSuccess||s&&i;return c(u({},e),{data:n,currentData:e.data,isFetching:s,isLoading:d,isSuccess:l})}}({api:s,moduleOptions:{batch:e,useDispatch:t,useSelector:r,useStore:n,unstable__sideEffectsInRender:i},serializeQueryArgs:o,context:a});return K(d,{usePrefetch:q}),K(a,{batch:e}),{injectEndpoint(e,t){if(t.type===R.query){const{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:o}=m(e);K(d.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:o}),s[`use${P(e)}Query`]=t,s[`useLazy${P(e)}Query`]=r}else if(t.type===R.mutation){const t=g(e);K(d.endpoints[e],{useMutation:t}),s[`use${P(e)}Mutation`]=t}}}}});export*from"@reduxjs/toolkit/query";import{configureStore as B}from"@reduxjs/toolkit";import{useEffect as G}from"react";import T from"react";import{Provider as V}from"react-redux";import{setupListeners as W}from"@reduxjs/toolkit/query";function X(e){const[t]=T.useState((()=>B({reducer:{[e.api.reducerPath]:e.api.reducer},middleware:t=>t().concat(e.api.middleware)})));return G((()=>!1===e.setupListeners?void 0:W(t.dispatch,e.setupListeners)),[e.setupListeners,t.dispatch]),T.createElement(V,{store:t,context:e.context},e.children)}var Y=d(a(),J());export{X as ApiProvider,Y as createApi,J as reactHooksModule}; | ||
var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,o=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,u=(e,t)=>{for(var r in t||(t={}))i.call(t,r)&&o(e,r,t[r]);if(n)for(var r of n(t))s.call(t,r)&&o(e,r,t[r]);return e},c=(e,n)=>t(e,r(n));import{coreModule as a,buildCreateApi as d}from"@reduxjs/toolkit/query";import{createSelector as l}from"@reduxjs/toolkit";import{useCallback as p,useDebugValue as f,useEffect as y,useLayoutEffect as m,useMemo as b,useRef as h,useState as g}from"react";import{QueryStatus as v,skipToken as S}from"@reduxjs/toolkit/query";import{shallowEqual as O}from"react-redux";import{useEffect as q,useRef as x,useMemo as Q}from"react";function k(e,t,r,n){const i=Q((()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e})),[e,t,r,n]),s=x(i);return q((()=>{s.current.serialized!==i.serialized&&(s.current=i)}),[i]),s.current.serialized===i.serialized?s.current.queryArgs:e}var z=Symbol();import{useEffect as j,useRef as L}from"react";import{shallowEqual as w}from"react-redux";function A(e){const t=L(e);return j((()=>{w(t.current,e)||(t.current=e)}),[e]),w(t.current,e)?t.current:e}import{isPlainObject as E}from"@reduxjs/toolkit";var R,I,D=WeakMap?new WeakMap:void 0,C=({endpointName:e,queryArgs:t})=>{let r="";const n=null==D?void 0:D.get(t);if("string"==typeof n)r=n;else{const e=JSON.stringify(t,((e,t)=>E(t)?Object.keys(t).sort().reduce(((e,r)=>(e[r]=t[r],e)),{}):t));E(t)&&(null==D||D.set(t,e)),r=e}return`${e}(${r})`},F="undefined"!=typeof window&&window.document&&window.document.createElement?m:y,M=e=>e,N=e=>e.isUninitialized?c(u({},e),{isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:v.pending}):e;function P(e){return e.replace(e[0],e[0].toUpperCase())}function K(e,...t){Object.assign(e,...t)}(I=R||(R={})).query="query",I.mutation="mutation";import{useDispatch as _,useSelector as $,useStore as H,batch as U}from"react-redux";var W=Symbol(),J=({batch:e=U,useDispatch:t=_,useSelector:r=$,useStore:n=H,unstable__sideEffectsInRender:i=!1}={})=>({name:W,init(s,{serializeQueryArgs:o},a){const d=s,{buildQueryHooks:m,buildMutationHook:v,usePrefetch:q}=function({api:e,moduleOptions:{batch:t,useDispatch:r,useSelector:n,useStore:i,unstable__sideEffectsInRender:s},serializeQueryArgs:o,context:a}){const d=s?e=>e():y;return{buildQueryHooks:function(s){const v=(t,{refetchOnReconnect:n,refetchOnFocus:i,refetchOnMountOrArgChange:o,skip:u=!1,pollingInterval:c=0}={})=>{const{initiate:l}=e.endpoints[s],p=r(),f=k(u?S:t,C,a.endpointDefinitions[s],s),m=A({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:c}),g=h(!1),v=h();let{queryCacheKey:O,requestId:q}=v.current||{},x=!1;if(O&&q){const t=p(e.internalActions.internal_probeSubscription({queryCacheKey:O,requestId:q}));x=!!t}const Q=!x&&g.current;return d((()=>{g.current=x})),d((()=>{Q&&(v.current=void 0)}),[Q]),d((()=>{var e;const t=v.current;if(f===S)return null==t||t.unsubscribe(),void(v.current=void 0);const r=null==(e=v.current)?void 0:e.subscriptionOptions;if(t&&t.arg===f)m!==r&&t.updateSubscriptionOptions(m);else{null==t||t.unsubscribe();const e=p(l(f,{subscriptionOptions:m,forceRefetch:o}));v.current=e}}),[p,l,o,f,m,Q]),y((()=>()=>{var e;null==(e=v.current)||e.unsubscribe(),v.current=void 0}),[]),b((()=>({refetch:()=>{var e;if(!v.current)throw new Error("Cannot refetch a query that has not been started yet.");return null==(e=v.current)?void 0:e.refetch()}})),[])},q=({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:o=0}={})=>{const{initiate:u}=e.endpoints[s],c=r(),[a,l]=g(z),f=h(),m=A({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:o});d((()=>{var e,t;const r=null==(e=f.current)?void 0:e.subscriptionOptions;m!==r&&(null==(t=f.current)||t.updateSubscriptionOptions(m))}),[m]);const v=h(m);d((()=>{v.current=m}),[m]);const S=p((function(e,r=!1){let n;return t((()=>{var t;null==(t=f.current)||t.unsubscribe(),f.current=n=c(u(e,{subscriptionOptions:v.current,forceRefetch:!r})),l(e)})),n}),[c,u]);return y((()=>()=>{var e;null==(e=null==f?void 0:f.current)||e.unsubscribe()}),[]),y((()=>{a===z||f.current||S(a,!0)}),[a,S]),b((()=>[S,a]),[S,a])},x=(t,{skip:r=!1,selectFromResult:u}={})=>{const{select:c}=e.endpoints[s],d=k(r?S:t,o,a.endpointDefinitions[s],s),p=h(),f=b((()=>l([c(d),(e,t)=>t,e=>d],m)),[c,d]),y=b((()=>u?l([f],u):f),[f,u]),g=n((e=>y(e,p.current)),O),v=i(),q=f(v.getState(),p.current);return F((()=>{p.current=q}),[q]),g};return{useQueryState:x,useQuerySubscription:v,useLazyQuerySubscription:q,useLazyQuery(e){const[t,r]=q(e),n=x(r,c(u({},e),{skip:r===z})),i=b((()=>({lastArg:r})),[r]);return b((()=>[t,n,i]),[t,n,i])},useQuery(e,t){const r=v(e,t),n=x(e,u({selectFromResult:e===S||(null==t?void 0:t.skip)?void 0:N},t)),{data:i,status:s,isLoading:o,isSuccess:c,isError:a,error:d}=n;return f({data:i,status:s,isLoading:o,isSuccess:c,isError:a,error:d}),b((()=>u(u({},n),r)),[n,r])}}},buildMutationHook:function(i){return({selectFromResult:s=M,fixedCacheKey:o}={})=>{const{select:a,initiate:d}=e.endpoints[i],m=r(),[h,v]=g();y((()=>()=>{(null==h?void 0:h.arg.fixedCacheKey)||null==h||h.reset()}),[h]);const S=p((function(e){const t=m(d(e,{fixedCacheKey:o}));return v(t),t}),[m,d,o]),{requestId:q}=h||{},x=b((()=>l([a({fixedCacheKey:o,requestId:null==h?void 0:h.requestId})],s)),[a,h,s,o]),Q=n(x,O),k=null==o?null==h?void 0:h.arg.originalArgs:void 0,z=p((()=>{t((()=>{h&&v(void 0),o&&m(e.internalActions.removeMutationResult({requestId:q,fixedCacheKey:o}))}))}),[m,o,h,q]),{endpointName:j,data:L,status:w,isLoading:A,isSuccess:E,isError:R,error:I}=Q;f({endpointName:j,data:L,status:w,isLoading:A,isSuccess:E,isError:R,error:I});const D=b((()=>c(u({},Q),{originalArgs:k,reset:z})),[Q,k,z]);return b((()=>[S,D]),[S,D])}},usePrefetch:function(t,n){const i=r(),s=A(n);return p(((r,n)=>i(e.util.prefetch(t,r,u(u({},s),n)))),[t,i,s])}};function m(e,t,r){if((null==t?void 0:t.endpointName)&&e.isUninitialized){const{endpointName:e}=t,n=a.endpointDefinitions[e];o({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===o({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:null==t?void 0:t.data;void 0===n&&(n=e.data);const i=void 0!==n,s=e.isLoading,d=!i&&s,l=e.isSuccess||s&&i;return c(u({},e),{data:n,currentData:e.data,isFetching:s,isLoading:d,isSuccess:l})}}({api:s,moduleOptions:{batch:e,useDispatch:t,useSelector:r,useStore:n,unstable__sideEffectsInRender:i},serializeQueryArgs:o,context:a});return K(d,{usePrefetch:q}),K(a,{batch:e}),{injectEndpoint(e,t){if(t.type===R.query){const{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:o}=m(e);K(d.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:o}),s[`use${P(e)}Query`]=t,s[`useLazy${P(e)}Query`]=r}else if(t.type===R.mutation){const t=v(e);K(d.endpoints[e],{useMutation:t}),s[`use${P(e)}Mutation`]=t}}}}});export*from"@reduxjs/toolkit/query";import{configureStore as B}from"@reduxjs/toolkit";import{useEffect as G}from"react";import T from"react";import{Provider as V}from"react-redux";import{setupListeners as X}from"@reduxjs/toolkit/query";function Y(e){const[t]=T.useState((()=>B({reducer:{[e.api.reducerPath]:e.api.reducer},middleware:t=>t().concat(e.api.middleware)})));return G((()=>!1===e.setupListeners?void 0:X(t.dispatch,e.setupListeners)),[e.setupListeners,t.dispatch]),T.createElement(V,{store:t,context:e.context},e.children)}var Z=d(a(),J());export{Y as ApiProvider,Z as createApi,J as reactHooksModule,W as reactHooksModuleName}; | ||
//# sourceMappingURL=rtk-query-react.modern.production.min.js.map |
@@ -1,3 +0,3 @@ | ||
import type { SerializeQueryArgs } from '@reduxjs/toolkit/dist/query/defaultSerializeQueryArgs'; | ||
import type { EndpointDefinition } from '@reduxjs/toolkit/dist/query/endpointDefinitions'; | ||
import type { SerializeQueryArgs } from '@reduxjs/toolkit/query'; | ||
import type { EndpointDefinition } from '@reduxjs/toolkit/query'; | ||
export declare function useStableQueryArgs<T>(queryArgs: T, serialize: SerializeQueryArgs<any>, endpointDefinition: EndpointDefinition<any, any, any, any>, endpointName: string): T; |
@@ -1,2 +0,2 @@ | ||
var e,t,n=this&&this.__generator||function(e,t){var n,r,i,a,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},r=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},i=Object.create,a=Object.defineProperty,u=Object.defineProperties,o=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,d=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=function(e,t,n){return t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},v=function(e,t){for(var n in t||(t={}))f.call(t,n)&&h(e,n,t[n]);if(l)for(var r=0,i=l(t);r<i.length;r++)p.call(t,n=i[r])&&h(e,n,t[n]);return e},y=function(e,t){return u(e,c(t))},m=function(e){return a(e,"__esModule",{value:!0})},g=function(e,t){var n={};for(var r in e)f.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&l)for(var i=0,a=l(e);i<a.length;i++)t.indexOf(r=a[i])<0&&p.call(e,r)&&(n[r]=e[r]);return n},b=function(e){return function(e,t,n){if(t&&"object"==typeof t||"function"==typeof t)for(var r=function(r){f.call(e,r)||"default"===r||a(e,r,{get:function(){return t[r]},enumerable:!(n=o(t,r))||n.enumerable})},i=0,u=s(t);i<u.length;i++)r(u[i]);return e}(m(a(null!=e?i(d(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)},q=function(e,t,n){return new Promise((function(r,i){var a=function(e){try{o(n.next(e))}catch(e){i(e)}},u=function(e){try{o(n.throw(e))}catch(e){i(e)}},o=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(a,u)};o((n=n.apply(e,t)).next())}))};m(exports),function(e,t){for(var n in t)a(e,n,{get:t[n],enumerable:!0})}(exports,{QueryStatus:function(){return e},buildCreateApi:function(){return ye},copyWithStructuralSharing:function(){return A},coreModule:function(){return De},createApi:function(){return Ne},defaultSerializeQueryArgs:function(){return pe},fakeBaseQuery:function(){return me},fetchBaseQuery:function(){return x},retry:function(){return I},setupListeners:function(){return F},skipSelector:function(){return ce},skipToken:function(){return oe}}),(t=e||(e={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var S=function(e){return[].concat.apply([],e)},O=b(require("@reduxjs/toolkit")).isPlainObject;function A(e,t){if(e===t||!(O(e)&&O(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,a=Array.isArray(t)?[]:{},u=0,o=n;u<o.length;u++){var c=o[u];a[c]=A(e[c],t[c]),i&&(i=e[c]===a[c])}return i?e:a}var T=b(require("@reduxjs/toolkit")),R=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},j=function(e){return e.status>=200&&e.status<=299},w=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function k(e){if(!(0,T.isPlainObject)(e))return e;for(var t=v({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n];void 0===i[1]&&delete t[i[0]]}return t}function x(e){var t=this;void 0===e&&(e={});var r=e.baseUrl,i=e.prepareHeaders,a=void 0===i?function(e){return e}:i,u=e.fetchFn,o=void 0===u?R:u,c=e.paramsSerializer,s=e.isJsonContentType,l=void 0===s?w:s,d=e.jsonContentType,f=void 0===d?"application/json":d,p=e.jsonReplacer,h=e.timeout,m=e.validateStatus,b=g(e,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","validateStatus"]);return"undefined"==typeof fetch&&o===R&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(e,i){return q(t,null,(function(){var t,u,s,d,q,O,A,R,w,x,Q,P,C,I,M,D,N,E,K,_,F,z,U,L,W,H,B,J,V,G,Y,$,X,Z,ee,te;return n(this,(function(n){switch(n.label){case 0:return t=i.signal,u=i.getState,s=i.extra,d=i.endpoint,q=i.forced,O=i.type,w=(R="string"==typeof e?{url:e}:e).url,Q=void 0===(x=R.headers)?new Headers(b.headers):x,C=void 0===(P=R.params)?void 0:P,M=void 0===(I=R.responseHandler)?"json":I,N=void 0===(D=R.validateStatus)?null!=m?m:j:D,K=void 0===(E=R.timeout)?h:E,_=g(R,["url","headers","params","responseHandler","validateStatus","timeout"]),F=v(y(v({},b),{signal:t}),_),Q=new Headers(k(Q)),z=F,[4,a(Q,{getState:u,extra:s,endpoint:d,forced:q,type:O})];case 1:z.headers=n.sent()||Q,U=function(e){return"object"==typeof e&&((0,T.isPlainObject)(e)||Array.isArray(e)||"function"==typeof e.toJSON)},!F.headers.has("content-type")&&U(F.body)&&F.headers.set("content-type",f),U(F.body)&&l(F.headers)&&(F.body=JSON.stringify(F.body,p)),C&&(L=~w.indexOf("?")?"&":"?",W=c?c(C):new URLSearchParams(k(C)),w+=L+W),w=function(e,t){if(!e)return t;if(!t)return e;if(function(e){return new RegExp("(^|:)//").test(e)}(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=function(e){return e.replace(/\/$/,"")}(e),""+e+n+function(e){return e.replace(/^\//,"")}(t)}(r,w),H=new Request(w,F),B=H.clone(),A={request:B},V=!1,G=K&&setTimeout((function(){V=!0,i.abort()}),K),n.label=2;case 2:return n.trys.push([2,4,5,6]),[4,o(H)];case 3:return J=n.sent(),[3,6];case 4:return Y=n.sent(),[2,{error:{status:V?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Y)},meta:A}];case 5:return G&&clearTimeout(G),[7];case 6:$=J.clone(),A.response=$,Z="",n.label=7;case 7:return n.trys.push([7,9,,10]),[4,Promise.all([S(J,M).then((function(e){return X=e}),(function(e){return ee=e})),$.text().then((function(e){return Z=e}),(function(){}))])];case 8:if(n.sent(),ee)throw ee;return[3,10];case 9:return te=n.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:J.status,data:Z,error:String(te)},meta:A}];case 10:return[2,N(J,X)?{data:X,meta:A}:{error:{status:J.status,data:X},meta:A}]}}))}))};function S(e,t){return q(this,null,(function(){var r;return n(this,(function(n){switch(n.label){case 0:return"function"==typeof t?[2,t(e)]:("content-type"===t&&(t=l(e.headers)?"json":"text"),"json"!==t?[3,2]:[4,e.text()]);case 1:return[2,(r=n.sent()).length?JSON.parse(r):null];case 2:return[2,e.text()]}}))}))}}var Q=function(e,t){void 0===t&&(t=void 0),this.value=e,this.meta=t};function P(e,t){return void 0===e&&(e=0),void 0===t&&(t=5),q(this,null,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=Math.min(e,t),i=~~((Math.random()+.4)*(300<<r)),[4,new Promise((function(e){return setTimeout((function(t){return e(t)}),i)}))];case 1:return n.sent(),[2]}}))}))}var C={},I=Object.assign((function(e,t){return function(r,i,a){return q(void 0,null,(function(){var u,o,c,s,l,d,f;return n(this,(function(n){switch(n.label){case 0:u=[5,(t||C).maxRetries,(a||C).maxRetries].filter((function(e){return void 0!==e})),o=u.slice(-1)[0],c=function(e,t,n){return n.attempt<=o},s=v(v({maxRetries:o,backoff:P,retryCondition:c},t),a),l=0,n.label=1;case 1:n.label=2;case 2:return n.trys.push([2,4,,6]),[4,e(r,i,a)];case 3:if((d=n.sent()).error)throw new Q(d);return[2,d];case 4:if(f=n.sent(),l++,f.throwImmediately){if(f instanceof Q)return[2,f.value];throw f}return f instanceof Q&&!s.retryCondition(f.value.error,r,{attempt:l,baseQueryApi:i,extraOptions:a})?[2,f.value]:[4,s.backoff(l,s.maxRetries)];case 5:return n.sent(),[3,6];case 6:return[3,1];case 7:return[2]}}))}))}}),{fail:function(e){throw Object.assign(new Q({error:e}),{throwImmediately:!0})}}),M=b(require("@reduxjs/toolkit")),D=(0,M.createAction)("__rtkq/focused"),N=(0,M.createAction)("__rtkq/unfocused"),E=(0,M.createAction)("__rtkq/online"),K=(0,M.createAction)("__rtkq/offline"),_=!1;function F(e,t){return t?t(e,{onFocus:D,onFocusLost:N,onOffline:K,onOnline:E}):(n=function(){return e(D())},r=function(){return e(E())},i=function(){return e(K())},a=function(){"visible"===window.document.visibilityState?n():e(N())},_||"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",n,!1),window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),_=!0),function(){window.removeEventListener("focus",n),window.removeEventListener("visibilitychange",a),window.removeEventListener("online",r),window.removeEventListener("offline",i),_=!1});var n,r,i,a}var z,U,L=b(require("@reduxjs/toolkit"));function W(e){return e.type===z.query}function H(e,t,n,r,i,a){return"function"==typeof e?e(t,n,r,i).map(B).map(a):Array.isArray(e)?e.map(B).map(a):[]}function B(e){return"string"==typeof e?{type:e}:e}(U=z||(z={})).query="query",U.mutation="mutation";var J=b(require("@reduxjs/toolkit"));function V(e){return null!=e}var G=Symbol("forceQueryFn"),Y=function(e){return"function"==typeof e[G]},$=b(require("@reduxjs/toolkit")),X=b(require("immer")),Z=b(require("@reduxjs/toolkit"));function ee(e){return e}function te(e,t,n,r){return H(n[e.meta.arg.endpointName][t],(0,$.isFulfilled)(e)?e.payload:void 0,(0,$.isRejectedWithValue)(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}var ne=b(require("immer"));function re(e,t,n){var r=e[t];r&&n(r)}function ie(e){var t;return null!=(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)?t:e.requestId}function ae(e,t,n){var r=e[ie(t)];r&&n(r)}var ue={},oe=Symbol.for("RTKQ/skipToken"),ce=oe,se={status:e.uninitialized},le=(0,L.createNextState)(se,(function(){})),de=(0,L.createNextState)(se,(function(){})),fe=b(require("@reduxjs/toolkit")),pe=function(e){return e.endpointName+"("+JSON.stringify(e.queryArgs,(function(e,t){return(0,fe.isPlainObject)(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}))+")"},he=b(require("@reduxjs/toolkit")),ve=b(require("reselect"));function ye(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n=(0,ve.defaultMemoize)((function(e){var n,r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:null!=(n=t.reducerPath)?n:"api"})})),i=y(v({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{extractRehydrationInfo:n,serializeQueryArgs:function(e){var n=pe;if("serializeQueryArgs"in e.endpointDefinition){var r=e.endpointDefinition.serializeQueryArgs;n=function(e){var t=r(e);return"string"==typeof t?t:pe(y(v({},e),{queryArgs:t}))}}else t.serializeQueryArgs&&(n=t.serializeQueryArgs);return n(e)},tagTypes:r([],t.tagTypes||[])}),a={endpointDefinitions:{},batch:function(e){e()},apiUid:(0,he.nanoid)(),extractRehydrationInfo:n,hasRehydrationInfo:(0,ve.defaultMemoize)((function(e){return null!=n(e)}))},u={injectEndpoints:function(e){for(var t=e.endpoints({query:function(e){return y(v({},e),{type:z.query})},mutation:function(e){return y(v({},e),{type:z.mutation})}}),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],c=i[0],s=i[1];if(e.overrideExisting||!(c in a.endpointDefinitions)){a.endpointDefinitions[c]=s;for(var l=0,d=o;l<d.length;l++)d[l].injectEndpoint(c,s)}}return u},enhanceEndpoints:function(e){var t=e.addTagTypes,n=e.endpoints;if(t)for(var r=0,o=t;r<o.length;r++){var c=o[r];i.tagTypes.includes(c)||i.tagTypes.push(c)}if(n)for(var s=0,l=Object.entries(n);s<l.length;s++){var d=l[s],f=d[0],p=d[1];"function"==typeof p?p(a.endpointDefinitions[f]):Object.assign(a.endpointDefinitions[f]||{},p)}return u}},o=e.map((function(e){return e.init(u,i,a)}));return u.injectEndpoints({endpoints:t.endpoints})}}function me(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var ge,be=b(require("@reduxjs/toolkit")),qe=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,a=n.internalActions,u=a.removeQueryResult,o=a.unsubscribeQueryResult;function c(e){var t=i.currentSubscriptions[e];return!!t&&!function(e){for(var t in e)return!1;return!0}(t)}var s={};function l(e,t,n,i){var a,o=r.endpointDefinitions[t],l=null!=(a=null==o?void 0:o.keepUnusedDataFor)?a:i.keepUnusedDataFor;if(Infinity!==l){var d=Math.max(0,Math.min(l,2147482.647));if(!c(e)){var f=s[e];f&&clearTimeout(f),s[e]=setTimeout((function(){c(e)||n.dispatch(u({queryCacheKey:e})),delete s[e]}),1e3*d)}}}return function(e,i,a){var u;if(o.match(e)){var c=i.getState()[t];l(b=e.payload.queryCacheKey,null==(u=c.queries[b])?void 0:u.endpointName,i,c.config)}if(n.util.resetApiState.match(e))for(var d=0,f=Object.entries(s);d<f.length;d++){var p=f[d],h=p[0],v=p[1];v&&clearTimeout(v),delete s[h]}if(r.hasRehydrationInfo(e)){c=i.getState()[t];for(var y=r.extractRehydrationInfo(e).queries,m=0,g=Object.entries(y);m<g.length;m++){var b,q=g[m],S=q[1];l(b=q[0],null==S?void 0:S.endpointName,i,c.config)}}}},Se=b(require("@reduxjs/toolkit")),Oe=function(t){var n=t.reducerPath,r=t.context,i=t.context.endpointDefinitions,a=t.mutationThunk,u=t.api,o=t.assertTagType,c=t.refetchQuery,s=u.internalActions.removeQueryResult,l=(0,Se.isAnyOf)((0,Se.isFulfilled)(a),(0,Se.isRejectedWithValue)(a));function d(t,i){var a=i.getState(),o=a[n],l=u.util.selectInvalidatedBy(a,t);r.batch((function(){for(var t,n=0,r=Array.from(l.values());n<r.length;n++){var a=r[n].queryCacheKey,u=o.queries[a],d=null!=(t=o.subscriptions[a])?t:{};u&&(0===Object.keys(d).length?i.dispatch(s({queryCacheKey:a})):u.status!==e.uninitialized&&i.dispatch(c(u,a)))}}))}return function(e,t){l(e)&&d(te(e,"invalidatesTags",i,o),t),u.util.invalidateTags.match(e)&&d(H(e.payload,void 0,void 0,void 0,void 0,o),t)}},Ae=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.api,a=t.refetchQuery,u=t.internalState,o={};function c(t,r){var i=t.queryCacheKey,c=r.getState()[n].queries[i];if(c&&c.status!==e.uninitialized){var s=d(u.currentSubscriptions[i]);if(Number.isFinite(s)){var l=o[i];(null==l?void 0:l.timeout)&&(clearTimeout(l.timeout),l.timeout=void 0);var f=Date.now()+s,p=o[i]={nextPollTimestamp:f,pollingInterval:s,timeout:setTimeout((function(){p.timeout=void 0,r.dispatch(a(c,i))}),s)}}}}function s(t,r){var i=t.queryCacheKey,a=r.getState()[n].queries[i];if(a&&a.status!==e.uninitialized){var s=d(u.currentSubscriptions[i]);if(Number.isFinite(s)){var f=o[i],p=Date.now()+s;(!f||p<f.nextPollTimestamp)&&c({queryCacheKey:i},r)}else l(i)}}function l(e){var t=o[e];(null==t?void 0:t.timeout)&&clearTimeout(t.timeout),delete o[e]}function d(e){void 0===e&&(e={});var t=Number.POSITIVE_INFINITY;for(var n in e)e[n].pollingInterval&&(t=Math.min(e[n].pollingInterval,t));return t}return function(e,t){(i.internalActions.updateSubscriptionOptions.match(e)||i.internalActions.unsubscribeQueryResult.match(e))&&s(e.payload,t),(r.pending.match(e)||r.rejected.match(e)&&e.meta.condition)&&s(e.meta.arg,t),(r.fulfilled.match(e)||r.rejected.match(e)&&!e.meta.condition)&&c(e.meta.arg,t),i.util.resetApiState.match(e)&&function(){for(var e=0,t=Object.keys(o);e<t.length;e++)l(t[e])}()}},Te=b(require("@reduxjs/toolkit")),Re=new Error("Promise never resolved before cacheEntryRemoved."),je=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,a=e.mutationThunk,u=(0,Te.isAsyncThunkAction)(i),o=(0,Te.isAsyncThunkAction)(a),c=(0,Te.isFulfilled)(i,a),s={};function l(e,n,i,a,u){var o=r.endpointDefinitions[e],c=null==o?void 0:o.onCacheEntryAdded;if(c){var l={},d=new Promise((function(e){l.cacheEntryRemoved=e})),f=Promise.race([new Promise((function(e){l.valueResolved=e})),d.then((function(){throw Re}))]);f.catch((function(){})),s[i]=l;var p=t.endpoints[e].select(o.type===z.query?n:i),h=a.dispatch((function(e,t,n){return n})),m=y(v({},a),{getCacheEntry:function(){return p(a.getState())},requestId:u,extra:h,updateCachedData:o.type===z.query?function(r){return a.dispatch(t.util.updateQueryData(e,n,r))}:void 0,cacheDataLoaded:f,cacheEntryRemoved:d}),g=c(n,m);Promise.resolve(g).catch((function(e){if(e!==Re)throw e}))}}return function(e,r,d){var f=function(e){return u(e)?e.meta.arg.queryCacheKey:o(e)?e.meta.requestId:t.internalActions.removeQueryResult.match(e)?e.payload.queryCacheKey:t.internalActions.removeMutationResult.match(e)?ie(e.payload):""}(e);if(i.pending.match(e)){var p=d[n].queries[f],h=r.getState()[n].queries[f];!p&&h&&l(e.meta.arg.endpointName,e.meta.arg.originalArgs,f,r,e.meta.requestId)}else if(a.pending.match(e))(h=r.getState()[n].mutations[f])&&l(e.meta.arg.endpointName,e.meta.arg.originalArgs,f,r,e.meta.requestId);else if(c(e))(null==(g=s[f])?void 0:g.valueResolved)&&(g.valueResolved({data:e.payload,meta:e.meta.baseQueryMeta}),delete g.valueResolved);else if(t.internalActions.removeQueryResult.match(e)||t.internalActions.removeMutationResult.match(e))(g=s[f])&&(delete s[f],g.cacheEntryRemoved());else if(t.util.resetApiState.match(e))for(var v=0,y=Object.entries(s);v<y.length;v++){var m=y[v],g=m[1];delete s[m[0]],g.cacheEntryRemoved()}}},we=b(require("@reduxjs/toolkit")),ke=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,a=(0,we.isPending)(r,i),u=(0,we.isRejected)(r,i),o=(0,we.isFulfilled)(r,i),c={};return function(e,r){var i,s,l;if(a(e)){var d=e.meta,f=d.requestId,p=d.arg,h=p.endpointName,m=p.originalArgs,g=n.endpointDefinitions[h],b=null==g?void 0:g.onQueryStarted;if(b){var q={},S=new Promise((function(e,t){q.resolve=e,q.reject=t}));S.catch((function(){})),c[f]=q;var O=t.endpoints[h].select(g.type===z.query?m:f),A=r.dispatch((function(e,t,n){return n})),T=y(v({},r),{getCacheEntry:function(){return O(r.getState())},requestId:f,extra:A,updateCachedData:g.type===z.query?function(e){return r.dispatch(t.util.updateQueryData(h,m,e))}:void 0,queryFulfilled:S});b(m,T)}}else if(o(e)){var R=e.meta,j=R.baseQueryMeta;null==(i=c[f=R.requestId])||i.resolve({data:e.payload,meta:j}),delete c[f]}else if(u(e)){var w=e.meta;j=w.baseQueryMeta,null==(l=c[f=w.requestId])||l.reject({error:null!=(s=e.payload)?s:e.error,isUnhandledError:!w.rejectedWithValue,meta:j}),delete c[f]}}},xe=function(e){var t=e.api,n=e.context.apiUid;return function(e,r){t.util.resetApiState.match(e)&&r.dispatch(t.internalActions.middlewareRegistered(n))}},Qe=b(require("immer")),Pe="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):function(e){return(ge||(ge=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}),0)}))};function Ce(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,r([e],t))}var Ie=b(require("immer")),Me=Symbol(),De=function(){return{name:Me,init:function(t,i,a){var u=i.baseQuery,o=i.reducerPath,c=i.serializeQueryArgs,s=i.keepUnusedDataFor,l=i.refetchOnMountOrArgChange,d=i.refetchOnFocus,f=i.refetchOnReconnect;(0,Ie.enablePatches)();var p=function(e){return e};Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:E,onOffline:K,onFocus:D,onFocusLost:N},util:{}});var h=function(t){var r=this,i=t.reducerPath,a=t.baseQuery,u=t.context.endpointDefinitions,o=t.serializeQueryArgs,c=t.api,s=function(e,t){return q(r,[e,t],(function(e,t){var r,i,o,c,s,d,f,p,h,v,y,m,g,b=t.signal,q=t.abort,S=t.rejectWithValue,O=t.fulfillWithValue,A=t.dispatch,T=t.getState,R=t.extra;return n(this,(function(t){switch(t.label){case 0:r=u[e.endpointName],t.label=1;case 1:return t.trys.push([1,8,,13]),i=ee,o=void 0,c={signal:b,abort:q,dispatch:A,getState:T,extra:R,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?l(e,T()):void 0},(s="query"===e.type?e[G]:void 0)?(o=s(),[3,6]):[3,2];case 2:return r.query?[4,a(r.query(e.originalArgs),c,r.extraOptions)]:[3,4];case 3:return o=t.sent(),r.transformResponse&&(i=r.transformResponse),[3,6];case 4:return[4,r.queryFn(e.originalArgs,c,r.extraOptions,(function(e){return a(e,c,r.extraOptions)}))];case 5:o=t.sent(),t.label=6;case 6:if(o.error)throw new Q(o.error,o.meta);return d=O,[4,i(o.data,o.meta,e.originalArgs)];case 7:return[2,d.apply(void 0,[t.sent(),(m={fulfilledTimeStamp:Date.now(),baseQueryMeta:o.meta},m[Z.SHOULD_AUTOBATCH]=!0,m)])];case 8:if(f=t.sent(),!((p=f)instanceof Q))return[3,12];h=ee,r.query&&r.transformErrorResponse&&(h=r.transformErrorResponse),t.label=9;case 9:return t.trys.push([9,11,,12]),v=S,[4,h(p.value,p.meta,e.originalArgs)];case 10:return[2,v.apply(void 0,[t.sent(),(g={baseQueryMeta:p.meta},g[Z.SHOULD_AUTOBATCH]=!0,g)])];case 11:return y=t.sent(),p=y,[3,12];case 12:throw console.error(p),p;case 13:return[2]}}))}))};function l(e,t){var n,r,a,u,o=null==(r=null==(n=t[i])?void 0:n.queries)?void 0:r[e.queryCacheKey],c=null==(a=t[i])?void 0:a.config.refetchOnMountOrArgChange,s=null==o?void 0:o.fulfilledTimeStamp,l=null!=(u=e.forceRefetch)?u:e.subscribe&&c;return!!l&&(!0===l||(Number(new Date)-Number(s))/1e3>=l)}var d=(0,Z.createAsyncThunk)(i+"/executeQuery",s,{getPendingMeta:function(){var e;return(e={startedTimeStamp:Date.now()})[Z.SHOULD_AUTOBATCH]=!0,e},condition:function(e,t){var n,r,a,o=(0,t.getState)(),c=null==(r=null==(n=o[i])?void 0:n.queries)?void 0:r[e.queryCacheKey],s=null==c?void 0:c.fulfilledTimeStamp,d=e.originalArgs,f=null==c?void 0:c.originalArgs,p=u[e.endpointName];return!(!Y(e)&&("pending"===(null==c?void 0:c.status)||!l(e,o)&&(!W(p)||!(null==(a=null==p?void 0:p.forceRefetch)?void 0:a.call(p,{currentArg:d,previousArg:f,endpointState:c,state:o})))&&s))},dispatchConditionRejection:!0}),f=(0,Z.createAsyncThunk)(i+"/executeMutation",s,{getPendingMeta:function(){var e;return(e={startedTimeStamp:Date.now()})[Z.SHOULD_AUTOBATCH]=!0,e}});function p(e){return function(t){var n,r;return(null==(r=null==(n=null==t?void 0:t.meta)?void 0:n.arg)?void 0:r.endpointName)===e}}return{queryThunk:d,mutationThunk:f,prefetch:function(e,t,n){return function(r,i){var a=function(e){return"force"in e}(n)&&n.force,u=function(e){return"ifOlderThan"in e}(n)&&n.ifOlderThan,o=function(n){return void 0===n&&(n=!0),c.endpoints[e].initiate(t,{forceRefetch:n})},s=c.endpoints[e].select(t)(i());if(a)r(o());else if(u){var l=null==s?void 0:s.fulfilledTimeStamp;if(!l)return void r(o());(Number(new Date)-Number(new Date(l)))/1e3>=u&&r(o())}else r(o(!1))}},updateQueryData:function(t,n,r){return function(i,a){var u,o,s=c.endpoints[t].select(n)(a()),l={patches:[],inversePatches:[],undo:function(){return i(c.util.patchQueryData(t,n,l.inversePatches))}};if(s.status===e.uninitialized)return l;if("data"in s)if((0,X.isDraftable)(s.data)){var d=(0,X.produceWithPatches)(s.data,r),f=d[2];(u=l.patches).push.apply(u,d[1]),(o=l.inversePatches).push.apply(o,f)}else{var p=r(s.data);l.patches.push({op:"replace",path:[],value:p}),l.inversePatches.push({op:"replace",path:[],value:s.data})}return i(c.util.patchQueryData(t,n,l.patches)),l}},upsertQueryData:function(e,t,n){return function(r){var i;return r(c.endpoints[e].initiate(t,((i={subscribe:!1,forceRefetch:!0})[G]=function(){return{data:n}},i)))}},patchQueryData:function(e,t,n){return function(r){r(c.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:t,endpointDefinition:u[e],endpointName:e}),patches:n}))}},buildMatchThunkActions:function(e,t){return{matchPending:(0,$.isAllOf)((0,$.isPending)(e),p(t)),matchFulfilled:(0,$.isAllOf)((0,$.isFulfilled)(e),p(t)),matchRejected:(0,$.isAllOf)((0,$.isRejected)(e),p(t))}}}}({baseQuery:u,reducerPath:o,context:a,api:t,serializeQueryArgs:c}),m=h.queryThunk,g=h.mutationThunk,b=h.patchQueryData,O=h.updateQueryData,T=h.upsertQueryData,R=h.prefetch,j=h.buildMatchThunkActions,w=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.mutationThunk,a=t.context,u=a.endpointDefinitions,o=a.apiUid,c=a.extractRehydrationInfo,s=a.hasRehydrationInfo,l=t.assertTagType,d=t.config,f=(0,J.createAction)(n+"/resetApiState"),p=(0,J.createSlice)({name:n+"/queries",initialState:ue,reducers:{removeQueryResult:{reducer:function(e,t){delete e[t.payload.queryCacheKey]},prepare:(0,J.prepareAutoBatched)()},queryResultPatched:function(e,t){var n=t.payload,r=n.patches;re(e,n.queryCacheKey,(function(e){e.data=(0,ne.applyPatches)(e.data,r.concat())}))}},extraReducers:function(t){t.addCase(r.pending,(function(t,n){var r,i=n.meta,a=n.meta.arg,u=Y(a);(a.subscribe||u)&&(null!=t[r=a.queryCacheKey]||(t[r]={status:e.uninitialized,endpointName:a.endpointName})),re(t,a.queryCacheKey,(function(t){t.status=e.pending,t.requestId=u&&t.requestId?t.requestId:i.requestId,void 0!==a.originalArgs&&(t.originalArgs=a.originalArgs),t.startedTimeStamp=i.startedTimeStamp}))})).addCase(r.fulfilled,(function(t,n){var r=n.meta,i=n.payload;re(t,r.arg.queryCacheKey,(function(t){var n;if(t.requestId===r.requestId||Y(r.arg)){var a=u[r.arg.endpointName].merge;if(t.status=e.fulfilled,a)if(void 0!==t.data){var o=r.fulfilledTimeStamp,c=r.arg,s=r.baseQueryMeta,l=r.requestId,d=(0,J.createNextState)(t.data,(function(e){return a(e,i,{arg:c.originalArgs,baseQueryMeta:s,fulfilledTimeStamp:o,requestId:l})}));t.data=d}else t.data=i;else t.data=null==(n=u[r.arg.endpointName].structuralSharing)||n?A(t.data,i):i;delete t.error,t.fulfilledTimeStamp=r.fulfilledTimeStamp}}))})).addCase(r.rejected,(function(t,n){var r=n.meta,i=r.condition,a=r.requestId,u=n.error,o=n.payload;re(t,r.arg.queryCacheKey,(function(t){if(i);else{if(t.requestId!==a)return;t.status=e.rejected,t.error=null!=o?o:u}}))})).addMatcher(s,(function(t,n){for(var r=c(n).queries,i=0,a=Object.entries(r);i<a.length;i++){var u=a[i],o=u[1];(null==o?void 0:o.status)!==e.fulfilled&&(null==o?void 0:o.status)!==e.rejected||(t[u[0]]=o)}}))}}),h=(0,J.createSlice)({name:n+"/mutations",initialState:ue,reducers:{removeMutationResult:{reducer:function(e,t){var n=ie(t.payload);n in e&&delete e[n]},prepare:(0,J.prepareAutoBatched)()}},extraReducers:function(t){t.addCase(i.pending,(function(t,n){var r=n.meta,i=r.requestId,a=r.arg,u=r.startedTimeStamp;a.track&&(t[ie(n.meta)]={requestId:i,status:e.pending,endpointName:a.endpointName,startedTimeStamp:u})})).addCase(i.fulfilled,(function(t,n){var r=n.payload,i=n.meta;i.arg.track&&ae(t,i,(function(t){t.requestId===i.requestId&&(t.status=e.fulfilled,t.data=r,t.fulfilledTimeStamp=i.fulfilledTimeStamp)}))})).addCase(i.rejected,(function(t,n){var r=n.payload,i=n.error,a=n.meta;a.arg.track&&ae(t,a,(function(t){t.requestId===a.requestId&&(t.status=e.rejected,t.error=null!=r?r:i)}))})).addMatcher(s,(function(t,n){for(var r=c(n).mutations,i=0,a=Object.entries(r);i<a.length;i++){var u=a[i],o=u[0],s=u[1];(null==s?void 0:s.status)!==e.fulfilled&&(null==s?void 0:s.status)!==e.rejected||o===(null==s?void 0:s.requestId)||(t[o]=s)}}))}}),m=(0,J.createSlice)({name:n+"/invalidation",initialState:ue,reducers:{},extraReducers:function(e){e.addCase(p.actions.removeQueryResult,(function(e,t){for(var n=t.payload.queryCacheKey,r=0,i=Object.values(e);r<i.length;r++)for(var a=0,u=Object.values(i[r]);a<u.length;a++){var o=u[a],c=o.indexOf(n);-1!==c&&o.splice(c,1)}})).addMatcher(s,(function(e,t){for(var n,r,i,a,u=c(t).provided,o=0,s=Object.entries(u);o<s.length;o++)for(var l=s[o],d=l[0],f=0,p=Object.entries(l[1]);f<p.length;f++)for(var h=p[f],v=h[0],y=h[1],m=null!=(a=(r=null!=(n=e[d])?n:e[d]={})[i=v||"__internal_without_id"])?a:r[i]=[],g=0,b=y;g<b.length;g++){var q=b[g];m.includes(q)||m.push(q)}})).addMatcher((0,J.isAnyOf)((0,J.isFulfilled)(r),(0,J.isRejectedWithValue)(r)),(function(e,t){for(var n,r,i,a,o=te(t,"providesTags",u,l),c=t.meta.arg.queryCacheKey,s=0,d=Object.values(e);s<d.length;s++)for(var f=0,p=Object.values(d[s]);f<p.length;f++){var h=p[f],v=h.indexOf(c);-1!==v&&h.splice(v,1)}for(var y=0,m=o;y<m.length;y++){var g=m[y],b=g.type,q=g.id,S=null!=(a=(r=null!=(n=e[b])?n:e[b]={})[i=q||"__internal_without_id"])?a:r[i]=[];S.includes(c)||S.push(c)}}))}}),g=(0,J.createSlice)({name:n+"/subscriptions",initialState:ue,reducers:{updateSubscriptionOptions:function(e,t){},unsubscribeQueryResult:function(e,t){},internal_probeSubscription:function(e,t){}}}),b=(0,J.createSlice)({name:n+"/internalSubscriptions",initialState:ue,reducers:{subscriptionsUpdated:function(e,t){return(0,ne.applyPatches)(e,t.payload)}}}),q=(0,J.createSlice)({name:n+"/config",initialState:v({online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1},d),reducers:{middlewareRegistered:function(e,t){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&o===t.payload||"conflict"}},extraReducers:function(e){e.addCase(E,(function(e){e.online=!0})).addCase(K,(function(e){e.online=!1})).addCase(D,(function(e){e.focused=!0})).addCase(N,(function(e){e.focused=!1})).addMatcher(s,(function(e){return v({},e)}))}}),S=(0,J.combineReducers)({queries:p.reducer,mutations:h.reducer,provided:m.reducer,subscriptions:b.reducer,config:q.reducer});return{reducer:function(e,t){return S(f.match(t)?void 0:e,t)},actions:y(v(v(v(v(v({},q.actions),p.actions),g.actions),b.actions),h.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:f})}}({context:a,queryThunk:m,mutationThunk:g,reducerPath:o,assertTagType:p,config:{refetchOnFocus:d,refetchOnReconnect:f,refetchOnMountOrArgChange:l,keepUnusedDataFor:s,reducerPath:o}}),k=w.reducer,x=w.actions;Ce(t.util,{patchQueryData:b,updateQueryData:O,upsertQueryData:T,prefetch:R,resetApiState:x.resetApiState}),Ce(t.internalActions,x);var P=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.api,a=t.context,u=a.apiUid,o={invalidateTags:(0,be.createAction)(n+"/invalidateTags")},c=[xe,qe,Oe,Ae,je,ke];return{middleware:function(r){var o=!1,l=y(v({},t),{internalState:{currentSubscriptions:{}},refetchQuery:s}),d=c.map((function(e){return e(l)})),f=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",a=null,u=!1,o=t.internalActions,c=o.updateSubscriptionOptions,s=o.unsubscribeQueryResult;return function(e,o){var l,d;if(a||(a=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.internalActions.internal_probeSubscription.match(e)){var f=e.payload;return[!1,!!(null==(l=r.currentSubscriptions[f.queryCacheKey])?void 0:l[f.requestId])]}var p=function(e,r){var i,a,u,o,l,d,f,p,h;if(c.match(r)){var v=r.payload,y=v.queryCacheKey,m=v.requestId;return(null==(i=null==e?void 0:e[y])?void 0:i[m])&&(e[y][m]=v.options),!0}if(s.match(r)){var g=r.payload;return m=g.requestId,e[y=g.queryCacheKey]&&delete e[y][m],!0}if(t.internalActions.removeQueryResult.match(r))return delete e[r.payload.queryCacheKey],!0;if(n.pending.match(r)){var b=r.meta;if(m=b.requestId,(O=b.arg).subscribe)return(q=null!=(u=e[a=O.queryCacheKey])?u:e[a]={})[m]=null!=(l=null!=(o=O.subscriptionOptions)?o:q[m])?l:{},!0}if(n.rejected.match(r)){var q,S=r.meta,O=S.arg;if(m=S.requestId,S.condition&&O.subscribe)return(q=null!=(f=e[d=O.queryCacheKey])?f:e[d]={})[m]=null!=(h=null!=(p=O.subscriptionOptions)?p:q[m])?h:{},!0}return!1}(r.currentSubscriptions,e);if(p){u||(Pe((function(){var e=JSON.parse(JSON.stringify(r.currentSubscriptions)),n=(0,Qe.produceWithPatches)(a,(function(){return e}));o.next(t.internalActions.subscriptionsUpdated(n[1])),a=e,u=!1})),u=!0);var h=!!(null==(d=e.type)?void 0:d.startsWith(i)),v=n.rejected.match(e)&&e.meta.condition&&!!e.meta.arg.subscribe;return[!h&&!v,!1]}return[!0,!1]}}(l),p=function(t){var n=t.reducerPath,r=t.context,i=t.refetchQuery,a=t.internalState,u=t.api.internalActions.removeQueryResult;function o(t,o){var c=t.getState()[n],s=c.queries,l=a.currentSubscriptions;r.batch((function(){for(var n=0,r=Object.keys(l);n<r.length;n++){var a=r[n],d=s[a],f=l[a];f&&d&&(Object.values(f).some((function(e){return!0===e[o]}))||Object.values(f).every((function(e){return void 0===e[o]}))&&c.config[o])&&(0===Object.keys(f).length?t.dispatch(u({queryCacheKey:a})):d.status!==e.uninitialized&&t.dispatch(i(d,a)))}}))}return function(e,t){D.match(e)&&o(t,"refetchOnFocus"),E.match(e)&&o(t,"refetchOnReconnect")}}(l);return function(e){return function(t){o||(o=!0,r.dispatch(i.internalActions.middlewareRegistered(u)));var c,s=y(v({},r),{next:e}),l=r.getState(),h=f(t,s,l),m=h[1];if(c=h[0]?e(t):m,r.getState()[n]&&(p(t,s,l),function(e){return!!e&&"string"==typeof e.type&&e.type.startsWith(n+"/")}(t)||a.hasRehydrationInfo(t)))for(var g=0,b=d;g<b.length;g++)(0,b[g])(t,s,l);return c}}},actions:o};function s(e,t,n){return void 0===n&&(n={}),r(v({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},n))}}({reducerPath:o,context:a,queryThunk:m,mutationThunk:g,api:t,assertTagType:p}),C=P.middleware;Ce(t.util,P.actions),Ce(t,{reducer:k,middleware:C});var I=function(t){var n=t.serializeQueryArgs,r=t.reducerPath,i=function(e){return le},a=function(e){return de};return{buildQuerySelector:function(e,t){return function(r){var a=n({queryArgs:r,endpointDefinition:t,endpointName:e});return(0,L.createSelector)(r===oe?i:function(e){var t,n,r;return null!=(r=null==(n=null==(t=o(e))?void 0:t.queries)?void 0:n[a])?r:le},u)}},buildMutationSelector:function(){return function(e){var t,n;return n="object"==typeof e?null!=(t=ie(e))?t:oe:e,(0,L.createSelector)(n===oe?a:function(e){var t,r,i;return null!=(i=null==(r=null==(t=o(e))?void 0:t.mutations)?void 0:r[n])?i:de},u)}},selectInvalidatedBy:function(e,t){for(var n,i=e[r],a=new Set,u=0,o=t.map(B);u<o.length;u++){var c=o[u],s=i.provided[c.type];if(s)for(var l=0,d=null!=(n=void 0!==c.id?s[c.id]:S(Object.values(s)))?n:[];l<d.length;l++)a.add(d[l])}return S(Array.from(a.values()).map((function(e){var t=i.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))}};function u(t){return v(v({},t),{status:n=t.status,isUninitialized:n===e.uninitialized,isLoading:n===e.pending,isSuccess:n===e.fulfilled,isError:n===e.rejected});var n}function o(e){return e[r]}}({serializeQueryArgs:c,reducerPath:o}),M=I.buildQuerySelector,_=I.buildMutationSelector;Ce(t.util,{selectInvalidatedBy:I.selectInvalidatedBy});var F=function(e){var t=e.serializeQueryArgs,i=e.queryThunk,a=e.mutationThunk,u=e.api,o=e.context,c=new Map,s=new Map,l=u.internalActions,d=l.unsubscribeQueryResult,f=l.removeMutationResult,p=l.updateSubscriptionOptions;return{buildInitiateQuery:function(e,r){var a=function(o,s){var l=void 0===s?{}:s,f=l.subscribe,h=void 0===f||f,v=l.forceRefetch,y=l.subscriptionOptions,m=l[G];return function(s,l){var f,g,b=t({queryArgs:o,endpointDefinition:r,endpointName:e}),S=i(((f={type:"query",subscribe:h,forceRefetch:v,subscriptionOptions:y,endpointName:e,originalArgs:o,queryCacheKey:b})[G]=m,f)),O=u.endpoints[e].select(o),A=s(S),T=O(l()),R=A.requestId,j=A.abort,w=T.requestId!==R,k=null==(g=c.get(s))?void 0:g[b],x=function(){return O(l())},Q=Object.assign(m?A.then(x):w&&!k?Promise.resolve(T):Promise.all([k,A]).then(x),{arg:o,requestId:R,subscriptionOptions:y,queryCacheKey:b,abort:j,unwrap:function(){return q(this,null,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,Q];case 1:if((e=t.sent()).isError)throw e.error;return[2,e.data]}}))}))},refetch:function(){return s(a(o,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){h&&s(d({queryCacheKey:b,requestId:R}))},updateSubscriptionOptions:function(t){Q.subscriptionOptions=t,s(p({endpointName:e,requestId:R,queryCacheKey:b,options:t}))}});if(!k&&!w&&!m){var P=c.get(s)||{};P[b]=Q,c.set(s,P),Q.then((function(){delete P[b],Object.keys(P).length||c.delete(s)}))}return Q}};return a},buildInitiateMutation:function(e){return function(t,n){var r=void 0===n?{}:n,i=r.track,u=void 0===i||i,o=r.fixedCacheKey;return function(n,r){var i=a({type:"mutation",endpointName:e,originalArgs:t,track:u,fixedCacheKey:o}),c=n(i),l=c.requestId,d=c.abort,p=c.unwrap,h=c.unwrap().then((function(e){return{data:e}})).catch((function(e){return{error:e}})),v=function(){n(f({requestId:l,fixedCacheKey:o}))},y=Object.assign(h,{arg:c.arg,requestId:l,abort:d,unwrap:p,unsubscribe:v,reset:v}),m=s.get(n)||{};return s.set(n,m),m[l]=y,y.then((function(){delete m[l],Object.keys(m).length||s.delete(n)})),o&&(m[o]=y,y.then((function(){m[o]===y&&(delete m[o],Object.keys(m).length||s.delete(n))}))),y}}},getRunningQueryThunk:function(e,n){return function(r){var i,a=t({queryArgs:n,endpointDefinition:o.endpointDefinitions[e],endpointName:e});return null==(i=c.get(r))?void 0:i[a]}},getRunningMutationThunk:function(e,t){return function(e){var n;return null==(n=s.get(e))?void 0:n[t]}},getRunningQueriesThunk:function(){return function(e){return Object.values(c.get(e)||{}).filter(V)}},getRunningMutationsThunk:function(){return function(e){return Object.values(s.get(e)||{}).filter(V)}},getRunningOperationPromises:function(){var e=function(e){return Array.from(e.values()).flatMap((function(e){return e?Object.values(e):[]}))};return r(r([],e(c)),e(s)).filter(V)},removalWarning:function(){throw new Error("This method had to be removed due to a conceptual bug in RTK.\n Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.\n See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.")}}}({queryThunk:m,mutationThunk:g,api:t,serializeQueryArgs:c,context:a}),U=F.buildInitiateQuery,H=F.buildInitiateMutation;return Ce(t.util,{getRunningOperationPromises:F.getRunningOperationPromises,getRunningOperationPromise:F.removalWarning,getRunningMutationThunk:F.getRunningMutationThunk,getRunningMutationsThunk:F.getRunningMutationsThunk,getRunningQueryThunk:F.getRunningQueryThunk,getRunningQueriesThunk:F.getRunningQueriesThunk}),{name:Me,injectEndpoint:function(e,n){var r,i=t;null!=(r=i.endpoints)[e]||(r[e]={}),W(n)?Ce(i.endpoints[e],{name:e,select:M(e,n),initiate:U(e,n)},j(m,e)):n.type===z.mutation&&Ce(i.endpoints[e],{name:e,select:_(),initiate:H(e)},j(g,e))}}}}},Ne=ye(De()); | ||
var e,t,n=this&&this.__generator||function(e,t){var n,r,i,a,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},r=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},i=Object.create,a=Object.defineProperty,u=Object.defineProperties,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,d=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=function(e,t,n){return t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},v=function(e,t){for(var n in t||(t={}))f.call(t,n)&&h(e,n,t[n]);if(l)for(var r=0,i=l(t);r<i.length;r++)p.call(t,n=i[r])&&h(e,n,t[n]);return e},y=function(e,t){return u(e,s(t))},m=function(e){return a(e,"__esModule",{value:!0})},g=function(e,t){var n={};for(var r in e)f.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&l)for(var i=0,a=l(e);i<a.length;i++)t.indexOf(r=a[i])<0&&p.call(e,r)&&(n[r]=e[r]);return n},b=function(e){return function(e,t,n){if(t&&"object"==typeof t||"function"==typeof t)for(var r=function(r){f.call(e,r)||"default"===r||a(e,r,{get:function(){return t[r]},enumerable:!(n=o(t,r))||n.enumerable})},i=0,u=c(t);i<u.length;i++)r(u[i]);return e}(m(a(null!=e?i(d(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)},q=function(e,t,n){return new Promise((function(r,i){var a=function(e){try{o(n.next(e))}catch(e){i(e)}},u=function(e){try{o(n.throw(e))}catch(e){i(e)}},o=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(a,u)};o((n=n.apply(e,t)).next())}))};m(exports),function(e,t){for(var n in t)a(e,n,{get:t[n],enumerable:!0})}(exports,{QueryStatus:function(){return e},buildCreateApi:function(){return ge},copyWithStructuralSharing:function(){return A},coreModule:function(){return Ke},coreModuleName:function(){return Ne},createApi:function(){return Ee},defaultSerializeQueryArgs:function(){return ve},fakeBaseQuery:function(){return be},fetchBaseQuery:function(){return x},retry:function(){return I},setupListeners:function(){return F},skipSelector:function(){return ce},skipToken:function(){return se}}),(t=e||(e={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var S=function(e){return[].concat.apply([],e)},O=b(require("@reduxjs/toolkit")).isPlainObject;function A(e,t){if(e===t||!(O(e)&&O(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,a=Array.isArray(t)?[]:{},u=0,o=n;u<o.length;u++){var s=o[u];a[s]=A(e[s],t[s]),i&&(i=e[s]===a[s])}return i?e:a}var T=b(require("@reduxjs/toolkit")),R=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},j=function(e){return e.status>=200&&e.status<=299},w=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function k(e){if(!(0,T.isPlainObject)(e))return e;for(var t=v({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n];void 0===i[1]&&delete t[i[0]]}return t}function x(e){var t=this;void 0===e&&(e={});var r=e.baseUrl,i=e.prepareHeaders,a=void 0===i?function(e){return e}:i,u=e.fetchFn,o=void 0===u?R:u,s=e.paramsSerializer,c=e.isJsonContentType,l=void 0===c?w:c,d=e.jsonContentType,f=void 0===d?"application/json":d,p=e.jsonReplacer,h=e.timeout,m=e.responseHandler,b=e.validateStatus,S=g(e,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return"undefined"==typeof fetch&&o===R&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(e,i){return q(t,null,(function(){var t,u,c,d,q,A,R,w,x,P,Q,C,I,M,D,N,K,E,_,F,z,U,B,L,W,H,J,V,G,Y,$,X,Z,ee,te,ne;return n(this,(function(n){switch(n.label){case 0:return t=i.signal,u=i.getState,c=i.extra,d=i.endpoint,q=i.forced,A=i.type,x=(w="string"==typeof e?{url:e}:e).url,Q=void 0===(P=w.headers)?new Headers(S.headers):P,I=void 0===(C=w.params)?void 0:C,D=void 0===(M=w.responseHandler)?null!=m?m:"json":M,K=void 0===(N=w.validateStatus)?null!=b?b:j:N,_=void 0===(E=w.timeout)?h:E,F=g(w,["url","headers","params","responseHandler","validateStatus","timeout"]),z=v(y(v({},S),{signal:t}),F),Q=new Headers(k(Q)),U=z,[4,a(Q,{getState:u,extra:c,endpoint:d,forced:q,type:A})];case 1:U.headers=n.sent()||Q,B=function(e){return"object"==typeof e&&((0,T.isPlainObject)(e)||Array.isArray(e)||"function"==typeof e.toJSON)},!z.headers.has("content-type")&&B(z.body)&&z.headers.set("content-type",f),B(z.body)&&l(z.headers)&&(z.body=JSON.stringify(z.body,p)),I&&(L=~x.indexOf("?")?"&":"?",W=s?s(I):new URLSearchParams(k(I)),x+=L+W),x=function(e,t){if(!e)return t;if(!t)return e;if(function(e){return new RegExp("(^|:)//").test(e)}(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=function(e){return e.replace(/\/$/,"")}(e),""+e+n+function(e){return e.replace(/^\//,"")}(t)}(r,x),H=new Request(x,z),J=new Request(x,z),R={request:J},G=!1,Y=_&&setTimeout((function(){G=!0,i.abort()}),_),n.label=2;case 2:return n.trys.push([2,4,5,6]),[4,o(H)];case 3:return V=n.sent(),[3,6];case 4:return $=n.sent(),[2,{error:{status:G?"TIMEOUT_ERROR":"FETCH_ERROR",error:String($)},meta:R}];case 5:return Y&&clearTimeout(Y),[7];case 6:X=V.clone(),R.response=X,ee="",n.label=7;case 7:return n.trys.push([7,9,,10]),[4,Promise.all([O(V,D).then((function(e){return Z=e}),(function(e){return te=e})),X.text().then((function(e){return ee=e}),(function(){}))])];case 8:if(n.sent(),te)throw te;return[3,10];case 9:return ne=n.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:V.status,data:ee,error:String(ne)},meta:R}];case 10:return[2,K(V,Z)?{data:Z,meta:R}:{error:{status:V.status,data:Z},meta:R}]}}))}))};function O(e,t){return q(this,null,(function(){var r;return n(this,(function(n){switch(n.label){case 0:return"function"==typeof t?[2,t(e)]:("content-type"===t&&(t=l(e.headers)?"json":"text"),"json"!==t?[3,2]:[4,e.text()]);case 1:return[2,(r=n.sent()).length?JSON.parse(r):null];case 2:return[2,e.text()]}}))}))}}var P=function(e,t){void 0===t&&(t=void 0),this.value=e,this.meta=t};function Q(e,t){return void 0===e&&(e=0),void 0===t&&(t=5),q(this,null,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=Math.min(e,t),i=~~((Math.random()+.4)*(300<<r)),[4,new Promise((function(e){return setTimeout((function(t){return e(t)}),i)}))];case 1:return n.sent(),[2]}}))}))}var C={},I=Object.assign((function(e,t){return function(r,i,a){return q(void 0,null,(function(){var u,o,s,c,l,d,f;return n(this,(function(n){switch(n.label){case 0:u=[5,(t||C).maxRetries,(a||C).maxRetries].filter((function(e){return void 0!==e})),o=u.slice(-1)[0],s=function(e,t,n){return n.attempt<=o},c=v(v({maxRetries:o,backoff:Q,retryCondition:s},t),a),l=0,n.label=1;case 1:n.label=2;case 2:return n.trys.push([2,4,,6]),[4,e(r,i,a)];case 3:if((d=n.sent()).error)throw new P(d);return[2,d];case 4:if(f=n.sent(),l++,f.throwImmediately){if(f instanceof P)return[2,f.value];throw f}return f instanceof P&&!c.retryCondition(f.value.error,r,{attempt:l,baseQueryApi:i,extraOptions:a})?[2,f.value]:[4,c.backoff(l,c.maxRetries)];case 5:return n.sent(),[3,6];case 6:return[3,1];case 7:return[2]}}))}))}}),{fail:function(e){throw Object.assign(new P({error:e}),{throwImmediately:!0})}}),M=b(require("@reduxjs/toolkit")),D=(0,M.createAction)("__rtkq/focused"),N=(0,M.createAction)("__rtkq/unfocused"),K=(0,M.createAction)("__rtkq/online"),E=(0,M.createAction)("__rtkq/offline"),_=!1;function F(e,t){return t?t(e,{onFocus:D,onFocusLost:N,onOffline:E,onOnline:K}):(n=function(){return e(D())},r=function(){return e(K())},i=function(){return e(E())},a=function(){"visible"===window.document.visibilityState?n():e(N())},_||"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",n,!1),window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),_=!0),function(){window.removeEventListener("focus",n),window.removeEventListener("visibilitychange",a),window.removeEventListener("online",r),window.removeEventListener("offline",i),_=!1});var n,r,i,a}var z,U,B=b(require("@reduxjs/toolkit"));function L(e){return e.type===z.query}function W(e,t,n,r,i,a){return"function"==typeof e?e(t,n,r,i).map(H).map(a):Array.isArray(e)?e.map(H).map(a):[]}function H(e){return"string"==typeof e?{type:e}:e}(U=z||(z={})).query="query",U.mutation="mutation";var J=b(require("@reduxjs/toolkit"));function V(e){return null!=e}var G=Symbol("forceQueryFn"),Y=function(e){return"function"==typeof e[G]},$=b(require("@reduxjs/toolkit")),X=b(require("immer")),Z=b(require("@reduxjs/toolkit"));function ee(e){return e}function te(e,t,n,r){return W(n[e.meta.arg.endpointName][t],(0,$.isFulfilled)(e)?e.payload:void 0,(0,$.isRejectedWithValue)(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}var ne=b(require("immer")),re=b(require("immer"));function ie(e,t,n){var r=e[t];r&&n(r)}function ae(e){var t;return null!=(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)?t:e.requestId}function ue(e,t,n){var r=e[ae(t)];r&&n(r)}var oe={},se=Symbol.for("RTKQ/skipToken"),ce=se,le={status:e.uninitialized},de=(0,B.createNextState)(le,(function(){})),fe=(0,B.createNextState)(le,(function(){})),pe=b(require("@reduxjs/toolkit")),he=WeakMap?new WeakMap:void 0,ve=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=null==he?void 0:he.get(n);if("string"==typeof i)r=i;else{var a=JSON.stringify(n,(function(e,t){return(0,pe.isPlainObject)(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}));(0,pe.isPlainObject)(n)&&(null==he||he.set(n,a)),r=a}return t+"("+r+")"},ye=b(require("@reduxjs/toolkit")),me=b(require("reselect"));function ge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n=(0,me.defaultMemoize)((function(e){var n,r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:null!=(n=t.reducerPath)?n:"api"})})),i=y(v({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{extractRehydrationInfo:n,serializeQueryArgs:function(e){var n=ve;if("serializeQueryArgs"in e.endpointDefinition){var r=e.endpointDefinition.serializeQueryArgs;n=function(e){var t=r(e);return"string"==typeof t?t:ve(y(v({},e),{queryArgs:t}))}}else t.serializeQueryArgs&&(n=t.serializeQueryArgs);return n(e)},tagTypes:r([],t.tagTypes||[])}),a={endpointDefinitions:{},batch:function(e){e()},apiUid:(0,ye.nanoid)(),extractRehydrationInfo:n,hasRehydrationInfo:(0,me.defaultMemoize)((function(e){return null!=n(e)}))},u={injectEndpoints:function(e){for(var t=e.endpoints({query:function(e){return y(v({},e),{type:z.query})},mutation:function(e){return y(v({},e),{type:z.mutation})}}),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],s=i[0],c=i[1];if(e.overrideExisting||!(s in a.endpointDefinitions)){a.endpointDefinitions[s]=c;for(var l=0,d=o;l<d.length;l++)d[l].injectEndpoint(s,c)}}return u},enhanceEndpoints:function(e){var t=e.addTagTypes,n=e.endpoints;if(t)for(var r=0,o=t;r<o.length;r++){var s=o[r];i.tagTypes.includes(s)||i.tagTypes.push(s)}if(n)for(var c=0,l=Object.entries(n);c<l.length;c++){var d=l[c],f=d[0],p=d[1];"function"==typeof p?p(a.endpointDefinitions[f]):Object.assign(a.endpointDefinitions[f]||{},p)}return u}},o=e.map((function(e){return e.init(u,i,a)}));return u.injectEndpoints({endpoints:t.endpoints})}}function be(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var qe,Se=b(require("@reduxjs/toolkit")),Oe=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,a=n.internalActions,u=a.removeQueryResult,o=a.unsubscribeQueryResult;function s(e){var t=i.currentSubscriptions[e];return!!t&&!function(e){for(var t in e)return!1;return!0}(t)}var c={};function l(e,t,n,i){var a,o=r.endpointDefinitions[t],l=null!=(a=null==o?void 0:o.keepUnusedDataFor)?a:i.keepUnusedDataFor;if(Infinity!==l){var d=Math.max(0,Math.min(l,2147482.647));if(!s(e)){var f=c[e];f&&clearTimeout(f),c[e]=setTimeout((function(){s(e)||n.dispatch(u({queryCacheKey:e})),delete c[e]}),1e3*d)}}}return function(e,i,a){var u;if(o.match(e)){var s=i.getState()[t];l(b=e.payload.queryCacheKey,null==(u=s.queries[b])?void 0:u.endpointName,i,s.config)}if(n.util.resetApiState.match(e))for(var d=0,f=Object.entries(c);d<f.length;d++){var p=f[d],h=p[0],v=p[1];v&&clearTimeout(v),delete c[h]}if(r.hasRehydrationInfo(e)){s=i.getState()[t];for(var y=r.extractRehydrationInfo(e).queries,m=0,g=Object.entries(y);m<g.length;m++){var b,q=g[m],S=q[1];l(b=q[0],null==S?void 0:S.endpointName,i,s.config)}}}},Ae=b(require("@reduxjs/toolkit")),Te=function(t){var n=t.reducerPath,r=t.context,i=t.context.endpointDefinitions,a=t.mutationThunk,u=t.api,o=t.assertTagType,s=t.refetchQuery,c=u.internalActions.removeQueryResult,l=(0,Ae.isAnyOf)((0,Ae.isFulfilled)(a),(0,Ae.isRejectedWithValue)(a));function d(t,i){var a=i.getState(),o=a[n],l=u.util.selectInvalidatedBy(a,t);r.batch((function(){for(var t,n=0,r=Array.from(l.values());n<r.length;n++){var a=r[n].queryCacheKey,u=o.queries[a],d=null!=(t=o.subscriptions[a])?t:{};u&&(0===Object.keys(d).length?i.dispatch(c({queryCacheKey:a})):u.status!==e.uninitialized&&i.dispatch(s(u,a)))}}))}return function(e,t){l(e)&&d(te(e,"invalidatesTags",i,o),t),u.util.invalidateTags.match(e)&&d(W(e.payload,void 0,void 0,void 0,void 0,o),t)}},Re=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.api,a=t.refetchQuery,u=t.internalState,o={};function s(t,r){var i=t.queryCacheKey,s=r.getState()[n].queries[i];if(s&&s.status!==e.uninitialized){var c=d(u.currentSubscriptions[i]);if(Number.isFinite(c)){var l=o[i];(null==l?void 0:l.timeout)&&(clearTimeout(l.timeout),l.timeout=void 0);var f=Date.now()+c,p=o[i]={nextPollTimestamp:f,pollingInterval:c,timeout:setTimeout((function(){p.timeout=void 0,r.dispatch(a(s,i))}),c)}}}}function c(t,r){var i=t.queryCacheKey,a=r.getState()[n].queries[i];if(a&&a.status!==e.uninitialized){var c=d(u.currentSubscriptions[i]);if(Number.isFinite(c)){var f=o[i],p=Date.now()+c;(!f||p<f.nextPollTimestamp)&&s({queryCacheKey:i},r)}else l(i)}}function l(e){var t=o[e];(null==t?void 0:t.timeout)&&clearTimeout(t.timeout),delete o[e]}function d(e){void 0===e&&(e={});var t=Number.POSITIVE_INFINITY;for(var n in e)e[n].pollingInterval&&(t=Math.min(e[n].pollingInterval,t));return t}return function(e,t){(i.internalActions.updateSubscriptionOptions.match(e)||i.internalActions.unsubscribeQueryResult.match(e))&&c(e.payload,t),(r.pending.match(e)||r.rejected.match(e)&&e.meta.condition)&&c(e.meta.arg,t),(r.fulfilled.match(e)||r.rejected.match(e)&&!e.meta.condition)&&s(e.meta.arg,t),i.util.resetApiState.match(e)&&function(){for(var e=0,t=Object.keys(o);e<t.length;e++)l(t[e])}()}},je=b(require("@reduxjs/toolkit")),we=new Error("Promise never resolved before cacheEntryRemoved."),ke=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,a=e.mutationThunk,u=(0,je.isAsyncThunkAction)(i),o=(0,je.isAsyncThunkAction)(a),s=(0,je.isFulfilled)(i,a),c={};function l(e,n,i,a,u){var o=r.endpointDefinitions[e],s=null==o?void 0:o.onCacheEntryAdded;if(s){var l={},d=new Promise((function(e){l.cacheEntryRemoved=e})),f=Promise.race([new Promise((function(e){l.valueResolved=e})),d.then((function(){throw we}))]);f.catch((function(){})),c[i]=l;var p=t.endpoints[e].select(o.type===z.query?n:i),h=a.dispatch((function(e,t,n){return n})),m=y(v({},a),{getCacheEntry:function(){return p(a.getState())},requestId:u,extra:h,updateCachedData:o.type===z.query?function(r){return a.dispatch(t.util.updateQueryData(e,n,r))}:void 0,cacheDataLoaded:f,cacheEntryRemoved:d}),g=s(n,m);Promise.resolve(g).catch((function(e){if(e!==we)throw e}))}}return function(e,r,d){var f=function(e){return u(e)?e.meta.arg.queryCacheKey:o(e)?e.meta.requestId:t.internalActions.removeQueryResult.match(e)?e.payload.queryCacheKey:t.internalActions.removeMutationResult.match(e)?ae(e.payload):""}(e);if(i.pending.match(e)){var p=d[n].queries[f],h=r.getState()[n].queries[f];!p&&h&&l(e.meta.arg.endpointName,e.meta.arg.originalArgs,f,r,e.meta.requestId)}else if(a.pending.match(e))(h=r.getState()[n].mutations[f])&&l(e.meta.arg.endpointName,e.meta.arg.originalArgs,f,r,e.meta.requestId);else if(s(e))(null==(g=c[f])?void 0:g.valueResolved)&&(g.valueResolved({data:e.payload,meta:e.meta.baseQueryMeta}),delete g.valueResolved);else if(t.internalActions.removeQueryResult.match(e)||t.internalActions.removeMutationResult.match(e))(g=c[f])&&(delete c[f],g.cacheEntryRemoved());else if(t.util.resetApiState.match(e))for(var v=0,y=Object.entries(c);v<y.length;v++){var m=y[v],g=m[1];delete c[m[0]],g.cacheEntryRemoved()}}},xe=b(require("@reduxjs/toolkit")),Pe=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,a=(0,xe.isPending)(r,i),u=(0,xe.isRejected)(r,i),o=(0,xe.isFulfilled)(r,i),s={};return function(e,r){var i,c,l;if(a(e)){var d=e.meta,f=d.requestId,p=d.arg,h=p.endpointName,m=p.originalArgs,g=n.endpointDefinitions[h],b=null==g?void 0:g.onQueryStarted;if(b){var q={},S=new Promise((function(e,t){q.resolve=e,q.reject=t}));S.catch((function(){})),s[f]=q;var O=t.endpoints[h].select(g.type===z.query?m:f),A=r.dispatch((function(e,t,n){return n})),T=y(v({},r),{getCacheEntry:function(){return O(r.getState())},requestId:f,extra:A,updateCachedData:g.type===z.query?function(e){return r.dispatch(t.util.updateQueryData(h,m,e))}:void 0,queryFulfilled:S});b(m,T)}}else if(o(e)){var R=e.meta,j=R.baseQueryMeta;null==(i=s[f=R.requestId])||i.resolve({data:e.payload,meta:j}),delete s[f]}else if(u(e)){var w=e.meta;j=w.baseQueryMeta,null==(l=s[f=w.requestId])||l.reject({error:null!=(c=e.payload)?c:e.error,isUnhandledError:!w.rejectedWithValue,meta:j}),delete s[f]}}},Qe=function(e){var t=e.api,n=e.context.apiUid;return function(e,r){t.util.resetApiState.match(e)&&r.dispatch(t.internalActions.middlewareRegistered(n))}},Ce=b(require("immer")),Ie="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):function(e){return(qe||(qe=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}),0)}))};function Me(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,r([e],t))}var De=b(require("immer")),Ne=Symbol(),Ke=function(){return{name:Ne,init:function(t,i,a){var u=i.baseQuery,o=i.reducerPath,s=i.serializeQueryArgs,c=i.keepUnusedDataFor,l=i.refetchOnMountOrArgChange,d=i.refetchOnFocus,f=i.refetchOnReconnect;(0,De.enablePatches)();var p=function(e){return e};Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:K,onOffline:E,onFocus:D,onFocusLost:N},util:{}});var h=function(t){var r=this,i=t.reducerPath,a=t.baseQuery,u=t.context.endpointDefinitions,o=t.serializeQueryArgs,s=t.api,c=t.assertTagType,l=function(e,t){return q(r,[e,t],(function(e,t){var r,i,o,s,c,l,f,p,h,v,y,m,g,b=t.signal,q=t.abort,S=t.rejectWithValue,O=t.fulfillWithValue,A=t.dispatch,T=t.getState,R=t.extra;return n(this,(function(t){switch(t.label){case 0:r=u[e.endpointName],t.label=1;case 1:return t.trys.push([1,8,,13]),i=ee,o=void 0,s={signal:b,abort:q,dispatch:A,getState:T,extra:R,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?d(e,T()):void 0},(c="query"===e.type?e[G]:void 0)?(o=c(),[3,6]):[3,2];case 2:return r.query?[4,a(r.query(e.originalArgs),s,r.extraOptions)]:[3,4];case 3:return o=t.sent(),r.transformResponse&&(i=r.transformResponse),[3,6];case 4:return[4,r.queryFn(e.originalArgs,s,r.extraOptions,(function(e){return a(e,s,r.extraOptions)}))];case 5:o=t.sent(),t.label=6;case 6:if(o.error)throw new P(o.error,o.meta);return l=O,[4,i(o.data,o.meta,e.originalArgs)];case 7:return[2,l.apply(void 0,[t.sent(),(m={fulfilledTimeStamp:Date.now(),baseQueryMeta:o.meta},m[Z.SHOULD_AUTOBATCH]=!0,m)])];case 8:if(f=t.sent(),!((p=f)instanceof P))return[3,12];h=ee,r.query&&r.transformErrorResponse&&(h=r.transformErrorResponse),t.label=9;case 9:return t.trys.push([9,11,,12]),v=S,[4,h(p.value,p.meta,e.originalArgs)];case 10:return[2,v.apply(void 0,[t.sent(),(g={baseQueryMeta:p.meta},g[Z.SHOULD_AUTOBATCH]=!0,g)])];case 11:return y=t.sent(),p=y,[3,12];case 12:throw console.error(p),p;case 13:return[2]}}))}))};function d(e,t){var n,r,a,u,o=null==(r=null==(n=t[i])?void 0:n.queries)?void 0:r[e.queryCacheKey],s=null==(a=t[i])?void 0:a.config.refetchOnMountOrArgChange,c=null==o?void 0:o.fulfilledTimeStamp,l=null!=(u=e.forceRefetch)?u:e.subscribe&&s;return!!l&&(!0===l||(Number(new Date)-Number(c))/1e3>=l)}var f=(0,Z.createAsyncThunk)(i+"/executeQuery",l,{getPendingMeta:function(){var e;return(e={startedTimeStamp:Date.now()})[Z.SHOULD_AUTOBATCH]=!0,e},condition:function(e,t){var n,r,a,o=(0,t.getState)(),s=null==(r=null==(n=o[i])?void 0:n.queries)?void 0:r[e.queryCacheKey],c=null==s?void 0:s.fulfilledTimeStamp,l=e.originalArgs,f=null==s?void 0:s.originalArgs,p=u[e.endpointName];return!(!Y(e)&&("pending"===(null==s?void 0:s.status)||!d(e,o)&&(!L(p)||!(null==(a=null==p?void 0:p.forceRefetch)?void 0:a.call(p,{currentArg:l,previousArg:f,endpointState:s,state:o})))&&c))},dispatchConditionRejection:!0}),p=(0,Z.createAsyncThunk)(i+"/executeMutation",l,{getPendingMeta:function(){var e;return(e={startedTimeStamp:Date.now()})[Z.SHOULD_AUTOBATCH]=!0,e}});function h(e){return function(t){var n,r;return(null==(r=null==(n=null==t?void 0:t.meta)?void 0:n.arg)?void 0:r.endpointName)===e}}return{queryThunk:f,mutationThunk:p,prefetch:function(e,t,n){return function(r,i){var a=function(e){return"force"in e}(n)&&n.force,u=function(e){return"ifOlderThan"in e}(n)&&n.ifOlderThan,o=function(n){return void 0===n&&(n=!0),s.endpoints[e].initiate(t,{forceRefetch:n})},c=s.endpoints[e].select(t)(i());if(a)r(o());else if(u){var l=null==c?void 0:c.fulfilledTimeStamp;if(!l)return void r(o());(Number(new Date)-Number(new Date(l)))/1e3>=u&&r(o())}else r(o(!1))}},updateQueryData:function(t,n,r,i){return void 0===i&&(i=!0),function(a,u){var o,c,l,d=s.endpoints[t].select(n)(u()),f={patches:[],inversePatches:[],undo:function(){return a(s.util.patchQueryData(t,n,f.inversePatches,i))}};if(d.status===e.uninitialized)return f;if("data"in d)if((0,X.isDraftable)(d.data)){var p=(0,X.produceWithPatches)(d.data,r),h=p[0],v=p[2];(o=f.patches).push.apply(o,p[1]),(c=f.inversePatches).push.apply(c,v),l=h}else l=r(d.data),f.patches.push({op:"replace",path:[],value:l}),f.inversePatches.push({op:"replace",path:[],value:d.data});return a(s.util.patchQueryData(t,n,f.patches,i)),f}},upsertQueryData:function(e,t,n){return function(r){var i;return r(s.endpoints[e].initiate(t,((i={subscribe:!1,forceRefetch:!0})[G]=function(){return{data:n}},i)))}},patchQueryData:function(e,t,n,r){return function(i,a){var l=u[e],d=o({queryArgs:t,endpointDefinition:l,endpointName:e});if(i(s.internalActions.queryResultPatched({queryCacheKey:d,patches:n})),r){var f=s.endpoints[e].select(t)(a()),p=W(l.providesTags,f.data,void 0,t,{},c);i(s.internalActions.updateProvidedBy({queryCacheKey:d,providedTags:p}))}}},buildMatchThunkActions:function(e,t){return{matchPending:(0,$.isAllOf)((0,$.isPending)(e),h(t)),matchFulfilled:(0,$.isAllOf)((0,$.isFulfilled)(e),h(t)),matchRejected:(0,$.isAllOf)((0,$.isRejected)(e),h(t))}}}}({baseQuery:u,reducerPath:o,context:a,api:t,serializeQueryArgs:s,assertTagType:p}),m=h.queryThunk,g=h.mutationThunk,b=h.patchQueryData,O=h.updateQueryData,T=h.upsertQueryData,R=h.prefetch,j=h.buildMatchThunkActions,w=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.mutationThunk,a=t.context,u=a.endpointDefinitions,o=a.apiUid,s=a.extractRehydrationInfo,c=a.hasRehydrationInfo,l=t.assertTagType,d=t.config,f=(0,J.createAction)(n+"/resetApiState"),p=(0,J.createSlice)({name:n+"/queries",initialState:oe,reducers:{removeQueryResult:{reducer:function(e,t){delete e[t.payload.queryCacheKey]},prepare:(0,J.prepareAutoBatched)()},queryResultPatched:{reducer:function(e,t){var n=t.payload,r=n.patches;ie(e,n.queryCacheKey,(function(e){e.data=(0,re.applyPatches)(e.data,r.concat())}))},prepare:(0,J.prepareAutoBatched)()}},extraReducers:function(t){t.addCase(r.pending,(function(t,n){var r,i=n.meta,a=n.meta.arg,u=Y(a);(a.subscribe||u)&&(null!=t[r=a.queryCacheKey]||(t[r]={status:e.uninitialized,endpointName:a.endpointName})),ie(t,a.queryCacheKey,(function(t){t.status=e.pending,t.requestId=u&&t.requestId?t.requestId:i.requestId,void 0!==a.originalArgs&&(t.originalArgs=a.originalArgs),t.startedTimeStamp=i.startedTimeStamp}))})).addCase(r.fulfilled,(function(t,n){var r=n.meta,i=n.payload;ie(t,r.arg.queryCacheKey,(function(t){var n;if(t.requestId===r.requestId||Y(r.arg)){var a=u[r.arg.endpointName].merge;if(t.status=e.fulfilled,a)if(void 0!==t.data){var o=r.fulfilledTimeStamp,s=r.arg,c=r.baseQueryMeta,l=r.requestId,d=(0,J.createNextState)(t.data,(function(e){return a(e,i,{arg:s.originalArgs,baseQueryMeta:c,fulfilledTimeStamp:o,requestId:l})}));t.data=d}else t.data=i;else t.data=null==(n=u[r.arg.endpointName].structuralSharing)||n?A((0,ne.isDraft)(t.data)?(0,re.original)(t.data):t.data,i):i;delete t.error,t.fulfilledTimeStamp=r.fulfilledTimeStamp}}))})).addCase(r.rejected,(function(t,n){var r=n.meta,i=r.condition,a=r.requestId,u=n.error,o=n.payload;ie(t,r.arg.queryCacheKey,(function(t){if(i);else{if(t.requestId!==a)return;t.status=e.rejected,t.error=null!=o?o:u}}))})).addMatcher(c,(function(t,n){for(var r=s(n).queries,i=0,a=Object.entries(r);i<a.length;i++){var u=a[i],o=u[1];(null==o?void 0:o.status)!==e.fulfilled&&(null==o?void 0:o.status)!==e.rejected||(t[u[0]]=o)}}))}}),h=(0,J.createSlice)({name:n+"/mutations",initialState:oe,reducers:{removeMutationResult:{reducer:function(e,t){var n=ae(t.payload);n in e&&delete e[n]},prepare:(0,J.prepareAutoBatched)()}},extraReducers:function(t){t.addCase(i.pending,(function(t,n){var r=n.meta,i=r.requestId,a=r.arg,u=r.startedTimeStamp;a.track&&(t[ae(n.meta)]={requestId:i,status:e.pending,endpointName:a.endpointName,startedTimeStamp:u})})).addCase(i.fulfilled,(function(t,n){var r=n.payload,i=n.meta;i.arg.track&&ue(t,i,(function(t){t.requestId===i.requestId&&(t.status=e.fulfilled,t.data=r,t.fulfilledTimeStamp=i.fulfilledTimeStamp)}))})).addCase(i.rejected,(function(t,n){var r=n.payload,i=n.error,a=n.meta;a.arg.track&&ue(t,a,(function(t){t.requestId===a.requestId&&(t.status=e.rejected,t.error=null!=r?r:i)}))})).addMatcher(c,(function(t,n){for(var r=s(n).mutations,i=0,a=Object.entries(r);i<a.length;i++){var u=a[i],o=u[0],c=u[1];(null==c?void 0:c.status)!==e.fulfilled&&(null==c?void 0:c.status)!==e.rejected||o===(null==c?void 0:c.requestId)||(t[o]=c)}}))}}),m=(0,J.createSlice)({name:n+"/invalidation",initialState:oe,reducers:{updateProvidedBy:{reducer:function(e,t){for(var n,r,i,a,u=t.payload,o=u.queryCacheKey,s=u.providedTags,c=0,l=Object.values(e);c<l.length;c++)for(var d=0,f=Object.values(l[c]);d<f.length;d++){var p=f[d],h=p.indexOf(o);-1!==h&&p.splice(h,1)}for(var v=0,y=s;v<y.length;v++){var m=y[v],g=m.type,b=m.id,q=null!=(a=(r=null!=(n=e[g])?n:e[g]={})[i=b||"__internal_without_id"])?a:r[i]=[];q.includes(o)||q.push(o)}},prepare:(0,J.prepareAutoBatched)()}},extraReducers:function(e){e.addCase(p.actions.removeQueryResult,(function(e,t){for(var n=t.payload.queryCacheKey,r=0,i=Object.values(e);r<i.length;r++)for(var a=0,u=Object.values(i[r]);a<u.length;a++){var o=u[a],s=o.indexOf(n);-1!==s&&o.splice(s,1)}})).addMatcher(c,(function(e,t){for(var n,r,i,a,u=s(t).provided,o=0,c=Object.entries(u);o<c.length;o++)for(var l=c[o],d=l[0],f=0,p=Object.entries(l[1]);f<p.length;f++)for(var h=p[f],v=h[0],y=h[1],m=null!=(a=(r=null!=(n=e[d])?n:e[d]={})[i=v||"__internal_without_id"])?a:r[i]=[],g=0,b=y;g<b.length;g++){var q=b[g];m.includes(q)||m.push(q)}})).addMatcher((0,J.isAnyOf)((0,J.isFulfilled)(r),(0,J.isRejectedWithValue)(r)),(function(e,t){var n=te(t,"providesTags",u,l);m.caseReducers.updateProvidedBy(e,m.actions.updateProvidedBy({queryCacheKey:t.meta.arg.queryCacheKey,providedTags:n}))}))}}),g=(0,J.createSlice)({name:n+"/subscriptions",initialState:oe,reducers:{updateSubscriptionOptions:function(e,t){},unsubscribeQueryResult:function(e,t){},internal_probeSubscription:function(e,t){}}}),b=(0,J.createSlice)({name:n+"/internalSubscriptions",initialState:oe,reducers:{subscriptionsUpdated:{reducer:function(e,t){return(0,re.applyPatches)(e,t.payload)},prepare:(0,J.prepareAutoBatched)()}}}),q=(0,J.createSlice)({name:n+"/config",initialState:v({online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1},d),reducers:{middlewareRegistered:function(e,t){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&o===t.payload||"conflict"}},extraReducers:function(e){e.addCase(K,(function(e){e.online=!0})).addCase(E,(function(e){e.online=!1})).addCase(D,(function(e){e.focused=!0})).addCase(N,(function(e){e.focused=!1})).addMatcher(c,(function(e){return v({},e)}))}}),S=(0,J.combineReducers)({queries:p.reducer,mutations:h.reducer,provided:m.reducer,subscriptions:b.reducer,config:q.reducer});return{reducer:function(e,t){return S(f.match(t)?void 0:e,t)},actions:y(v(v(v(v(v(v({},q.actions),p.actions),g.actions),b.actions),h.actions),m.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:f})}}({context:a,queryThunk:m,mutationThunk:g,reducerPath:o,assertTagType:p,config:{refetchOnFocus:d,refetchOnReconnect:f,refetchOnMountOrArgChange:l,keepUnusedDataFor:c,reducerPath:o}}),k=w.reducer,x=w.actions;Me(t.util,{patchQueryData:b,updateQueryData:O,upsertQueryData:T,prefetch:R,resetApiState:x.resetApiState}),Me(t.internalActions,x);var Q=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.api,a=t.context,u=a.apiUid,o={invalidateTags:(0,Se.createAction)(n+"/invalidateTags")},s=[Qe,Oe,Te,Re,ke,Pe];return{middleware:function(r){var o=!1,l=y(v({},t),{internalState:{currentSubscriptions:{}},refetchQuery:c}),d=s.map((function(e){return e(l)})),f=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",a=null,u=!1,o=t.internalActions,s=o.updateSubscriptionOptions,c=o.unsubscribeQueryResult;return function(e,o){var l,d;if(a||(a=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.util.resetApiState.match(e))return a=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(e)){var f=e.payload;return[!1,!!(null==(l=r.currentSubscriptions[f.queryCacheKey])?void 0:l[f.requestId])]}var p=function(e,r){var i,a,u,o,l,d,f,p,h;if(s.match(r)){var v=r.payload,y=v.queryCacheKey,m=v.requestId;return(null==(i=null==e?void 0:e[y])?void 0:i[m])&&(e[y][m]=v.options),!0}if(c.match(r)){var g=r.payload;return m=g.requestId,e[y=g.queryCacheKey]&&delete e[y][m],!0}if(t.internalActions.removeQueryResult.match(r))return delete e[r.payload.queryCacheKey],!0;if(n.pending.match(r)){var b=r.meta;if(m=b.requestId,(O=b.arg).subscribe)return(q=null!=(u=e[a=O.queryCacheKey])?u:e[a]={})[m]=null!=(l=null!=(o=O.subscriptionOptions)?o:q[m])?l:{},!0}if(n.rejected.match(r)){var q,S=r.meta,O=S.arg;if(m=S.requestId,S.condition&&O.subscribe)return(q=null!=(f=e[d=O.queryCacheKey])?f:e[d]={})[m]=null!=(h=null!=(p=O.subscriptionOptions)?p:q[m])?h:{},!0}return!1}(r.currentSubscriptions,e);if(p){u||(Ie((function(){var e=JSON.parse(JSON.stringify(r.currentSubscriptions)),n=(0,Ce.produceWithPatches)(a,(function(){return e}));o.next(t.internalActions.subscriptionsUpdated(n[1])),a=e,u=!1})),u=!0);var h=!!(null==(d=e.type)?void 0:d.startsWith(i)),v=n.rejected.match(e)&&e.meta.condition&&!!e.meta.arg.subscribe;return[!h&&!v,!1]}return[!0,!1]}}(l),p=function(t){var n=t.reducerPath,r=t.context,i=t.refetchQuery,a=t.internalState,u=t.api.internalActions.removeQueryResult;function o(t,o){var s=t.getState()[n],c=s.queries,l=a.currentSubscriptions;r.batch((function(){for(var n=0,r=Object.keys(l);n<r.length;n++){var a=r[n],d=c[a],f=l[a];f&&d&&(Object.values(f).some((function(e){return!0===e[o]}))||Object.values(f).every((function(e){return void 0===e[o]}))&&s.config[o])&&(0===Object.keys(f).length?t.dispatch(u({queryCacheKey:a})):d.status!==e.uninitialized&&t.dispatch(i(d,a)))}}))}return function(e,t){D.match(e)&&o(t,"refetchOnFocus"),K.match(e)&&o(t,"refetchOnReconnect")}}(l);return function(e){return function(t){o||(o=!0,r.dispatch(i.internalActions.middlewareRegistered(u)));var s,c=y(v({},r),{next:e}),l=r.getState(),h=f(t,c,l),m=h[1];if(s=h[0]?e(t):m,r.getState()[n]&&(p(t,c,l),function(e){return!!e&&"string"==typeof e.type&&e.type.startsWith(n+"/")}(t)||a.hasRehydrationInfo(t)))for(var g=0,b=d;g<b.length;g++)(0,b[g])(t,c,l);return s}}},actions:o};function c(e,t,n){return void 0===n&&(n={}),r(v({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},n))}}({reducerPath:o,context:a,queryThunk:m,mutationThunk:g,api:t,assertTagType:p}),C=Q.middleware;Me(t.util,Q.actions),Me(t,{reducer:k,middleware:C});var I=function(t){var n=t.serializeQueryArgs,r=t.reducerPath,i=function(e){return de},a=function(e){return fe};return{buildQuerySelector:function(e,t){return function(r){var a=n({queryArgs:r,endpointDefinition:t,endpointName:e});return(0,B.createSelector)(r===se?i:function(e){var t,n,r;return null!=(r=null==(n=null==(t=o(e))?void 0:t.queries)?void 0:n[a])?r:de},u)}},buildMutationSelector:function(){return function(e){var t,n;return n="object"==typeof e?null!=(t=ae(e))?t:se:e,(0,B.createSelector)(n===se?a:function(e){var t,r,i;return null!=(i=null==(r=null==(t=o(e))?void 0:t.mutations)?void 0:r[n])?i:fe},u)}},selectInvalidatedBy:function(e,t){for(var n,i=e[r],a=new Set,u=0,o=t.map(H);u<o.length;u++){var s=o[u],c=i.provided[s.type];if(c)for(var l=0,d=null!=(n=void 0!==s.id?c[s.id]:S(Object.values(c)))?n:[];l<d.length;l++)a.add(d[l])}return S(Array.from(a.values()).map((function(e){var t=i.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))}};function u(t){return v(v({},t),{status:n=t.status,isUninitialized:n===e.uninitialized,isLoading:n===e.pending,isSuccess:n===e.fulfilled,isError:n===e.rejected});var n}function o(e){return e[r]}}({serializeQueryArgs:s,reducerPath:o}),M=I.buildQuerySelector,_=I.buildMutationSelector;Me(t.util,{selectInvalidatedBy:I.selectInvalidatedBy});var F=function(e){var t=e.serializeQueryArgs,i=e.queryThunk,a=e.mutationThunk,u=e.api,o=e.context,s=new Map,c=new Map,l=u.internalActions,d=l.unsubscribeQueryResult,f=l.removeMutationResult,p=l.updateSubscriptionOptions;return{buildInitiateQuery:function(e,r){var a=function(o,c){var l=void 0===c?{}:c,f=l.subscribe,h=void 0===f||f,v=l.forceRefetch,y=l.subscriptionOptions,m=l[G];return function(c,l){var f,g,b=t({queryArgs:o,endpointDefinition:r,endpointName:e}),S=i(((f={type:"query",subscribe:h,forceRefetch:v,subscriptionOptions:y,endpointName:e,originalArgs:o,queryCacheKey:b})[G]=m,f)),O=u.endpoints[e].select(o),A=c(S),T=O(l()),R=A.requestId,j=A.abort,w=T.requestId!==R,k=null==(g=s.get(c))?void 0:g[b],x=function(){return O(l())},P=Object.assign(m?A.then(x):w&&!k?Promise.resolve(T):Promise.all([k,A]).then(x),{arg:o,requestId:R,subscriptionOptions:y,queryCacheKey:b,abort:j,unwrap:function(){return q(this,null,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,P];case 1:if((e=t.sent()).isError)throw e.error;return[2,e.data]}}))}))},refetch:function(){return c(a(o,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){h&&c(d({queryCacheKey:b,requestId:R}))},updateSubscriptionOptions:function(t){P.subscriptionOptions=t,c(p({endpointName:e,requestId:R,queryCacheKey:b,options:t}))}});if(!k&&!w&&!m){var Q=s.get(c)||{};Q[b]=P,s.set(c,Q),P.then((function(){delete Q[b],Object.keys(Q).length||s.delete(c)}))}return P}};return a},buildInitiateMutation:function(e){return function(t,n){var r=void 0===n?{}:n,i=r.track,u=void 0===i||i,o=r.fixedCacheKey;return function(n,r){var i=a({type:"mutation",endpointName:e,originalArgs:t,track:u,fixedCacheKey:o}),s=n(i),l=s.requestId,d=s.abort,p=s.unwrap,h=s.unwrap().then((function(e){return{data:e}})).catch((function(e){return{error:e}})),v=function(){n(f({requestId:l,fixedCacheKey:o}))},y=Object.assign(h,{arg:s.arg,requestId:l,abort:d,unwrap:p,unsubscribe:v,reset:v}),m=c.get(n)||{};return c.set(n,m),m[l]=y,y.then((function(){delete m[l],Object.keys(m).length||c.delete(n)})),o&&(m[o]=y,y.then((function(){m[o]===y&&(delete m[o],Object.keys(m).length||c.delete(n))}))),y}}},getRunningQueryThunk:function(e,n){return function(r){var i,a=t({queryArgs:n,endpointDefinition:o.endpointDefinitions[e],endpointName:e});return null==(i=s.get(r))?void 0:i[a]}},getRunningMutationThunk:function(e,t){return function(e){var n;return null==(n=c.get(e))?void 0:n[t]}},getRunningQueriesThunk:function(){return function(e){return Object.values(s.get(e)||{}).filter(V)}},getRunningMutationsThunk:function(){return function(e){return Object.values(c.get(e)||{}).filter(V)}},getRunningOperationPromises:function(){var e=function(e){return Array.from(e.values()).flatMap((function(e){return e?Object.values(e):[]}))};return r(r([],e(s)),e(c)).filter(V)},removalWarning:function(){throw new Error("This method had to be removed due to a conceptual bug in RTK.\n Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.\n See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.")}}}({queryThunk:m,mutationThunk:g,api:t,serializeQueryArgs:s,context:a}),U=F.buildInitiateQuery,ce=F.buildInitiateMutation;return Me(t.util,{getRunningOperationPromises:F.getRunningOperationPromises,getRunningOperationPromise:F.removalWarning,getRunningMutationThunk:F.getRunningMutationThunk,getRunningMutationsThunk:F.getRunningMutationsThunk,getRunningQueryThunk:F.getRunningQueryThunk,getRunningQueriesThunk:F.getRunningQueriesThunk}),{name:Ne,injectEndpoint:function(e,n){var r,i=t;null!=(r=i.endpoints)[e]||(r[e]={}),L(n)?Me(i.endpoints[e],{name:e,select:M(e,n),initiate:U(e,n)},j(m,e)):n.type===z.mutation&&Me(i.endpoints[e],{name:e,select:_(),initiate:ce(e)},j(g,e))}}}}},Ee=ge(Ke()); | ||
//# sourceMappingURL=rtk-query.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
var e,t,n=Object.defineProperty,r=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,u=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&u(e,n,t[n]);if(a)for(var n of a(t))s.call(t,n)&&u(e,n,t[n]);return e},l=(e,t)=>r(e,i(t)),d=(e,t)=>{var n={};for(var r in e)o.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&a)for(var r of a(e))t.indexOf(r)<0&&s.call(e,r)&&(n[r]=e[r]);return n};(t=e||(e={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var f=e=>[].concat(...e);import{isPlainObject as p}from"@reduxjs/toolkit";var y=p;function m(e,t){if(e===t||!(y(e)&&y(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const a=Array.isArray(t)?[]:{};for(const r of n)a[r]=m(e[r],t[r]),i&&(i=e[r]===a[r]);return i?e:a}import{isPlainObject as h}from"@reduxjs/toolkit";var g=(...e)=>fetch(...e),v=e=>e.status>=200&&e.status<=299,b=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function q(e){if(!h(e))return e;const t=c({},e);for(const[e,n]of Object.entries(t))void 0===n&&delete t[e];return t}function S(e={}){var t=e,{baseUrl:n,prepareHeaders:r=(e=>e),fetchFn:i=g,paramsSerializer:a,isJsonContentType:o=b,jsonContentType:s="application/json",jsonReplacer:u,timeout:f,validateStatus:p}=t,y=d(t,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","validateStatus"]);return"undefined"==typeof fetch&&i===g&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(e,t)=>{const{signal:g,getState:b,extra:S,endpoint:O,forced:R,type:w}=t;let T,j="string"==typeof e?{url:e}:e,{url:A,headers:k=new Headers(y.headers),params:x,responseHandler:Q="json",validateStatus:I=(null!=p?p:v),timeout:C=f}=j,P=d(j,["url","headers","params","responseHandler","validateStatus","timeout"]),M=c(l(c({},y),{signal:g}),P);k=new Headers(q(k)),M.headers=await r(k,{getState:b,extra:S,endpoint:O,forced:R,type:w})||k;const D=e=>"object"==typeof e&&(h(e)||Array.isArray(e)||"function"==typeof e.toJSON);if(!M.headers.has("content-type")&&D(M.body)&&M.headers.set("content-type",s),D(M.body)&&o(M.headers)&&(M.body=JSON.stringify(M.body,u)),x){const e=~A.indexOf("?")?"&":"?";A+=e+(a?a(x):new URLSearchParams(q(x)))}A=function(e,t){if(!e)return t;if(!t)return e;if(function(e){return new RegExp("(^|:)//").test(e)}(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=(e=>e.replace(/\/$/,""))(e),`${e}${n}${t=(e=>e.replace(/^\//,""))(t)}`}(n,A);const N=new Request(A,M);T={request:N.clone()};let K,E=!1,F=C&&setTimeout((()=>{E=!0,t.abort()}),C);try{K=await i(N)}catch(e){return{error:{status:E?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(e)},meta:T}}finally{F&&clearTimeout(F)}const z=K.clone();let _;T.response=z;let $="";try{let e;if(await Promise.all([m(K,Q).then((e=>_=e),(t=>e=t)),z.text().then((e=>$=e),(()=>{}))]),e)throw e}catch(e){return{error:{status:"PARSING_ERROR",originalStatus:K.status,data:$,error:String(e)},meta:T}}return I(K,_)?{data:_,meta:T}:{error:{status:K.status,data:_},meta:T}};async function m(e,t){if("function"==typeof t)return t(e);if("content-type"===t&&(t=o(e.headers)?"json":"text"),"json"===t){const t=await e.text();return t.length?JSON.parse(t):null}return e.text()}}var O=class{constructor(e,t){this.value=e,this.meta=t}};async function R(e=0,t=5){const n=Math.min(e,t),r=~~((Math.random()+.4)*(300<<n));await new Promise((e=>setTimeout((t=>e(t)),r)))}var w={},T=Object.assign(((e,t)=>async(n,r,i)=>{const a=[5,(t||w).maxRetries,(i||w).maxRetries].filter((e=>void 0!==e)),[o]=a.slice(-1),s=c(c({maxRetries:o,backoff:R,retryCondition:(e,t,{attempt:n})=>n<=o},t),i);let u=0;for(;;)try{const t=await e(n,r,i);if(t.error)throw new O(t);return t}catch(e){if(u++,e.throwImmediately){if(e instanceof O)return e.value;throw e}if(e instanceof O&&!s.retryCondition(e.value.error,n,{attempt:u,baseQueryApi:r,extraOptions:i}))return e.value;await s.backoff(u,s.maxRetries)}}),{fail:function(e){throw Object.assign(new O({error:e}),{throwImmediately:!0})}});import{createAction as j}from"@reduxjs/toolkit";var A,k,x=j("__rtkq/focused"),Q=j("__rtkq/unfocused"),I=j("__rtkq/online"),C=j("__rtkq/offline"),P=!1;function M(e,t){return t?t(e,{onFocus:x,onFocusLost:Q,onOffline:C,onOnline:I}):function(){const t=()=>e(x()),n=()=>e(I()),r=()=>e(C()),i=()=>{"visible"===window.document.visibilityState?t():e(Q())};return P||"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("visibilitychange",i,!1),window.addEventListener("focus",t,!1),window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),P=!0),()=>{window.removeEventListener("focus",t),window.removeEventListener("visibilitychange",i),window.removeEventListener("online",n),window.removeEventListener("offline",r),P=!1}}()}import{createNextState as D,createSelector as N}from"@reduxjs/toolkit";function K(e){return e.type===A.query}function E(e,t,n,r,i,a){return"function"==typeof e?e(t,n,r,i).map(F).map(a):Array.isArray(e)?e.map(F).map(a):[]}function F(e){return"string"==typeof e?{type:e}:e}(k=A||(A={})).query="query",k.mutation="mutation";import{combineReducers as z,createAction as _,createSlice as $,isAnyOf as U,isFulfilled as L,isRejectedWithValue as W,createNextState as J,prepareAutoBatched as H}from"@reduxjs/toolkit";function B(e){return null!=e}var V=Symbol("forceQueryFn"),G=e=>"function"==typeof e[V];import{isAllOf as Y,isFulfilled as X,isPending as Z,isRejected as ee,isRejectedWithValue as te}from"@reduxjs/toolkit";import{isDraftable as ne,produceWithPatches as re}from"immer";import{createAsyncThunk as ie,SHOULD_AUTOBATCH as ae}from"@reduxjs/toolkit";function oe(e){return e}function se(e,t,n,r){return E(n[e.meta.arg.endpointName][t],X(e)?e.payload:void 0,te(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}import{applyPatches as ue}from"immer";function ce(e,t,n){const r=e[t];r&&n(r)}function le(e){var t;return null!=(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)?t:e.requestId}function de(e,t,n){const r=e[le(t)];r&&n(r)}var fe={},pe=Symbol.for("RTKQ/skipToken"),ye=pe,me={status:e.uninitialized},he=D(me,(()=>{})),ge=D(me,(()=>{}));import{isPlainObject as ve}from"@reduxjs/toolkit";var be=({endpointName:e,queryArgs:t})=>`${e}(${JSON.stringify(t,((e,t)=>ve(t)?Object.keys(t).sort().reduce(((e,n)=>(e[n]=t[n],e)),{}):t))})`;import{nanoid as qe}from"@reduxjs/toolkit";import{defaultMemoize as Se}from"reselect";function Oe(...e){return function(t){const n=Se((e=>{var n,r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:null!=(n=t.reducerPath)?n:"api"})})),r=l(c({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{extractRehydrationInfo:n,serializeQueryArgs(e){let n=be;if("serializeQueryArgs"in e.endpointDefinition){const t=e.endpointDefinition.serializeQueryArgs;n=e=>{const n=t(e);return"string"==typeof n?n:be(l(c({},e),{queryArgs:n}))}}else t.serializeQueryArgs&&(n=t.serializeQueryArgs);return n(e)},tagTypes:[...t.tagTypes||[]]}),i={endpointDefinitions:{},batch(e){e()},apiUid:qe(),extractRehydrationInfo:n,hasRehydrationInfo:Se((e=>null!=n(e)))},a={injectEndpoints:function(e){const t=e.endpoints({query:e=>l(c({},e),{type:A.query}),mutation:e=>l(c({},e),{type:A.mutation})});for(const[n,r]of Object.entries(t))if(e.overrideExisting||!(n in i.endpointDefinitions)){i.endpointDefinitions[n]=r;for(const e of o)e.injectEndpoint(n,r)}return a},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(const t of e)r.tagTypes.includes(t)||r.tagTypes.push(t);if(t)for(const[e,n]of Object.entries(t))"function"==typeof n?n(i.endpointDefinitions[e]):Object.assign(i.endpointDefinitions[e]||{},n);return a}},o=e.map((e=>e.init(a,r,i)));return a.injectEndpoints({endpoints:t.endpoints})}}function Re(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}import{createAction as we}from"@reduxjs/toolkit";var Te=({reducerPath:e,api:t,context:n,internalState:r})=>{const{removeQueryResult:i,unsubscribeQueryResult:a}=t.internalActions;function o(e){const t=r.currentSubscriptions[e];return!!t&&!function(e){for(let t in e)return!1;return!0}(t)}const s={};function u(e,t,r,a){var u;const c=n.endpointDefinitions[t],l=null!=(u=null==c?void 0:c.keepUnusedDataFor)?u:a.keepUnusedDataFor;if(Infinity===l)return;const d=Math.max(0,Math.min(l,2147482.647));if(!o(e)){const t=s[e];t&&clearTimeout(t),s[e]=setTimeout((()=>{o(e)||r.dispatch(i({queryCacheKey:e})),delete s[e]}),1e3*d)}}return(r,i,o)=>{var c;if(a.match(r)){const t=i.getState()[e],{queryCacheKey:n}=r.payload;u(n,null==(c=t.queries[n])?void 0:c.endpointName,i,t.config)}if(t.util.resetApiState.match(r))for(const[e,t]of Object.entries(s))t&&clearTimeout(t),delete s[e];if(n.hasRehydrationInfo(r)){const t=i.getState()[e],{queries:a}=n.extractRehydrationInfo(r);for(const[e,n]of Object.entries(a))u(e,null==n?void 0:n.endpointName,i,t.config)}}};import{isAnyOf as je,isFulfilled as Ae,isRejectedWithValue as ke}from"@reduxjs/toolkit";var xe=({reducerPath:t,context:n,context:{endpointDefinitions:r},mutationThunk:i,api:a,assertTagType:o,refetchQuery:s})=>{const{removeQueryResult:u}=a.internalActions,c=je(Ae(i),ke(i));function l(r,i){const o=i.getState(),c=o[t],l=a.util.selectInvalidatedBy(o,r);n.batch((()=>{var t;const n=Array.from(l.values());for(const{queryCacheKey:r}of n){const n=c.queries[r],a=null!=(t=c.subscriptions[r])?t:{};n&&(0===Object.keys(a).length?i.dispatch(u({queryCacheKey:r})):n.status!==e.uninitialized&&i.dispatch(s(n,r)))}}))}return(e,t)=>{c(e)&&l(se(e,"invalidatesTags",r,o),t),a.util.invalidateTags.match(e)&&l(E(e.payload,void 0,void 0,void 0,void 0,o),t)}},Qe=({reducerPath:t,queryThunk:n,api:r,refetchQuery:i,internalState:a})=>{const o={};function s({queryCacheKey:n},r){const s=r.getState()[t].queries[n];if(!s||s.status===e.uninitialized)return;const u=l(a.currentSubscriptions[n]);if(!Number.isFinite(u))return;const c=o[n];(null==c?void 0:c.timeout)&&(clearTimeout(c.timeout),c.timeout=void 0);const d=Date.now()+u,f=o[n]={nextPollTimestamp:d,pollingInterval:u,timeout:setTimeout((()=>{f.timeout=void 0,r.dispatch(i(s,n))}),u)}}function u({queryCacheKey:n},r){const i=r.getState()[t].queries[n];if(!i||i.status===e.uninitialized)return;const u=l(a.currentSubscriptions[n]);if(!Number.isFinite(u))return void c(n);const d=o[n],f=Date.now()+u;(!d||f<d.nextPollTimestamp)&&s({queryCacheKey:n},r)}function c(e){const t=o[e];(null==t?void 0:t.timeout)&&clearTimeout(t.timeout),delete o[e]}function l(e={}){let t=Number.POSITIVE_INFINITY;for(let n in e)e[n].pollingInterval&&(t=Math.min(e[n].pollingInterval,t));return t}return(e,t)=>{(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&u(e.payload,t),(n.pending.match(e)||n.rejected.match(e)&&e.meta.condition)&&u(e.meta.arg,t),(n.fulfilled.match(e)||n.rejected.match(e)&&!e.meta.condition)&&s(e.meta.arg,t),r.util.resetApiState.match(e)&&function(){for(const e of Object.keys(o))c(e)}()}};import{isAsyncThunkAction as Ie,isFulfilled as Ce}from"@reduxjs/toolkit";var Pe=new Error("Promise never resolved before cacheEntryRemoved."),Me=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i})=>{const a=Ie(r),o=Ie(i),s=Ce(r,i),u={};function d(t,r,i,a,o){const s=n.endpointDefinitions[t],d=null==s?void 0:s.onCacheEntryAdded;if(!d)return;let f={};const p=new Promise((e=>{f.cacheEntryRemoved=e})),y=Promise.race([new Promise((e=>{f.valueResolved=e})),p.then((()=>{throw Pe}))]);y.catch((()=>{})),u[i]=f;const m=e.endpoints[t].select(s.type===A.query?r:i),h=a.dispatch(((e,t,n)=>n)),g=l(c({},a),{getCacheEntry:()=>m(a.getState()),requestId:o,extra:h,updateCachedData:s.type===A.query?n=>a.dispatch(e.util.updateQueryData(t,r,n)):void 0,cacheDataLoaded:y,cacheEntryRemoved:p}),v=d(r,g);Promise.resolve(v).catch((e=>{if(e!==Pe)throw e}))}return(n,c,l)=>{const f=function(t){return a(t)?t.meta.arg.queryCacheKey:o(t)?t.meta.requestId:e.internalActions.removeQueryResult.match(t)?t.payload.queryCacheKey:e.internalActions.removeMutationResult.match(t)?le(t.payload):""}(n);if(r.pending.match(n)){const e=l[t].queries[f],r=c.getState()[t].queries[f];!e&&r&&d(n.meta.arg.endpointName,n.meta.arg.originalArgs,f,c,n.meta.requestId)}else if(i.pending.match(n))c.getState()[t].mutations[f]&&d(n.meta.arg.endpointName,n.meta.arg.originalArgs,f,c,n.meta.requestId);else if(s(n)){const e=u[f];(null==e?void 0:e.valueResolved)&&(e.valueResolved({data:n.payload,meta:n.meta.baseQueryMeta}),delete e.valueResolved)}else if(e.internalActions.removeQueryResult.match(n)||e.internalActions.removeMutationResult.match(n)){const e=u[f];e&&(delete u[f],e.cacheEntryRemoved())}else if(e.util.resetApiState.match(n))for(const[e,t]of Object.entries(u))delete u[e],t.cacheEntryRemoved()}};import{isPending as De,isRejected as Ne,isFulfilled as Ke}from"@reduxjs/toolkit";var Ee,Fe=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=De(n,r),a=Ne(n,r),o=Ke(n,r),s={};return(n,r)=>{var u,d,f;if(i(n)){const{requestId:i,arg:{endpointName:a,originalArgs:o}}=n.meta,u=t.endpointDefinitions[a],d=null==u?void 0:u.onQueryStarted;if(d){const t={},n=new Promise(((e,n)=>{t.resolve=e,t.reject=n}));n.catch((()=>{})),s[i]=t;const f=e.endpoints[a].select(u.type===A.query?o:i),p=r.dispatch(((e,t,n)=>n)),y=l(c({},r),{getCacheEntry:()=>f(r.getState()),requestId:i,extra:p,updateCachedData:u.type===A.query?t=>r.dispatch(e.util.updateQueryData(a,o,t)):void 0,queryFulfilled:n});d(o,y)}}else if(o(n)){const{requestId:e,baseQueryMeta:t}=n.meta;null==(u=s[e])||u.resolve({data:n.payload,meta:t}),delete s[e]}else if(a(n)){const{requestId:e,rejectedWithValue:t,baseQueryMeta:r}=n.meta;null==(f=s[e])||f.reject({error:null!=(d=n.payload)?d:n.error,isUnhandledError:!t,meta:r}),delete s[e]}}},ze=({api:e,context:{apiUid:t}})=>(n,r)=>{e.util.resetApiState.match(n)&&r.dispatch(e.internalActions.middlewareRegistered(t))};import{produceWithPatches as _e}from"immer";var $e="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):e=>(Ee||(Ee=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)));function Ue(e,...t){Object.assign(e,...t)}import{enablePatches as Le}from"immer";var We=Symbol(),Je=()=>({name:We,init(t,{baseQuery:n,reducerPath:r,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:o,refetchOnFocus:s,refetchOnReconnect:u},d){Le();const p=e=>e;Object.assign(t,{reducerPath:r,endpoints:{},internalActions:{onOnline:I,onOffline:C,onFocus:x,onFocusLost:Q},util:{}});const{queryThunk:y,mutationThunk:h,patchQueryData:g,updateQueryData:v,upsertQueryData:b,prefetch:q,buildMatchThunkActions:S}=function({reducerPath:t,baseQuery:n,context:{endpointDefinitions:r},serializeQueryArgs:i,api:a}){const o=async(e,{signal:t,abort:i,rejectWithValue:a,fulfillWithValue:o,dispatch:u,getState:c,extra:l})=>{const d=r[e.endpointName];try{let r,a=oe;const f={signal:t,abort:i,dispatch:u,getState:c,extra:l,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?s(e,c()):void 0},p="query"===e.type?e[V]:void 0;if(p?r=p():d.query?(r=await n(d.query(e.originalArgs),f,d.extraOptions),d.transformResponse&&(a=d.transformResponse)):r=await d.queryFn(e.originalArgs,f,d.extraOptions,(e=>n(e,f,d.extraOptions))),r.error)throw new O(r.error,r.meta);return o(await a(r.data,r.meta,e.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:r.meta,[ae]:!0})}catch(t){let n=t;if(n instanceof O){let t=oe;d.query&&d.transformErrorResponse&&(t=d.transformErrorResponse);try{return a(await t(n.value,n.meta,e.originalArgs),{baseQueryMeta:n.meta,[ae]:!0})}catch(e){n=e}}throw console.error(n),n}};function s(e,n){var r,i,a,o;const s=null==(i=null==(r=n[t])?void 0:r.queries)?void 0:i[e.queryCacheKey],u=null==(a=n[t])?void 0:a.config.refetchOnMountOrArgChange,c=null==s?void 0:s.fulfilledTimeStamp,l=null!=(o=e.forceRefetch)?o:e.subscribe&&u;return!!l&&(!0===l||(Number(new Date)-Number(c))/1e3>=l)}function u(e){return t=>{var n,r;return(null==(r=null==(n=null==t?void 0:t.meta)?void 0:n.arg)?void 0:r.endpointName)===e}}return{queryThunk:ie(`${t}/executeQuery`,o,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[ae]:!0}),condition(e,{getState:n}){var i,a,o;const u=n(),c=null==(a=null==(i=u[t])?void 0:i.queries)?void 0:a[e.queryCacheKey],l=null==c?void 0:c.fulfilledTimeStamp,d=e.originalArgs,f=null==c?void 0:c.originalArgs,p=r[e.endpointName];return!(!G(e)&&("pending"===(null==c?void 0:c.status)||!s(e,u)&&(!K(p)||!(null==(o=null==p?void 0:p.forceRefetch)?void 0:o.call(p,{currentArg:d,previousArg:f,endpointState:c,state:u})))&&l))},dispatchConditionRejection:!0}),mutationThunk:ie(`${t}/executeMutation`,o,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[ae]:!0})}),prefetch:(e,t,n)=>(r,i)=>{const o=(e=>"force"in e)(n)&&n.force,s=(e=>"ifOlderThan"in e)(n)&&n.ifOlderThan,u=(n=!0)=>a.endpoints[e].initiate(t,{forceRefetch:n}),c=a.endpoints[e].select(t)(i());if(o)r(u());else if(s){const e=null==c?void 0:c.fulfilledTimeStamp;if(!e)return void r(u());(Number(new Date)-Number(new Date(e)))/1e3>=s&&r(u())}else r(u(!1))},updateQueryData:(t,n,r)=>(i,o)=>{const s=a.endpoints[t].select(n)(o());let u={patches:[],inversePatches:[],undo:()=>i(a.util.patchQueryData(t,n,u.inversePatches))};if(s.status===e.uninitialized)return u;if("data"in s)if(ne(s.data)){const[,e,t]=re(s.data,r);u.patches.push(...e),u.inversePatches.push(...t)}else{const e=r(s.data);u.patches.push({op:"replace",path:[],value:e}),u.inversePatches.push({op:"replace",path:[],value:s.data})}return i(a.util.patchQueryData(t,n,u.patches)),u},upsertQueryData:(e,t,n)=>r=>r(a.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[V]:()=>({data:n})})),patchQueryData:(e,t,n)=>o=>{o(a.internalActions.queryResultPatched({queryCacheKey:i({queryArgs:t,endpointDefinition:r[e],endpointName:e}),patches:n}))},buildMatchThunkActions:function(e,t){return{matchPending:Y(Z(e),u(t)),matchFulfilled:Y(X(e),u(t)),matchRejected:Y(ee(e),u(t))}}}}({baseQuery:n,reducerPath:r,context:d,api:t,serializeQueryArgs:i}),{reducer:R,actions:w}=function({reducerPath:t,queryThunk:n,mutationThunk:r,context:{endpointDefinitions:i,apiUid:a,extractRehydrationInfo:o,hasRehydrationInfo:s},assertTagType:u,config:d}){const f=_(`${t}/resetApiState`),p=$({name:`${t}/queries`,initialState:fe,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:H()},queryResultPatched(e,{payload:{queryCacheKey:t,patches:n}}){ce(e,t,(e=>{e.data=ue(e.data,n.concat())}))}},extraReducers(t){t.addCase(n.pending,((t,{meta:n,meta:{arg:r}})=>{var i;const a=G(r);(r.subscribe||a)&&(null!=t[i=r.queryCacheKey]||(t[i]={status:e.uninitialized,endpointName:r.endpointName})),ce(t,r.queryCacheKey,(t=>{t.status=e.pending,t.requestId=a&&t.requestId?t.requestId:n.requestId,void 0!==r.originalArgs&&(t.originalArgs=r.originalArgs),t.startedTimeStamp=n.startedTimeStamp}))})).addCase(n.fulfilled,((t,{meta:n,payload:r})=>{ce(t,n.arg.queryCacheKey,(t=>{var a;if(t.requestId!==n.requestId&&!G(n.arg))return;const{merge:o}=i[n.arg.endpointName];if(t.status=e.fulfilled,o)if(void 0!==t.data){const{fulfilledTimeStamp:e,arg:i,baseQueryMeta:a,requestId:s}=n;let u=J(t.data,(t=>o(t,r,{arg:i.originalArgs,baseQueryMeta:a,fulfilledTimeStamp:e,requestId:s})));t.data=u}else t.data=r;else t.data=null==(a=i[n.arg.endpointName].structuralSharing)||a?m(t.data,r):r;delete t.error,t.fulfilledTimeStamp=n.fulfilledTimeStamp}))})).addCase(n.rejected,((t,{meta:{condition:n,arg:r,requestId:i},error:a,payload:o})=>{ce(t,r.queryCacheKey,(t=>{if(n);else{if(t.requestId!==i)return;t.status=e.rejected,t.error=null!=o?o:a}}))})).addMatcher(s,((t,n)=>{const{queries:r}=o(n);for(const[n,i]of Object.entries(r))(null==i?void 0:i.status)!==e.fulfilled&&(null==i?void 0:i.status)!==e.rejected||(t[n]=i)}))}}),y=$({name:`${t}/mutations`,initialState:fe,reducers:{removeMutationResult:{reducer(e,{payload:t}){const n=le(t);n in e&&delete e[n]},prepare:H()}},extraReducers(t){t.addCase(r.pending,((t,{meta:n,meta:{requestId:r,arg:i,startedTimeStamp:a}})=>{i.track&&(t[le(n)]={requestId:r,status:e.pending,endpointName:i.endpointName,startedTimeStamp:a})})).addCase(r.fulfilled,((t,{payload:n,meta:r})=>{r.arg.track&&de(t,r,(t=>{t.requestId===r.requestId&&(t.status=e.fulfilled,t.data=n,t.fulfilledTimeStamp=r.fulfilledTimeStamp)}))})).addCase(r.rejected,((t,{payload:n,error:r,meta:i})=>{i.arg.track&&de(t,i,(t=>{t.requestId===i.requestId&&(t.status=e.rejected,t.error=null!=n?n:r)}))})).addMatcher(s,((t,n)=>{const{mutations:r}=o(n);for(const[n,i]of Object.entries(r))(null==i?void 0:i.status)!==e.fulfilled&&(null==i?void 0:i.status)!==e.rejected||n===(null==i?void 0:i.requestId)||(t[n]=i)}))}}),h=$({name:`${t}/invalidation`,initialState:fe,reducers:{},extraReducers(e){e.addCase(p.actions.removeQueryResult,((e,{payload:{queryCacheKey:t}})=>{for(const n of Object.values(e))for(const e of Object.values(n)){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}})).addMatcher(s,((e,t)=>{var n,r,i,a;const{provided:s}=o(t);for(const[t,o]of Object.entries(s))for(const[s,u]of Object.entries(o)){const o=null!=(a=(r=null!=(n=e[t])?n:e[t]={})[i=s||"__internal_without_id"])?a:r[i]=[];for(const e of u)o.includes(e)||o.push(e)}})).addMatcher(U(L(n),W(n)),((e,t)=>{var n,r,a,o;const s=se(t,"providesTags",i,u),{queryCacheKey:c}=t.meta.arg;for(const t of Object.values(e))for(const e of Object.values(t)){const t=e.indexOf(c);-1!==t&&e.splice(t,1)}for(const{type:t,id:i}of s){const s=null!=(o=(r=null!=(n=e[t])?n:e[t]={})[a=i||"__internal_without_id"])?o:r[a]=[];s.includes(c)||s.push(c)}}))}}),g=$({name:`${t}/subscriptions`,initialState:fe,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_probeSubscription(e,t){}}}),v=$({name:`${t}/internalSubscriptions`,initialState:fe,reducers:{subscriptionsUpdated:(e,t)=>ue(e,t.payload)}}),b=$({name:`${t}/config`,initialState:c({online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1},d),reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&a===t||"conflict"}},extraReducers:e=>{e.addCase(I,(e=>{e.online=!0})).addCase(C,(e=>{e.online=!1})).addCase(x,(e=>{e.focused=!0})).addCase(Q,(e=>{e.focused=!1})).addMatcher(s,(e=>c({},e)))}}),q=z({queries:p.reducer,mutations:y.reducer,provided:h.reducer,subscriptions:v.reducer,config:b.reducer});return{reducer:(e,t)=>q(f.match(t)?void 0:e,t),actions:l(c(c(c(c(c({},b.actions),p.actions),g.actions),v.actions),y.actions),{unsubscribeMutationResult:y.actions.removeMutationResult,resetApiState:f})}}({context:d,queryThunk:y,mutationThunk:h,reducerPath:r,assertTagType:p,config:{refetchOnFocus:s,refetchOnReconnect:u,refetchOnMountOrArgChange:o,keepUnusedDataFor:a,reducerPath:r}});Ue(t.util,{patchQueryData:g,updateQueryData:v,upsertQueryData:b,prefetch:q,resetApiState:w.resetApiState}),Ue(t.internalActions,w);const{middleware:T,actions:j}=function(t){const{reducerPath:n,queryThunk:r,api:i,context:a}=t,{apiUid:o}=a,s={invalidateTags:we(`${n}/invalidateTags`)},u=[ze,Te,xe,Qe,Me,Fe];return{middleware:r=>{let s=!1;const f=l(c({},t),{internalState:{currentSubscriptions:{}},refetchQuery:d}),p=u.map((e=>e(f))),y=(({api:e,queryThunk:t,internalState:n})=>{const r=`${e.reducerPath}/subscriptions`;let i=null,a=!1;const{updateSubscriptionOptions:o,unsubscribeQueryResult:s}=e.internalActions;return(u,c)=>{var l,d;if(i||(i=JSON.parse(JSON.stringify(n.currentSubscriptions))),e.internalActions.internal_probeSubscription.match(u)){const{queryCacheKey:e,requestId:t}=u.payload;return[!1,!!(null==(l=n.currentSubscriptions[e])?void 0:l[t])]}const f=((n,r)=>{var i,a,u,c,l,d,f,p,y;if(o.match(r)){const{queryCacheKey:e,requestId:t,options:a}=r.payload;return(null==(i=null==n?void 0:n[e])?void 0:i[t])&&(n[e][t]=a),!0}if(s.match(r)){const{queryCacheKey:e,requestId:t}=r.payload;return n[e]&&delete n[e][t],!0}if(e.internalActions.removeQueryResult.match(r))return delete n[r.payload.queryCacheKey],!0;if(t.pending.match(r)){const{meta:{arg:e,requestId:t}}=r;if(e.subscribe){const r=null!=(u=n[a=e.queryCacheKey])?u:n[a]={};return r[t]=null!=(l=null!=(c=e.subscriptionOptions)?c:r[t])?l:{},!0}}if(t.rejected.match(r)){const{meta:{condition:e,arg:t,requestId:i}}=r;if(e&&t.subscribe){const e=null!=(f=n[d=t.queryCacheKey])?f:n[d]={};return e[i]=null!=(y=null!=(p=t.subscriptionOptions)?p:e[i])?y:{},!0}}return!1})(n.currentSubscriptions,u);if(f){a||($e((()=>{const t=JSON.parse(JSON.stringify(n.currentSubscriptions)),[,r]=_e(i,(()=>t));c.next(e.internalActions.subscriptionsUpdated(r)),i=t,a=!1})),a=!0);const o=!!(null==(d=u.type)?void 0:d.startsWith(r)),s=t.rejected.match(u)&&u.meta.condition&&!!u.meta.arg.subscribe;return[!o&&!s,!1]}return[!0,!1]}})(f),m=(({reducerPath:t,context:n,api:r,refetchQuery:i,internalState:a})=>{const{removeQueryResult:o}=r.internalActions;function s(r,s){const u=r.getState()[t],c=u.queries,l=a.currentSubscriptions;n.batch((()=>{for(const t of Object.keys(l)){const n=c[t],a=l[t];a&&n&&(Object.values(a).some((e=>!0===e[s]))||Object.values(a).every((e=>void 0===e[s]))&&u.config[s])&&(0===Object.keys(a).length?r.dispatch(o({queryCacheKey:t})):n.status!==e.uninitialized&&r.dispatch(i(n,t)))}}))}return(e,t)=>{x.match(e)&&s(t,"refetchOnFocus"),I.match(e)&&s(t,"refetchOnReconnect")}})(f);return e=>t=>{s||(s=!0,r.dispatch(i.internalActions.middlewareRegistered(o)));const u=l(c({},r),{next:e}),d=r.getState(),[f,h]=y(t,u,d);let g;if(g=f?e(t):h,r.getState()[n]&&(m(t,u,d),(e=>!!e&&"string"==typeof e.type&&e.type.startsWith(`${n}/`))(t)||a.hasRehydrationInfo(t)))for(let e of p)e(t,u,d);return g}},actions:s};function d(e,t,n={}){return r(c({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},n))}}({reducerPath:r,context:d,queryThunk:y,mutationThunk:h,api:t,assertTagType:p});Ue(t.util,j),Ue(t,{reducer:R,middleware:T});const{buildQuerySelector:k,buildMutationSelector:P,selectInvalidatedBy:M}=function({serializeQueryArgs:t,reducerPath:n}){const r=e=>he,i=e=>ge;return{buildQuerySelector:function(e,n){return i=>{const s=t({queryArgs:i,endpointDefinition:n,endpointName:e});return N(i===pe?r:e=>{var t,n,r;return null!=(r=null==(n=null==(t=o(e))?void 0:t.queries)?void 0:n[s])?r:he},a)}},buildMutationSelector:function(){return e=>{var t;let n;return n="object"==typeof e?null!=(t=le(e))?t:pe:e,N(n===pe?i:e=>{var t,r,i;return null!=(i=null==(r=null==(t=o(e))?void 0:t.mutations)?void 0:r[n])?i:ge},a)}},selectInvalidatedBy:function(e,t){var r;const i=e[n],a=new Set;for(const e of t.map(F)){const t=i.provided[e.type];if(!t)continue;let n=null!=(r=void 0!==e.id?t[e.id]:f(Object.values(t)))?r:[];for(const e of n)a.add(e)}return f(Array.from(a.values()).map((e=>{const t=i.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))}};function a(t){return c(c({},t),{status:n=t.status,isUninitialized:n===e.uninitialized,isLoading:n===e.pending,isSuccess:n===e.fulfilled,isError:n===e.rejected});var n}function o(e){return e[n]}}({serializeQueryArgs:i,reducerPath:r});Ue(t.util,{selectInvalidatedBy:M});const{buildInitiateQuery:D,buildInitiateMutation:E,getRunningMutationThunk:te,getRunningMutationsThunk:ye,getRunningQueriesThunk:me,getRunningQueryThunk:ve,getRunningOperationPromises:be,removalWarning:qe}=function({serializeQueryArgs:e,queryThunk:t,mutationThunk:n,api:r,context:i}){const a=new Map,o=new Map,{unsubscribeQueryResult:s,removeMutationResult:u,updateSubscriptionOptions:c}=r.internalActions;return{buildInitiateQuery:function(n,i){const o=(u,{subscribe:l=!0,forceRefetch:d,subscriptionOptions:f,[V]:p}={})=>(y,m)=>{var h;const g=e({queryArgs:u,endpointDefinition:i,endpointName:n}),v=t({type:"query",subscribe:l,forceRefetch:d,subscriptionOptions:f,endpointName:n,originalArgs:u,queryCacheKey:g,[V]:p}),b=r.endpoints[n].select(u),q=y(v),S=b(m()),{requestId:O,abort:R}=q,w=S.requestId!==O,T=null==(h=a.get(y))?void 0:h[g],j=()=>b(m()),A=Object.assign(p?q.then(j):w&&!T?Promise.resolve(S):Promise.all([T,q]).then(j),{arg:u,requestId:O,subscriptionOptions:f,queryCacheKey:g,abort:R,async unwrap(){const e=await A;if(e.isError)throw e.error;return e.data},refetch:()=>y(o(u,{subscribe:!1,forceRefetch:!0})),unsubscribe(){l&&y(s({queryCacheKey:g,requestId:O}))},updateSubscriptionOptions(e){A.subscriptionOptions=e,y(c({endpointName:n,requestId:O,queryCacheKey:g,options:e}))}});if(!T&&!w&&!p){const e=a.get(y)||{};e[g]=A,a.set(y,e),A.then((()=>{delete e[g],Object.keys(e).length||a.delete(y)}))}return A};return o},buildInitiateMutation:function(e){return(t,{track:r=!0,fixedCacheKey:i}={})=>(a,s)=>{const c=n({type:"mutation",endpointName:e,originalArgs:t,track:r,fixedCacheKey:i}),l=a(c),{requestId:d,abort:f,unwrap:p}=l,y=l.unwrap().then((e=>({data:e}))).catch((e=>({error:e}))),m=()=>{a(u({requestId:d,fixedCacheKey:i}))},h=Object.assign(y,{arg:l.arg,requestId:d,abort:f,unwrap:p,unsubscribe:m,reset:m}),g=o.get(a)||{};return o.set(a,g),g[d]=h,h.then((()=>{delete g[d],Object.keys(g).length||o.delete(a)})),i&&(g[i]=h,h.then((()=>{g[i]===h&&(delete g[i],Object.keys(g).length||o.delete(a))}))),h}},getRunningQueryThunk:function(t,n){return r=>{var o;const s=e({queryArgs:n,endpointDefinition:i.endpointDefinitions[t],endpointName:t});return null==(o=a.get(r))?void 0:o[s]}},getRunningMutationThunk:function(e,t){return e=>{var n;return null==(n=o.get(e))?void 0:n[t]}},getRunningQueriesThunk:function(){return e=>Object.values(a.get(e)||{}).filter(B)},getRunningMutationsThunk:function(){return e=>Object.values(o.get(e)||{}).filter(B)},getRunningOperationPromises:function(){{const e=e=>Array.from(e.values()).flatMap((e=>e?Object.values(e):[]));return[...e(a),...e(o)].filter(B)}},removalWarning:function(){throw new Error("This method had to be removed due to a conceptual bug in RTK.\n Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.\n See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.")}}}({queryThunk:y,mutationThunk:h,api:t,serializeQueryArgs:i,context:d});return Ue(t.util,{getRunningOperationPromises:be,getRunningOperationPromise:qe,getRunningMutationThunk:te,getRunningMutationsThunk:ye,getRunningQueryThunk:ve,getRunningQueriesThunk:me}),{name:We,injectEndpoint(e,n){var r;const i=t;null!=(r=i.endpoints)[e]||(r[e]={}),K(n)?Ue(i.endpoints[e],{name:e,select:k(e,n),initiate:D(e,n)},S(y,e)):n.type===A.mutation&&Ue(i.endpoints[e],{name:e,select:P(),initiate:E(e)},S(h,e))}}}}),He=Oe(Je());export{e as QueryStatus,Oe as buildCreateApi,m as copyWithStructuralSharing,Je as coreModule,He as createApi,be as defaultSerializeQueryArgs,Re as fakeBaseQuery,S as fetchBaseQuery,T as retry,M as setupListeners,ye as skipSelector,pe as skipToken}; | ||
var e,t,n=Object.defineProperty,r=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,u=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&u(e,n,t[n]);if(a)for(var n of a(t))s.call(t,n)&&u(e,n,t[n]);return e},d=(e,t)=>r(e,i(t)),l=(e,t)=>{var n={};for(var r in e)o.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&a)for(var r of a(e))t.indexOf(r)<0&&s.call(e,r)&&(n[r]=e[r]);return n};(t=e||(e={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var p=e=>[].concat(...e);import{isPlainObject as f}from"@reduxjs/toolkit";var y=f;function m(e,t){if(e===t||!(y(e)&&y(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const a=Array.isArray(t)?[]:{};for(const r of n)a[r]=m(e[r],t[r]),i&&(i=e[r]===a[r]);return i?e:a}import{isPlainObject as h}from"@reduxjs/toolkit";var g=(...e)=>fetch(...e),v=e=>e.status>=200&&e.status<=299,b=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function q(e){if(!h(e))return e;const t=c({},e);for(const[e,n]of Object.entries(t))void 0===n&&delete t[e];return t}function S(e={}){var t=e,{baseUrl:n,prepareHeaders:r=(e=>e),fetchFn:i=g,paramsSerializer:a,isJsonContentType:o=b,jsonContentType:s="application/json",jsonReplacer:u,timeout:p,responseHandler:f,validateStatus:y}=t,m=l(t,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return"undefined"==typeof fetch&&i===g&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(e,t)=>{const{signal:g,getState:b,extra:R,endpoint:O,forced:T,type:w}=t;let j,A="string"==typeof e?{url:e}:e,{url:k,headers:x=new Headers(m.headers),params:Q,responseHandler:I=(null!=f?f:"json"),validateStatus:C=(null!=y?y:v),timeout:P=p}=A,M=l(A,["url","headers","params","responseHandler","validateStatus","timeout"]),D=c(d(c({},m),{signal:g}),M);x=new Headers(q(x)),D.headers=await r(x,{getState:b,extra:R,endpoint:O,forced:T,type:w})||x;const N=e=>"object"==typeof e&&(h(e)||Array.isArray(e)||"function"==typeof e.toJSON);if(!D.headers.has("content-type")&&N(D.body)&&D.headers.set("content-type",s),N(D.body)&&o(D.headers)&&(D.body=JSON.stringify(D.body,u)),Q){const e=~k.indexOf("?")?"&":"?";k+=e+(a?a(Q):new URLSearchParams(q(Q)))}k=function(e,t){if(!e)return t;if(!t)return e;if(function(e){return new RegExp("(^|:)//").test(e)}(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=(e=>e.replace(/\/$/,""))(e),`${e}${n}${t=(e=>e.replace(/^\//,""))(t)}`}(n,k);const K=new Request(k,D);j={request:new Request(k,D)};let E,F=!1,z=P&&setTimeout((()=>{F=!0,t.abort()}),P);try{E=await i(K)}catch(e){return{error:{status:F?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(e)},meta:j}}finally{z&&clearTimeout(z)}const _=E.clone();let $;j.response=_;let U="";try{let e;if(await Promise.all([S(E,I).then((e=>$=e),(t=>e=t)),_.text().then((e=>U=e),(()=>{}))]),e)throw e}catch(e){return{error:{status:"PARSING_ERROR",originalStatus:E.status,data:U,error:String(e)},meta:j}}return C(E,$)?{data:$,meta:j}:{error:{status:E.status,data:$},meta:j}};async function S(e,t){if("function"==typeof t)return t(e);if("content-type"===t&&(t=o(e.headers)?"json":"text"),"json"===t){const t=await e.text();return t.length?JSON.parse(t):null}return e.text()}}var R=class{constructor(e,t){this.value=e,this.meta=t}};async function O(e=0,t=5){const n=Math.min(e,t),r=~~((Math.random()+.4)*(300<<n));await new Promise((e=>setTimeout((t=>e(t)),r)))}var T={},w=Object.assign(((e,t)=>async(n,r,i)=>{const a=[5,(t||T).maxRetries,(i||T).maxRetries].filter((e=>void 0!==e)),[o]=a.slice(-1),s=c(c({maxRetries:o,backoff:O,retryCondition:(e,t,{attempt:n})=>n<=o},t),i);let u=0;for(;;)try{const t=await e(n,r,i);if(t.error)throw new R(t);return t}catch(e){if(u++,e.throwImmediately){if(e instanceof R)return e.value;throw e}if(e instanceof R&&!s.retryCondition(e.value.error,n,{attempt:u,baseQueryApi:r,extraOptions:i}))return e.value;await s.backoff(u,s.maxRetries)}}),{fail:function(e){throw Object.assign(new R({error:e}),{throwImmediately:!0})}});import{createAction as j}from"@reduxjs/toolkit";var A,k,x=j("__rtkq/focused"),Q=j("__rtkq/unfocused"),I=j("__rtkq/online"),C=j("__rtkq/offline"),P=!1;function M(e,t){return t?t(e,{onFocus:x,onFocusLost:Q,onOffline:C,onOnline:I}):function(){const t=()=>e(x()),n=()=>e(I()),r=()=>e(C()),i=()=>{"visible"===window.document.visibilityState?t():e(Q())};return P||"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("visibilitychange",i,!1),window.addEventListener("focus",t,!1),window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),P=!0),()=>{window.removeEventListener("focus",t),window.removeEventListener("visibilitychange",i),window.removeEventListener("online",n),window.removeEventListener("offline",r),P=!1}}()}import{createNextState as D,createSelector as N}from"@reduxjs/toolkit";function K(e){return e.type===A.query}function E(e,t,n,r,i,a){return"function"==typeof e?e(t,n,r,i).map(F).map(a):Array.isArray(e)?e.map(F).map(a):[]}function F(e){return"string"==typeof e?{type:e}:e}(k=A||(A={})).query="query",k.mutation="mutation";import{combineReducers as z,createAction as _,createSlice as $,isAnyOf as U,isFulfilled as L,isRejectedWithValue as W,createNextState as B,prepareAutoBatched as J}from"@reduxjs/toolkit";function H(e){return null!=e}var V=Symbol("forceQueryFn"),G=e=>"function"==typeof e[V];import{isAllOf as Y,isFulfilled as X,isPending as Z,isRejected as ee,isRejectedWithValue as te}from"@reduxjs/toolkit";import{isDraftable as ne,produceWithPatches as re}from"immer";import{createAsyncThunk as ie,SHOULD_AUTOBATCH as ae}from"@reduxjs/toolkit";function oe(e){return e}function se(e,t,n,r){return E(n[e.meta.arg.endpointName][t],X(e)?e.payload:void 0,te(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}import{isDraft as ue}from"immer";import{applyPatches as ce,original as de}from"immer";function le(e,t,n){const r=e[t];r&&n(r)}function pe(e){var t;return null!=(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)?t:e.requestId}function fe(e,t,n){const r=e[pe(t)];r&&n(r)}var ye={},me=Symbol.for("RTKQ/skipToken"),he=me,ge={status:e.uninitialized},ve=D(ge,(()=>{})),be=D(ge,(()=>{}));import{isPlainObject as qe}from"@reduxjs/toolkit";var Se=WeakMap?new WeakMap:void 0,Re=({endpointName:e,queryArgs:t})=>{let n="";const r=null==Se?void 0:Se.get(t);if("string"==typeof r)n=r;else{const e=JSON.stringify(t,((e,t)=>qe(t)?Object.keys(t).sort().reduce(((e,n)=>(e[n]=t[n],e)),{}):t));qe(t)&&(null==Se||Se.set(t,e)),n=e}return`${e}(${n})`};import{nanoid as Oe}from"@reduxjs/toolkit";import{defaultMemoize as Te}from"reselect";function we(...e){return function(t){const n=Te((e=>{var n,r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:null!=(n=t.reducerPath)?n:"api"})})),r=d(c({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{extractRehydrationInfo:n,serializeQueryArgs(e){let n=Re;if("serializeQueryArgs"in e.endpointDefinition){const t=e.endpointDefinition.serializeQueryArgs;n=e=>{const n=t(e);return"string"==typeof n?n:Re(d(c({},e),{queryArgs:n}))}}else t.serializeQueryArgs&&(n=t.serializeQueryArgs);return n(e)},tagTypes:[...t.tagTypes||[]]}),i={endpointDefinitions:{},batch(e){e()},apiUid:Oe(),extractRehydrationInfo:n,hasRehydrationInfo:Te((e=>null!=n(e)))},a={injectEndpoints:function(e){const t=e.endpoints({query:e=>d(c({},e),{type:A.query}),mutation:e=>d(c({},e),{type:A.mutation})});for(const[n,r]of Object.entries(t))if(e.overrideExisting||!(n in i.endpointDefinitions)){i.endpointDefinitions[n]=r;for(const e of o)e.injectEndpoint(n,r)}return a},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(const t of e)r.tagTypes.includes(t)||r.tagTypes.push(t);if(t)for(const[e,n]of Object.entries(t))"function"==typeof n?n(i.endpointDefinitions[e]):Object.assign(i.endpointDefinitions[e]||{},n);return a}},o=e.map((e=>e.init(a,r,i)));return a.injectEndpoints({endpoints:t.endpoints})}}function je(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}import{createAction as Ae}from"@reduxjs/toolkit";var ke=({reducerPath:e,api:t,context:n,internalState:r})=>{const{removeQueryResult:i,unsubscribeQueryResult:a}=t.internalActions;function o(e){const t=r.currentSubscriptions[e];return!!t&&!function(e){for(let t in e)return!1;return!0}(t)}const s={};function u(e,t,r,a){var u;const c=n.endpointDefinitions[t],d=null!=(u=null==c?void 0:c.keepUnusedDataFor)?u:a.keepUnusedDataFor;if(Infinity===d)return;const l=Math.max(0,Math.min(d,2147482.647));if(!o(e)){const t=s[e];t&&clearTimeout(t),s[e]=setTimeout((()=>{o(e)||r.dispatch(i({queryCacheKey:e})),delete s[e]}),1e3*l)}}return(r,i,o)=>{var c;if(a.match(r)){const t=i.getState()[e],{queryCacheKey:n}=r.payload;u(n,null==(c=t.queries[n])?void 0:c.endpointName,i,t.config)}if(t.util.resetApiState.match(r))for(const[e,t]of Object.entries(s))t&&clearTimeout(t),delete s[e];if(n.hasRehydrationInfo(r)){const t=i.getState()[e],{queries:a}=n.extractRehydrationInfo(r);for(const[e,n]of Object.entries(a))u(e,null==n?void 0:n.endpointName,i,t.config)}}};import{isAnyOf as xe,isFulfilled as Qe,isRejectedWithValue as Ie}from"@reduxjs/toolkit";var Ce=({reducerPath:t,context:n,context:{endpointDefinitions:r},mutationThunk:i,api:a,assertTagType:o,refetchQuery:s})=>{const{removeQueryResult:u}=a.internalActions,c=xe(Qe(i),Ie(i));function d(r,i){const o=i.getState(),c=o[t],d=a.util.selectInvalidatedBy(o,r);n.batch((()=>{var t;const n=Array.from(d.values());for(const{queryCacheKey:r}of n){const n=c.queries[r],a=null!=(t=c.subscriptions[r])?t:{};n&&(0===Object.keys(a).length?i.dispatch(u({queryCacheKey:r})):n.status!==e.uninitialized&&i.dispatch(s(n,r)))}}))}return(e,t)=>{c(e)&&d(se(e,"invalidatesTags",r,o),t),a.util.invalidateTags.match(e)&&d(E(e.payload,void 0,void 0,void 0,void 0,o),t)}},Pe=({reducerPath:t,queryThunk:n,api:r,refetchQuery:i,internalState:a})=>{const o={};function s({queryCacheKey:n},r){const s=r.getState()[t].queries[n];if(!s||s.status===e.uninitialized)return;const u=d(a.currentSubscriptions[n]);if(!Number.isFinite(u))return;const c=o[n];(null==c?void 0:c.timeout)&&(clearTimeout(c.timeout),c.timeout=void 0);const l=Date.now()+u,p=o[n]={nextPollTimestamp:l,pollingInterval:u,timeout:setTimeout((()=>{p.timeout=void 0,r.dispatch(i(s,n))}),u)}}function u({queryCacheKey:n},r){const i=r.getState()[t].queries[n];if(!i||i.status===e.uninitialized)return;const u=d(a.currentSubscriptions[n]);if(!Number.isFinite(u))return void c(n);const l=o[n],p=Date.now()+u;(!l||p<l.nextPollTimestamp)&&s({queryCacheKey:n},r)}function c(e){const t=o[e];(null==t?void 0:t.timeout)&&clearTimeout(t.timeout),delete o[e]}function d(e={}){let t=Number.POSITIVE_INFINITY;for(let n in e)e[n].pollingInterval&&(t=Math.min(e[n].pollingInterval,t));return t}return(e,t)=>{(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&u(e.payload,t),(n.pending.match(e)||n.rejected.match(e)&&e.meta.condition)&&u(e.meta.arg,t),(n.fulfilled.match(e)||n.rejected.match(e)&&!e.meta.condition)&&s(e.meta.arg,t),r.util.resetApiState.match(e)&&function(){for(const e of Object.keys(o))c(e)}()}};import{isAsyncThunkAction as Me,isFulfilled as De}from"@reduxjs/toolkit";var Ne=new Error("Promise never resolved before cacheEntryRemoved."),Ke=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i})=>{const a=Me(r),o=Me(i),s=De(r,i),u={};function l(t,r,i,a,o){const s=n.endpointDefinitions[t],l=null==s?void 0:s.onCacheEntryAdded;if(!l)return;let p={};const f=new Promise((e=>{p.cacheEntryRemoved=e})),y=Promise.race([new Promise((e=>{p.valueResolved=e})),f.then((()=>{throw Ne}))]);y.catch((()=>{})),u[i]=p;const m=e.endpoints[t].select(s.type===A.query?r:i),h=a.dispatch(((e,t,n)=>n)),g=d(c({},a),{getCacheEntry:()=>m(a.getState()),requestId:o,extra:h,updateCachedData:s.type===A.query?n=>a.dispatch(e.util.updateQueryData(t,r,n)):void 0,cacheDataLoaded:y,cacheEntryRemoved:f}),v=l(r,g);Promise.resolve(v).catch((e=>{if(e!==Ne)throw e}))}return(n,c,d)=>{const p=function(t){return a(t)?t.meta.arg.queryCacheKey:o(t)?t.meta.requestId:e.internalActions.removeQueryResult.match(t)?t.payload.queryCacheKey:e.internalActions.removeMutationResult.match(t)?pe(t.payload):""}(n);if(r.pending.match(n)){const e=d[t].queries[p],r=c.getState()[t].queries[p];!e&&r&&l(n.meta.arg.endpointName,n.meta.arg.originalArgs,p,c,n.meta.requestId)}else if(i.pending.match(n))c.getState()[t].mutations[p]&&l(n.meta.arg.endpointName,n.meta.arg.originalArgs,p,c,n.meta.requestId);else if(s(n)){const e=u[p];(null==e?void 0:e.valueResolved)&&(e.valueResolved({data:n.payload,meta:n.meta.baseQueryMeta}),delete e.valueResolved)}else if(e.internalActions.removeQueryResult.match(n)||e.internalActions.removeMutationResult.match(n)){const e=u[p];e&&(delete u[p],e.cacheEntryRemoved())}else if(e.util.resetApiState.match(n))for(const[e,t]of Object.entries(u))delete u[e],t.cacheEntryRemoved()}};import{isPending as Ee,isRejected as Fe,isFulfilled as ze}from"@reduxjs/toolkit";var _e,$e=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Ee(n,r),a=Fe(n,r),o=ze(n,r),s={};return(n,r)=>{var u,l,p;if(i(n)){const{requestId:i,arg:{endpointName:a,originalArgs:o}}=n.meta,u=t.endpointDefinitions[a],l=null==u?void 0:u.onQueryStarted;if(l){const t={},n=new Promise(((e,n)=>{t.resolve=e,t.reject=n}));n.catch((()=>{})),s[i]=t;const p=e.endpoints[a].select(u.type===A.query?o:i),f=r.dispatch(((e,t,n)=>n)),y=d(c({},r),{getCacheEntry:()=>p(r.getState()),requestId:i,extra:f,updateCachedData:u.type===A.query?t=>r.dispatch(e.util.updateQueryData(a,o,t)):void 0,queryFulfilled:n});l(o,y)}}else if(o(n)){const{requestId:e,baseQueryMeta:t}=n.meta;null==(u=s[e])||u.resolve({data:n.payload,meta:t}),delete s[e]}else if(a(n)){const{requestId:e,rejectedWithValue:t,baseQueryMeta:r}=n.meta;null==(p=s[e])||p.reject({error:null!=(l=n.payload)?l:n.error,isUnhandledError:!t,meta:r}),delete s[e]}}},Ue=({api:e,context:{apiUid:t}})=>(n,r)=>{e.util.resetApiState.match(n)&&r.dispatch(e.internalActions.middlewareRegistered(t))};import{produceWithPatches as Le}from"immer";var We="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):e=>(_e||(_e=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)));function Be(e,...t){Object.assign(e,...t)}import{enablePatches as Je}from"immer";var He=Symbol(),Ve=()=>({name:He,init(t,{baseQuery:n,reducerPath:r,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:o,refetchOnFocus:s,refetchOnReconnect:u},l){Je();const f=e=>e;Object.assign(t,{reducerPath:r,endpoints:{},internalActions:{onOnline:I,onOffline:C,onFocus:x,onFocusLost:Q},util:{}});const{queryThunk:y,mutationThunk:h,patchQueryData:g,updateQueryData:v,upsertQueryData:b,prefetch:q,buildMatchThunkActions:S}=function({reducerPath:t,baseQuery:n,context:{endpointDefinitions:r},serializeQueryArgs:i,api:a,assertTagType:o}){const s=async(e,{signal:t,abort:i,rejectWithValue:a,fulfillWithValue:o,dispatch:s,getState:c,extra:d})=>{const l=r[e.endpointName];try{let r,a=oe;const p={signal:t,abort:i,dispatch:s,getState:c,extra:d,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?u(e,c()):void 0},f="query"===e.type?e[V]:void 0;if(f?r=f():l.query?(r=await n(l.query(e.originalArgs),p,l.extraOptions),l.transformResponse&&(a=l.transformResponse)):r=await l.queryFn(e.originalArgs,p,l.extraOptions,(e=>n(e,p,l.extraOptions))),r.error)throw new R(r.error,r.meta);return o(await a(r.data,r.meta,e.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:r.meta,[ae]:!0})}catch(t){let n=t;if(n instanceof R){let t=oe;l.query&&l.transformErrorResponse&&(t=l.transformErrorResponse);try{return a(await t(n.value,n.meta,e.originalArgs),{baseQueryMeta:n.meta,[ae]:!0})}catch(e){n=e}}throw console.error(n),n}};function u(e,n){var r,i,a,o;const s=null==(i=null==(r=n[t])?void 0:r.queries)?void 0:i[e.queryCacheKey],u=null==(a=n[t])?void 0:a.config.refetchOnMountOrArgChange,c=null==s?void 0:s.fulfilledTimeStamp,d=null!=(o=e.forceRefetch)?o:e.subscribe&&u;return!!d&&(!0===d||(Number(new Date)-Number(c))/1e3>=d)}function c(e){return t=>{var n,r;return(null==(r=null==(n=null==t?void 0:t.meta)?void 0:n.arg)?void 0:r.endpointName)===e}}return{queryThunk:ie(`${t}/executeQuery`,s,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[ae]:!0}),condition(e,{getState:n}){var i,a,o;const s=n(),c=null==(a=null==(i=s[t])?void 0:i.queries)?void 0:a[e.queryCacheKey],d=null==c?void 0:c.fulfilledTimeStamp,l=e.originalArgs,p=null==c?void 0:c.originalArgs,f=r[e.endpointName];return!(!G(e)&&("pending"===(null==c?void 0:c.status)||!u(e,s)&&(!K(f)||!(null==(o=null==f?void 0:f.forceRefetch)?void 0:o.call(f,{currentArg:l,previousArg:p,endpointState:c,state:s})))&&d))},dispatchConditionRejection:!0}),mutationThunk:ie(`${t}/executeMutation`,s,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[ae]:!0})}),prefetch:(e,t,n)=>(r,i)=>{const o=(e=>"force"in e)(n)&&n.force,s=(e=>"ifOlderThan"in e)(n)&&n.ifOlderThan,u=(n=!0)=>a.endpoints[e].initiate(t,{forceRefetch:n}),c=a.endpoints[e].select(t)(i());if(o)r(u());else if(s){const e=null==c?void 0:c.fulfilledTimeStamp;if(!e)return void r(u());(Number(new Date)-Number(new Date(e)))/1e3>=s&&r(u())}else r(u(!1))},updateQueryData:(t,n,r,i=!0)=>(o,s)=>{const u=a.endpoints[t].select(n)(s());let c,d={patches:[],inversePatches:[],undo:()=>o(a.util.patchQueryData(t,n,d.inversePatches,i))};if(u.status===e.uninitialized)return d;if("data"in u)if(ne(u.data)){const[e,t,n]=re(u.data,r);d.patches.push(...t),d.inversePatches.push(...n),c=e}else c=r(u.data),d.patches.push({op:"replace",path:[],value:c}),d.inversePatches.push({op:"replace",path:[],value:u.data});return o(a.util.patchQueryData(t,n,d.patches,i)),d},upsertQueryData:(e,t,n)=>r=>r(a.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[V]:()=>({data:n})})),patchQueryData:(e,t,n,s)=>(u,c)=>{const d=r[e],l=i({queryArgs:t,endpointDefinition:d,endpointName:e});if(u(a.internalActions.queryResultPatched({queryCacheKey:l,patches:n})),!s)return;const p=a.endpoints[e].select(t)(c()),f=E(d.providesTags,p.data,void 0,t,{},o);u(a.internalActions.updateProvidedBy({queryCacheKey:l,providedTags:f}))},buildMatchThunkActions:function(e,t){return{matchPending:Y(Z(e),c(t)),matchFulfilled:Y(X(e),c(t)),matchRejected:Y(ee(e),c(t))}}}}({baseQuery:n,reducerPath:r,context:l,api:t,serializeQueryArgs:i,assertTagType:f}),{reducer:O,actions:T}=function({reducerPath:t,queryThunk:n,mutationThunk:r,context:{endpointDefinitions:i,apiUid:a,extractRehydrationInfo:o,hasRehydrationInfo:s},assertTagType:u,config:l}){const p=_(`${t}/resetApiState`),f=$({name:`${t}/queries`,initialState:ye,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:J()},queryResultPatched:{reducer(e,{payload:{queryCacheKey:t,patches:n}}){le(e,t,(e=>{e.data=ce(e.data,n.concat())}))},prepare:J()}},extraReducers(t){t.addCase(n.pending,((t,{meta:n,meta:{arg:r}})=>{var i;const a=G(r);(r.subscribe||a)&&(null!=t[i=r.queryCacheKey]||(t[i]={status:e.uninitialized,endpointName:r.endpointName})),le(t,r.queryCacheKey,(t=>{t.status=e.pending,t.requestId=a&&t.requestId?t.requestId:n.requestId,void 0!==r.originalArgs&&(t.originalArgs=r.originalArgs),t.startedTimeStamp=n.startedTimeStamp}))})).addCase(n.fulfilled,((t,{meta:n,payload:r})=>{le(t,n.arg.queryCacheKey,(t=>{var a;if(t.requestId!==n.requestId&&!G(n.arg))return;const{merge:o}=i[n.arg.endpointName];if(t.status=e.fulfilled,o)if(void 0!==t.data){const{fulfilledTimeStamp:e,arg:i,baseQueryMeta:a,requestId:s}=n;let u=B(t.data,(t=>o(t,r,{arg:i.originalArgs,baseQueryMeta:a,fulfilledTimeStamp:e,requestId:s})));t.data=u}else t.data=r;else t.data=null==(a=i[n.arg.endpointName].structuralSharing)||a?m(ue(t.data)?de(t.data):t.data,r):r;delete t.error,t.fulfilledTimeStamp=n.fulfilledTimeStamp}))})).addCase(n.rejected,((t,{meta:{condition:n,arg:r,requestId:i},error:a,payload:o})=>{le(t,r.queryCacheKey,(t=>{if(n);else{if(t.requestId!==i)return;t.status=e.rejected,t.error=null!=o?o:a}}))})).addMatcher(s,((t,n)=>{const{queries:r}=o(n);for(const[n,i]of Object.entries(r))(null==i?void 0:i.status)!==e.fulfilled&&(null==i?void 0:i.status)!==e.rejected||(t[n]=i)}))}}),y=$({name:`${t}/mutations`,initialState:ye,reducers:{removeMutationResult:{reducer(e,{payload:t}){const n=pe(t);n in e&&delete e[n]},prepare:J()}},extraReducers(t){t.addCase(r.pending,((t,{meta:n,meta:{requestId:r,arg:i,startedTimeStamp:a}})=>{i.track&&(t[pe(n)]={requestId:r,status:e.pending,endpointName:i.endpointName,startedTimeStamp:a})})).addCase(r.fulfilled,((t,{payload:n,meta:r})=>{r.arg.track&&fe(t,r,(t=>{t.requestId===r.requestId&&(t.status=e.fulfilled,t.data=n,t.fulfilledTimeStamp=r.fulfilledTimeStamp)}))})).addCase(r.rejected,((t,{payload:n,error:r,meta:i})=>{i.arg.track&&fe(t,i,(t=>{t.requestId===i.requestId&&(t.status=e.rejected,t.error=null!=n?n:r)}))})).addMatcher(s,((t,n)=>{const{mutations:r}=o(n);for(const[n,i]of Object.entries(r))(null==i?void 0:i.status)!==e.fulfilled&&(null==i?void 0:i.status)!==e.rejected||n===(null==i?void 0:i.requestId)||(t[n]=i)}))}}),h=$({name:`${t}/invalidation`,initialState:ye,reducers:{updateProvidedBy:{reducer(e,t){var n,r,i,a;const{queryCacheKey:o,providedTags:s}=t.payload;for(const t of Object.values(e))for(const e of Object.values(t)){const t=e.indexOf(o);-1!==t&&e.splice(t,1)}for(const{type:t,id:u}of s){const s=null!=(a=(r=null!=(n=e[t])?n:e[t]={})[i=u||"__internal_without_id"])?a:r[i]=[];s.includes(o)||s.push(o)}},prepare:J()}},extraReducers(e){e.addCase(f.actions.removeQueryResult,((e,{payload:{queryCacheKey:t}})=>{for(const n of Object.values(e))for(const e of Object.values(n)){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}})).addMatcher(s,((e,t)=>{var n,r,i,a;const{provided:s}=o(t);for(const[t,o]of Object.entries(s))for(const[s,u]of Object.entries(o)){const o=null!=(a=(r=null!=(n=e[t])?n:e[t]={})[i=s||"__internal_without_id"])?a:r[i]=[];for(const e of u)o.includes(e)||o.push(e)}})).addMatcher(U(L(n),W(n)),((e,t)=>{const n=se(t,"providesTags",i,u),{queryCacheKey:r}=t.meta.arg;h.caseReducers.updateProvidedBy(e,h.actions.updateProvidedBy({queryCacheKey:r,providedTags:n}))}))}}),g=$({name:`${t}/subscriptions`,initialState:ye,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_probeSubscription(e,t){}}}),v=$({name:`${t}/internalSubscriptions`,initialState:ye,reducers:{subscriptionsUpdated:{reducer:(e,t)=>ce(e,t.payload),prepare:J()}}}),b=$({name:`${t}/config`,initialState:c({online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1},l),reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&a===t||"conflict"}},extraReducers:e=>{e.addCase(I,(e=>{e.online=!0})).addCase(C,(e=>{e.online=!1})).addCase(x,(e=>{e.focused=!0})).addCase(Q,(e=>{e.focused=!1})).addMatcher(s,(e=>c({},e)))}}),q=z({queries:f.reducer,mutations:y.reducer,provided:h.reducer,subscriptions:v.reducer,config:b.reducer});return{reducer:(e,t)=>q(p.match(t)?void 0:e,t),actions:d(c(c(c(c(c(c({},b.actions),f.actions),g.actions),v.actions),y.actions),h.actions),{unsubscribeMutationResult:y.actions.removeMutationResult,resetApiState:p})}}({context:l,queryThunk:y,mutationThunk:h,reducerPath:r,assertTagType:f,config:{refetchOnFocus:s,refetchOnReconnect:u,refetchOnMountOrArgChange:o,keepUnusedDataFor:a,reducerPath:r}});Be(t.util,{patchQueryData:g,updateQueryData:v,upsertQueryData:b,prefetch:q,resetApiState:T.resetApiState}),Be(t.internalActions,T);const{middleware:w,actions:j}=function(t){const{reducerPath:n,queryThunk:r,api:i,context:a}=t,{apiUid:o}=a,s={invalidateTags:Ae(`${n}/invalidateTags`)},u=[Ue,ke,Ce,Pe,Ke,$e];return{middleware:r=>{let s=!1;const p=d(c({},t),{internalState:{currentSubscriptions:{}},refetchQuery:l}),f=u.map((e=>e(p))),y=(({api:e,queryThunk:t,internalState:n})=>{const r=`${e.reducerPath}/subscriptions`;let i=null,a=!1;const{updateSubscriptionOptions:o,unsubscribeQueryResult:s}=e.internalActions;return(u,c)=>{var d,l;if(i||(i=JSON.parse(JSON.stringify(n.currentSubscriptions))),e.util.resetApiState.match(u))return i=n.currentSubscriptions={},[!0,!1];if(e.internalActions.internal_probeSubscription.match(u)){const{queryCacheKey:e,requestId:t}=u.payload;return[!1,!!(null==(d=n.currentSubscriptions[e])?void 0:d[t])]}const p=((n,r)=>{var i,a,u,c,d,l,p,f,y;if(o.match(r)){const{queryCacheKey:e,requestId:t,options:a}=r.payload;return(null==(i=null==n?void 0:n[e])?void 0:i[t])&&(n[e][t]=a),!0}if(s.match(r)){const{queryCacheKey:e,requestId:t}=r.payload;return n[e]&&delete n[e][t],!0}if(e.internalActions.removeQueryResult.match(r))return delete n[r.payload.queryCacheKey],!0;if(t.pending.match(r)){const{meta:{arg:e,requestId:t}}=r;if(e.subscribe){const r=null!=(u=n[a=e.queryCacheKey])?u:n[a]={};return r[t]=null!=(d=null!=(c=e.subscriptionOptions)?c:r[t])?d:{},!0}}if(t.rejected.match(r)){const{meta:{condition:e,arg:t,requestId:i}}=r;if(e&&t.subscribe){const e=null!=(p=n[l=t.queryCacheKey])?p:n[l]={};return e[i]=null!=(y=null!=(f=t.subscriptionOptions)?f:e[i])?y:{},!0}}return!1})(n.currentSubscriptions,u);if(p){a||(We((()=>{const t=JSON.parse(JSON.stringify(n.currentSubscriptions)),[,r]=Le(i,(()=>t));c.next(e.internalActions.subscriptionsUpdated(r)),i=t,a=!1})),a=!0);const o=!!(null==(l=u.type)?void 0:l.startsWith(r)),s=t.rejected.match(u)&&u.meta.condition&&!!u.meta.arg.subscribe;return[!o&&!s,!1]}return[!0,!1]}})(p),m=(({reducerPath:t,context:n,api:r,refetchQuery:i,internalState:a})=>{const{removeQueryResult:o}=r.internalActions;function s(r,s){const u=r.getState()[t],c=u.queries,d=a.currentSubscriptions;n.batch((()=>{for(const t of Object.keys(d)){const n=c[t],a=d[t];a&&n&&(Object.values(a).some((e=>!0===e[s]))||Object.values(a).every((e=>void 0===e[s]))&&u.config[s])&&(0===Object.keys(a).length?r.dispatch(o({queryCacheKey:t})):n.status!==e.uninitialized&&r.dispatch(i(n,t)))}}))}return(e,t)=>{x.match(e)&&s(t,"refetchOnFocus"),I.match(e)&&s(t,"refetchOnReconnect")}})(p);return e=>t=>{s||(s=!0,r.dispatch(i.internalActions.middlewareRegistered(o)));const u=d(c({},r),{next:e}),l=r.getState(),[p,h]=y(t,u,l);let g;if(g=p?e(t):h,r.getState()[n]&&(m(t,u,l),(e=>!!e&&"string"==typeof e.type&&e.type.startsWith(`${n}/`))(t)||a.hasRehydrationInfo(t)))for(let e of f)e(t,u,l);return g}},actions:s};function l(e,t,n={}){return r(c({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},n))}}({reducerPath:r,context:l,queryThunk:y,mutationThunk:h,api:t,assertTagType:f});Be(t.util,j),Be(t,{reducer:O,middleware:w});const{buildQuerySelector:k,buildMutationSelector:P,selectInvalidatedBy:M}=function({serializeQueryArgs:t,reducerPath:n}){const r=e=>ve,i=e=>be;return{buildQuerySelector:function(e,n){return i=>{const s=t({queryArgs:i,endpointDefinition:n,endpointName:e});return N(i===me?r:e=>{var t,n,r;return null!=(r=null==(n=null==(t=o(e))?void 0:t.queries)?void 0:n[s])?r:ve},a)}},buildMutationSelector:function(){return e=>{var t;let n;return n="object"==typeof e?null!=(t=pe(e))?t:me:e,N(n===me?i:e=>{var t,r,i;return null!=(i=null==(r=null==(t=o(e))?void 0:t.mutations)?void 0:r[n])?i:be},a)}},selectInvalidatedBy:function(e,t){var r;const i=e[n],a=new Set;for(const e of t.map(F)){const t=i.provided[e.type];if(!t)continue;let n=null!=(r=void 0!==e.id?t[e.id]:p(Object.values(t)))?r:[];for(const e of n)a.add(e)}return p(Array.from(a.values()).map((e=>{const t=i.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))}};function a(t){return c(c({},t),{status:n=t.status,isUninitialized:n===e.uninitialized,isLoading:n===e.pending,isSuccess:n===e.fulfilled,isError:n===e.rejected});var n}function o(e){return e[n]}}({serializeQueryArgs:i,reducerPath:r});Be(t.util,{selectInvalidatedBy:M});const{buildInitiateQuery:D,buildInitiateMutation:te,getRunningMutationThunk:he,getRunningMutationsThunk:ge,getRunningQueriesThunk:qe,getRunningQueryThunk:Se,getRunningOperationPromises:Re,removalWarning:Oe}=function({serializeQueryArgs:e,queryThunk:t,mutationThunk:n,api:r,context:i}){const a=new Map,o=new Map,{unsubscribeQueryResult:s,removeMutationResult:u,updateSubscriptionOptions:c}=r.internalActions;return{buildInitiateQuery:function(n,i){const o=(u,{subscribe:d=!0,forceRefetch:l,subscriptionOptions:p,[V]:f}={})=>(y,m)=>{var h;const g=e({queryArgs:u,endpointDefinition:i,endpointName:n}),v=t({type:"query",subscribe:d,forceRefetch:l,subscriptionOptions:p,endpointName:n,originalArgs:u,queryCacheKey:g,[V]:f}),b=r.endpoints[n].select(u),q=y(v),S=b(m()),{requestId:R,abort:O}=q,T=S.requestId!==R,w=null==(h=a.get(y))?void 0:h[g],j=()=>b(m()),A=Object.assign(f?q.then(j):T&&!w?Promise.resolve(S):Promise.all([w,q]).then(j),{arg:u,requestId:R,subscriptionOptions:p,queryCacheKey:g,abort:O,async unwrap(){const e=await A;if(e.isError)throw e.error;return e.data},refetch:()=>y(o(u,{subscribe:!1,forceRefetch:!0})),unsubscribe(){d&&y(s({queryCacheKey:g,requestId:R}))},updateSubscriptionOptions(e){A.subscriptionOptions=e,y(c({endpointName:n,requestId:R,queryCacheKey:g,options:e}))}});if(!w&&!T&&!f){const e=a.get(y)||{};e[g]=A,a.set(y,e),A.then((()=>{delete e[g],Object.keys(e).length||a.delete(y)}))}return A};return o},buildInitiateMutation:function(e){return(t,{track:r=!0,fixedCacheKey:i}={})=>(a,s)=>{const c=n({type:"mutation",endpointName:e,originalArgs:t,track:r,fixedCacheKey:i}),d=a(c),{requestId:l,abort:p,unwrap:f}=d,y=d.unwrap().then((e=>({data:e}))).catch((e=>({error:e}))),m=()=>{a(u({requestId:l,fixedCacheKey:i}))},h=Object.assign(y,{arg:d.arg,requestId:l,abort:p,unwrap:f,unsubscribe:m,reset:m}),g=o.get(a)||{};return o.set(a,g),g[l]=h,h.then((()=>{delete g[l],Object.keys(g).length||o.delete(a)})),i&&(g[i]=h,h.then((()=>{g[i]===h&&(delete g[i],Object.keys(g).length||o.delete(a))}))),h}},getRunningQueryThunk:function(t,n){return r=>{var o;const s=e({queryArgs:n,endpointDefinition:i.endpointDefinitions[t],endpointName:t});return null==(o=a.get(r))?void 0:o[s]}},getRunningMutationThunk:function(e,t){return e=>{var n;return null==(n=o.get(e))?void 0:n[t]}},getRunningQueriesThunk:function(){return e=>Object.values(a.get(e)||{}).filter(H)},getRunningMutationsThunk:function(){return e=>Object.values(o.get(e)||{}).filter(H)},getRunningOperationPromises:function(){{const e=e=>Array.from(e.values()).flatMap((e=>e?Object.values(e):[]));return[...e(a),...e(o)].filter(H)}},removalWarning:function(){throw new Error("This method had to be removed due to a conceptual bug in RTK.\n Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.\n See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.")}}}({queryThunk:y,mutationThunk:h,api:t,serializeQueryArgs:i,context:l});return Be(t.util,{getRunningOperationPromises:Re,getRunningOperationPromise:Oe,getRunningMutationThunk:he,getRunningMutationsThunk:ge,getRunningQueryThunk:Se,getRunningQueriesThunk:qe}),{name:He,injectEndpoint(e,n){var r;const i=t;null!=(r=i.endpoints)[e]||(r[e]={}),K(n)?Be(i.endpoints[e],{name:e,select:k(e,n),initiate:D(e,n)},S(y,e)):n.type===A.mutation&&Be(i.endpoints[e],{name:e,select:P(),initiate:te(e)},S(h,e))}}}}),Ge=we(Ve());export{e as QueryStatus,we as buildCreateApi,m as copyWithStructuralSharing,Ve as coreModule,He as coreModuleName,Ge as createApi,Re as defaultSerializeQueryArgs,je as fakeBaseQuery,S as fetchBaseQuery,w as retry,M as setupListeners,he as skipSelector,me as skipToken}; | ||
//# sourceMappingURL=rtk-query.modern.production.min.js.map |
@@ -7,14 +7,15 @@ (function (global, factory) { | ||
var e;exports.QueryStatus = void 0;var n,r=undefined&&undefined.__extends||(e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);},e(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t;}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r);}),i=undefined&&undefined.__generator||function(e,t){var n,r,i,u,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function o(u){return function(o){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a);}catch(e){u=[6,e],r=0;}finally{n=i=0;}if(5&u[0])throw u[1];return {value:u[0]?u[1]:void 0,done:!0}}([u,o])}}},u=undefined&&undefined.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},a=Object.defineProperty,o=Object.defineProperties,c=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=function(e,t,n){return t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},p=function(e,t){for(var n in t||(t={}))f.call(t,n)&&d(e,n,t[n]);if(s)for(var r=0,i=s(t);r<i.length;r++)l.call(t,n=i[r])&&d(e,n,t[n]);return e},v=function(e,t){return o(e,c(t))},h=function(e,t){var n={};for(var r in e)f.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var i=0,u=s(e);i<u.length;i++)t.indexOf(r=u[i])<0&&l.call(e,r)&&(n[r]=e[r]);return n},y=function(e,t,n){return new Promise((function(r,i){var u=function(e){try{o(n.next(e));}catch(e){i(e);}},a=function(e){try{o(n.throw(e));}catch(e){i(e);}},o=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(u,a)};o((n=n.apply(e,t)).next());}))};(n=exports.QueryStatus||(exports.QueryStatus={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var g,m,b=function(e){return [].concat.apply([],e)};function O(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return "'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function w(e){return !!e&&!!e[ae]}function S(e){var t;return !!e&&(function(e){if(!e||"object"!=typeof e)return !1;var t=Object.getPrototypeOf(e);if(null===t)return !0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===oe}(e)||Array.isArray(e)||!!e[ue]||!!(null===(t=e.constructor)||void 0===t?void 0:t[ue])||k(e)||x(e))}function j(e,t,n){void 0===n&&(n=!1),0===q(e)?(n?Object.keys:ce)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e);})):e.forEach((function(n,r){return t(r,n,e)}));}function q(e){var t=e[ae];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:k(e)?2:x(e)?3:0}function A(e,t){return 2===q(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function P(e,t){return 2===q(e)?e.get(t):e[t]}function R(e,t,n){var r=q(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n;}function T(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function k(e){return te&&e instanceof Map}function x(e){return ne&&e instanceof Set}function I(e){return e.o||e.t}function C(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=se(e);delete t[ae];for(var n=ce(t),r=0;r<n.length;r++){var i=n[r],u=t[i];!1===u.writable&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(t[i]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[i]});}return Object.create(Object.getPrototypeOf(e),t)}function E(e,t){return void 0===t&&(t=!1),N(e)||w(e)||!S(e)||(q(e)>1&&(e.set=e.add=e.clear=e.delete=D),Object.freeze(e),t&&j(e,(function(e,t){return E(t,!0)}),!0)),e}function D(){O(2);}function N(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Q(e){var t=fe[e];return t||O(18,e),t}function M(e,t){fe[e]||(fe[e]=t);}function _(){return m}function K(e,t){t&&(Q("Patches"),e.u=[],e.s=[],e.v=t);}function F(e){z(e),e.p.forEach(W),e.p=null;}function z(e){e===m&&(m=e.l);}function U(e){return m={p:[],l:m,h:e,m:!0,_:0}}function W(e){var t=e[ae];0===t.i||1===t.i?t.j():t.O=!0;}function L(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||Q("ES5").S(t,e,r),r?(n[ae].P&&(F(t),O(4)),S(e)&&(e=B(t,e),t.l||V(t,e)),t.u&&Q("Patches").M(n[ae].t,e,t.u,t.s)):e=B(t,n,[]),F(t),t.u&&t.v(t.u,t.s),e!==ie?e:void 0}function B(e,t,n){if(N(t))return t;var r=t[ae];if(!r)return j(t,(function(i,u){return J(e,r,t,i,u,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return V(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=C(r.k):r.o;j(3===r.i?new Set(i):i,(function(t,u){return J(e,r,i,t,u,n)})),V(e,i,!1),n&&e.u&&Q("Patches").R(r,n,e.u,e.s);}return r.o}function J(e,t,n,r,i,u){if(w(i)){var a=B(e,i,u&&t&&3!==t.i&&!A(t.D,r)?u.concat(r):void 0);if(R(n,r,a),!w(a))return;e.m=!1;}if(S(i)&&!N(i)){if(!e.h.F&&e._<1)return;B(e,i),t&&t.A.l||V(e,i);}}function V(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&E(t,n);}function H(e,t){var n=e[ae];return (n?I(n):e)[t]}function G(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n);}}function $(e){e.P||(e.P=!0,e.l&&$(e.l));}function X(e){e.o||(e.o=C(e.t));}function Y(e,t,n){var r=k(t)?Q("MapSet").N(t,n):x(t)?Q("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:_(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,u=le;n&&(i=[r],u=de);var a=Proxy.revocable(i,u),o=a.revoke,c=a.proxy;return r.k=c,r.j=o,c}(t,n):Q("ES5").J(t,n);return (n?n.A:_()).p.push(r),r}function Z(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return C(e)}var ee="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),te="undefined"!=typeof Map,ne="undefined"!=typeof Set,re="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,ie=ee?Symbol.for("immer-nothing"):((g={})["immer-nothing"]=!0,g),ue=ee?Symbol.for("immer-draftable"):"__$immer_draftable",ae=ee?Symbol.for("immer-state"):"__$immer_state",oe=(""+Object.prototype.constructor),ce="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,se=Object.getOwnPropertyDescriptors||function(e){var t={};return ce(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n);})),t},fe={},le={get:function(e,t){if(t===ae)return e;var n,r,i,u=I(e);if(!A(u,t))return n=e,(i=G(u,t))?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(n.k):void 0;var a=u[t];return e.I||!S(a)?a:a===H(e.t,t)?(X(e),e.o[t]=Y(e.A.h,a,e)):a},has:function(e,t){return t in I(e)},ownKeys:function(e){return Reflect.ownKeys(I(e))},set:function(e,t,n){var r=G(I(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=H(I(e),t),u=null==i?void 0:i[ae];if(u&&u.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(T(n,i)&&(void 0!==n||A(e.t,t)))return !0;X(e),$(e);}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==H(e.t,t)||t in e.t?(e.D[t]=!1,X(e),$(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=I(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){O(11);},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){O(12);}},de={};j(le,(function(e,t){de[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};})),de.deleteProperty=function(e,t){return de.set.call(this,e,t,void 0)},de.set=function(e,t,n){return le.set.call(this,e[0],t,n,e[0])};var pe=new(function(){function e(e){var t=this;this.g=re,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var i=n;n=e;var u=t;return function(e){var t=this;void 0===e&&(e=i);for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return u.produce(e,(function(e){var r;return (r=n).call.apply(r,[t,e].concat(a))}))}}var a;if("function"!=typeof n&&O(6),void 0!==r&&"function"!=typeof r&&O(7),S(e)){var o=U(t),c=Y(t,e,void 0),s=!0;try{a=n(c),s=!1;}finally{s?F(o):z(o);}return "undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return K(o,r),L(e,o)}),(function(e){throw F(o),e})):(K(o,r),L(a,o))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===ie&&(a=void 0),t.F&&E(a,!0),r){var f=[],l=[];Q("Patches").M(e,a,f,l),r(f,l);}return a}O(21,e);},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,i=Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))};var r,i,u=t.produce(e,n,(function(e,t){r=e,i=t;}));return "undefined"!=typeof Promise&&u instanceof Promise?u.then((function(e){return [e,r,i]})):[u,r,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze);}var t=e.prototype;return t.createDraft=function(e){S(e)||O(8),w(e)&&(e=function(e){return w(e)||O(22,e),function e(t){if(!S(t))return t;var n,r=t[ae],i=q(t);if(r){if(!r.P&&(r.i<4||!Q("ES5").K(r)))return r.t;r.I=!0,n=Z(t,i),r.I=!1;}else n=Z(t,i);return j(n,(function(t,i){r&&P(r.t,t)===i||R(n,t,e(i));})),3===i?new Set(n):n}(e)}(e));var t=U(this),n=Y(this,e,void 0);return n[ae].C=!0,z(t),n},t.finishDraft=function(e,t){var n=(e&&e[ae]).A;return K(n,t),L(void 0,n)},t.setAutoFreeze=function(e){this.F=e;},t.setUseProxies=function(e){e&&!re&&O(20),this.g=e;},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var i=Q("Patches").$;return w(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}()),ve=pe.produce,he=pe.produceWithPatches.bind(pe),ye=(pe.setAutoFreeze.bind(pe),pe.setUseProxies.bind(pe),pe.applyPatches.bind(pe)),ge=(pe.createDraft.bind(pe),pe.finishDraft.bind(pe),ve);function me(e){return "Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var be=function(){return Math.random().toString(36).substring(7).split("").join(".")},Oe={INIT:"@@redux/INIT"+be(),REPLACE:"@@redux/REPLACE"+be(),PROBE_UNKNOWN_ACTION:function(){return "@@redux/PROBE_UNKNOWN_ACTION"+be()}},we=function(e,t){return e===t};function Se(e,t){var n,r,i,u="object"==typeof t?t:{equalityCheck:t},a=u.equalityCheck,o=u.maxSize,c=void 0===o?1:o,s=u.resultEqualityCheck,f=(i=void 0===a?we:a,function(e,t){if(null===e||null===t||e.length!==t.length)return !1;for(var n=e.length,r=0;r<n;r++)if(!i(e[r],t[r]))return !1;return !0}),l=1===c?(n=f,{get:function(e){return r&&n(r.key,e)?r.value:"NOT_FOUND"},put:function(e,t){r={key:e,value:t};},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0;}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var i=n[r];return r>0&&(n.splice(r,1),n.unshift(i)),i.value}return "NOT_FOUND"}return {get:r,put:function(t,i){"NOT_FOUND"===r(t)&&(n.unshift({key:t,value:i}),n.length>e&&n.pop());},getEntries:function(){return n},clear:function(){n=[];}}}(c,f);function d(){var t=l.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),s){var n=l.getEntries(),r=n.find((function(e){return s(e.value,t)}));r&&(t=r.value);}l.put(arguments,t);}return t}return d.clearCache=function(){return l.clear()},d}function je(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return "function"==typeof e}))){var n=t.map((function(e){return "function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function qe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var u,a=0,o={memoizeOptions:void 0},c=r.pop();if("object"==typeof c&&(o=c,c=r.pop()),"function"!=typeof c)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof c+"]");var s=o,f=s.memoizeOptions,l=void 0===f?n:f,d=Array.isArray(l)?l:[l],p=je(r),v=e.apply(void 0,[function(){return a++,c.apply(null,arguments)}].concat(d)),h=e((function(){for(var e=[],t=p.length,n=0;n<t;n++)e.push(p[n].apply(null,arguments));return u=v.apply(null,e)}));return Object.assign(h,{resultFunc:c,memoizedResultFunc:v,dependencies:p,lastResult:function(){return u},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),h};return i}var Ae=qe(Se);function Pe(e){if("object"!=typeof e||null===e)return !1;var t=Object.getPrototypeOf(e);if(null===t)return !0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}function Re(e){return S(e)?ge(e,(function(){})):e}function Te(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return p(p({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return {type:e,payload:n[0]}}return n.toString=function(){return ""+e},n.type=e,n.match=function(t){return t.type===e},n}function ke(e){var t,n={},r=[],i={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=t,i},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return t=e,i}};return e(i),[n,r,t]}function xe(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:Re(e.initialState),i=e.reducers||{},a=Object.keys(i),o={},c={},s={};function f(){var t="function"==typeof e.extraReducers?ke(e.extraReducers):[e.extraReducers],n=t[0],i=t[1],a=void 0===i?[]:i,o=t[2],s=void 0===o?void 0:o,f=p(p({},void 0===n?{}:n),c);return function(e,t,n,r){var i,a=ke(t),o=a[0],c=a[1],s=a[2];if("function"==typeof e)i=function(){return Re(e())};else {var f=Re(e);i=function(){return f};}function l(e,t){void 0===e&&(e=i());var n=u([o[t.type]],c.filter((function(e){return (0, e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return !!e})).length&&(n=[s]),n.reduce((function(e,n){if(n){var r;if(w(e))return void 0===(r=n(e,t))?e:r;if(S(e))return ge(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return l.getInitialState=i,l}(r,(function(e){for(var t in f)e.addCase(t,f[t]);for(var n=0,r=a;n<r.length;n++){var i=r[n];e.addMatcher(i.matcher,i.reducer);}s&&e.addDefaultCase(s);}))}return a.forEach((function(e){var n,r,u=i[e],a=t+"/"+e;"reducer"in u?(n=u.reducer,r=u.prepare):n=u,o[e]=n,c[a]=n,s[e]=r?Te(a,r):Te(a);})),{name:t,reducer:function(e,t){return n||(n=f()),n(e,t)},actions:s,caseReducers:o,getInitialState:function(){return n||(n=f()),n.getInitialState()}}}!function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}r(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,u([void 0],e[0].concat(this)))):new(t.bind.apply(t,u([void 0],e.concat(this))))};}(Array);var Ie=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},Ce=["name","message","stack","code"],Ee=function(e,t){this.payload=e,this.meta=t;},De=function(e,t){this.payload=e,this.meta=t;},Ne=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Ce;n<r.length;n++){var i=r[n];"string"==typeof e[i]&&(t[i]=e[i]);}return t}return {message:String(e)}},Qe=function(){function e(e,t,n){var r=Te(e+"/fulfilled",(function(e,t,n,r){return {payload:e,meta:v(p({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),u=Te(e+"/pending",(function(e,t,n){return {payload:void 0,meta:v(p({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),a=Te(e+"/rejected",(function(e,t,r,i,u){return {payload:i,error:(n&&n.serializeError||Ne)(e||"Rejected"),meta:v(p({},u||{}),{arg:r,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),o="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return !1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}};}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(c,s,f){var l,d=(null==n?void 0:n.idGenerator)?n.idGenerator(e):Ie(),p=new o;function v(e){l=e,p.abort();}var h=function(){return y(this,null,(function(){var o,h,y,g,m,b;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),null===(O=g=null==(o=null==n?void 0:n.condition)?void 0:o.call(n,e,{getState:s,extra:f}))||"object"!=typeof O||"function"!=typeof O.then?[3,2]:[4,g];case 1:g=i.sent(),i.label=2;case 2:if(!1===g||p.signal.aborted)throw {name:"ConditionError",message:"Aborted due to condition callback returning false."};return m=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:l||"Aborted"})}))})),c(u(d,e,null==(h=null==n?void 0:n.getPendingMeta)?void 0:h.call(n,{requestId:d,arg:e},{getState:s,extra:f}))),[4,Promise.race([m,Promise.resolve(t(e,{dispatch:c,getState:s,extra:f,requestId:d,signal:p.signal,abort:v,rejectWithValue:function(e,t){return new Ee(e,t)},fulfillWithValue:function(e,t){return new De(e,t)}})).then((function(t){if(t instanceof Ee)throw t;return t instanceof De?r(t.payload,d,e,t.meta):r(t,d,e)}))])];case 3:return y=i.sent(),[3,5];case 4:return b=i.sent(),y=b instanceof Ee?a(null,d,e,b.payload,b.meta):a(b,d,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&a.match(y)&&y.meta.condition||c(y),[2,y]}var O;}))}))}();return Object.assign(h,{abort:v,requestId:d,arg:e,unwrap:function(){return h.then(Me)}})}}),{pending:u,rejected:a,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function Me(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var _e=function(e,t){return (n=e)&&"function"==typeof n.match?e.match(t):e(t);var n;};function Ke(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return _e(e,t)}))}}function Fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.every((function(e){return _e(e,t)}))}}function ze(e,t){if(!e||!e.meta)return !1;var n="string"==typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function Ue(e){return "function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function We(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return ze(e,["pending"])}:Ue(e)?function(t){var n=e.map((function(e){return e.pending}));return Ke.apply(void 0,n)(t)}:We()(e[0])}function Le(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return ze(e,["rejected"])}:Ue(e)?function(t){var n=e.map((function(e){return e.rejected}));return Ke.apply(void 0,n)(t)}:Le()(e[0])}function Be(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||Ue(e)?function(t){return Fe(Le.apply(void 0,e),n)(t)}:Be()(e[0])}function Je(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return ze(e,["fulfilled"])}:Ue(e)?function(t){var n=e.map((function(e){return e.fulfilled}));return Ke.apply(void 0,n)(t)}:Je()(e[0])}function Ve(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return ze(e,["pending","fulfilled","rejected"])}:Ue(e)?function(t){for(var n=[],r=0,i=e;r<i.length;r++){var u=i[r];n.push(u.pending,u.rejected,u.fulfilled);}return Ke.apply(void 0,n)(t)}:Ve()(e[0])}"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){return le.get(this[ae],e)},set:function(t){le.set(this[ae],e,t);}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][ae];if(!i.P)switch(i.i){case 5:r(i)&&$(i);break;case 4:n(i)&&$(i);}}}function n(e){for(var t=e.t,n=e.k,r=ce(n),i=r.length-1;i>=0;i--){var u=r[i];if(u!==ae){var a=t[u];if(void 0===a&&!A(t,u))return !0;var o=n[u],c=o&&o[ae];if(c?c.t!==a:!T(o,a))return !0}}var s=!!t[ae];return r.length!==ce(t).length+(s?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return !0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return !0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return !0;return !1}var i={};M("ES5",{J:function(t,n){var r=Array.isArray(t),i=function(t,n){if(t){for(var r=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,""+i,e(i,!0));return r}var u=se(n);delete u[ae];for(var a=ce(u),o=0;o<a.length;o++){var c=a[o];u[c]=e(c,t||!!u[c].enumerable);}return Object.create(Object.getPrototypeOf(n),u)}(r,t),u={i:r?5:4,A:n?n.A:_(),P:!1,I:!1,D:{},l:n,t:t,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,ae,{value:u,writable:!0}),i},S:function(e,n,i){i?w(n)&&n[ae].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[ae];if(n){var i=n.t,u=n.k,a=n.D,o=n.i;if(4===o)j(u,(function(t){t!==ae&&(void 0!==i[t]||A(i,t)?a[t]||e(u[t]):(a[t]=!0,$(n)));})),j(i,(function(e){void 0!==u[e]||A(u,e)||(a[e]=!1,$(n));}));else if(5===o){if(r(n)&&($(n),a.length=!0),u.length<i.length)for(var c=u.length;c<i.length;c++)a[c]=!1;else for(var s=i.length;s<u.length;s++)a[s]=!0;for(var f=Math.min(u.length,i.length),l=0;l<f;l++)u.hasOwnProperty(l)||(a[l]=!0),void 0===a[l]&&e(u[l]);}}}}(e.p[0]),t(e.p));},K:function(e){return 4===e.i?n(e):r(e)}});}();var He=Pe;function Ge(e,t){if(e===t||!(He(e)&&He(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,u=Array.isArray(t)?[]:{},a=0,o=n;a<o.length;a++){var c=o[a];u[c]=Ge(e[c],t[c]),i&&(i=e[c]===u[c]);}return i?e:u}var $e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},Xe=function(e){return e.status>=200&&e.status<=299},Ye=function(e){return /ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function Ze(e){if(!Pe(e))return e;for(var t=p({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n];void 0===i[1]&&delete t[i[0]];}return t}function et(e){var t=this;void 0===e&&(e={});var n=e.baseUrl,r=e.prepareHeaders,u=void 0===r?function(e){return e}:r,a=e.fetchFn,o=void 0===a?$e:a,c=e.paramsSerializer,s=e.isJsonContentType,f=void 0===s?Ye:s,l=e.jsonContentType,d=void 0===l?"application/json":l,g=e.jsonReplacer,m=e.timeout,b=e.validateStatus,O=h(e,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","validateStatus"]);return "undefined"==typeof fetch&&o===$e&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(e,r){return y(t,null,(function(){var t,a,s,l,y,S,j,q,A,P,R,T,k,x,I,C,E,D,N,Q,M,_,K,F,z,U,W,L,B,J,V,H,G,$,X,Y;return i(this,(function(i){switch(i.label){case 0:return t=r.signal,a=r.getState,s=r.extra,l=r.endpoint,y=r.forced,S=r.type,A=(q="string"==typeof e?{url:e}:e).url,R=void 0===(P=q.headers)?new Headers(O.headers):P,k=void 0===(T=q.params)?void 0:T,I=void 0===(x=q.responseHandler)?"json":x,E=void 0===(C=q.validateStatus)?null!=b?b:Xe:C,N=void 0===(D=q.timeout)?m:D,Q=h(q,["url","headers","params","responseHandler","validateStatus","timeout"]),M=p(v(p({},O),{signal:t}),Q),R=new Headers(Ze(R)),_=M,[4,u(R,{getState:a,extra:s,endpoint:l,forced:y,type:S})];case 1:_.headers=i.sent()||R,K=function(e){return "object"==typeof e&&(Pe(e)||Array.isArray(e)||"function"==typeof e.toJSON)},!M.headers.has("content-type")&&K(M.body)&&M.headers.set("content-type",d),K(M.body)&&f(M.headers)&&(M.body=JSON.stringify(M.body,g)),k&&(F=~A.indexOf("?")?"&":"?",z=c?c(k):new URLSearchParams(Ze(k)),A+=F+z),A=function(e,t){if(!e)return t;if(!t)return e;if(function(e){return new RegExp("(^|:)//").test(e)}(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=function(e){return e.replace(/\/$/,"")}(e),""+e+n+function(e){return e.replace(/^\//,"")}(t)}(n,A),U=new Request(A,M),W=U.clone(),j={request:W},B=!1,J=N&&setTimeout((function(){B=!0,r.abort();}),N),i.label=2;case 2:return i.trys.push([2,4,5,6]),[4,o(U)];case 3:return L=i.sent(),[3,6];case 4:return V=i.sent(),[2,{error:{status:B?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(V)},meta:j}];case 5:return J&&clearTimeout(J),[7];case 6:H=L.clone(),j.response=H,$="",i.label=7;case 7:return i.trys.push([7,9,,10]),[4,Promise.all([w(L,I).then((function(e){return G=e}),(function(e){return X=e})),H.text().then((function(e){return $=e}),(function(){}))])];case 8:if(i.sent(),X)throw X;return [3,10];case 9:return Y=i.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:L.status,data:$,error:String(Y)},meta:j}];case 10:return [2,E(L,G)?{data:G,meta:j}:{error:{status:L.status,data:G},meta:j}]}}))}))};function w(e,t){return y(this,null,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return "function"==typeof t?[2,t(e)]:("content-type"===t&&(t=f(e.headers)?"json":"text"),"json"!==t?[3,2]:[4,e.text()]);case 1:return [2,(n=r.sent()).length?JSON.parse(n):null];case 2:return [2,e.text()]}}))}))}}var tt=function(e,t){void 0===t&&(t=void 0),this.value=e,this.meta=t;};function nt(e,t){return void 0===e&&(e=0),void 0===t&&(t=5),y(this,null,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return n=Math.min(e,t),r=~~((Math.random()+.4)*(300<<n)),[4,new Promise((function(e){return setTimeout((function(t){return e(t)}),r)}))];case 1:return i.sent(),[2]}}))}))}var rt,it,ut={},at=Object.assign((function(e,t){return function(n,r,u){return y(void 0,null,(function(){var a,o,c,s,f,l,d;return i(this,(function(i){switch(i.label){case 0:a=[5,(t||ut).maxRetries,(u||ut).maxRetries].filter((function(e){return void 0!==e})),o=a.slice(-1)[0],c=function(e,t,n){return n.attempt<=o},s=p(p({maxRetries:o,backoff:nt,retryCondition:c},t),u),f=0,i.label=1;case 1:i.label=2;case 2:return i.trys.push([2,4,,6]),[4,e(n,r,u)];case 3:if((l=i.sent()).error)throw new tt(l);return [2,l];case 4:if(d=i.sent(),f++,d.throwImmediately){if(d instanceof tt)return [2,d.value];throw d}return d instanceof tt&&!s.retryCondition(d.value.error,n,{attempt:f,baseQueryApi:r,extraOptions:u})?[2,d.value]:[4,s.backoff(f,s.maxRetries)];case 5:return i.sent(),[3,6];case 6:return [3,1];case 7:return [2]}}))}))}}),{fail:function(e){throw Object.assign(new tt({error:e}),{throwImmediately:!0})}}),ot=Te("__rtkq/focused"),ct=Te("__rtkq/unfocused"),st=Te("__rtkq/online"),ft=Te("__rtkq/offline"),lt=!1;function dt(e,t){return t?t(e,{onFocus:ot,onFocusLost:ct,onOffline:ft,onOnline:st}):(n=function(){return e(ot())},r=function(){return e(st())},i=function(){return e(ft())},u=function(){"visible"===window.document.visibilityState?n():e(ct());},lt||"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("visibilitychange",u,!1),window.addEventListener("focus",n,!1),window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),lt=!0),function(){window.removeEventListener("focus",n),window.removeEventListener("visibilitychange",u),window.removeEventListener("online",r),window.removeEventListener("offline",i),lt=!1;});var n,r,i,u;}function pt(e){return e.type===rt.query}function vt(e,t,n,r,i,u){return "function"==typeof e?e(t,n,r,i).map(ht).map(u):Array.isArray(e)?e.map(ht).map(u):[]}function ht(e){return "string"==typeof e?{type:e}:e}function yt(e){return null!=e}(it=rt||(rt={})).query="query",it.mutation="mutation";var gt=Symbol("forceQueryFn"),mt=function(e){return "function"==typeof e[gt]};function bt(e){return e}function Ot(e,t,n,r){return vt(n[e.meta.arg.endpointName][t],Je(e)?e.payload:void 0,Be(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function wt(e,t,n){var r=e[t];r&&n(r);}function St(e){var t;return null!=(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)?t:e.requestId}function jt(e,t,n){var r=e[St(t)];r&&n(r);}var qt={},At=Symbol.for("RTKQ/skipToken"),Pt=At,Rt={status:exports.QueryStatus.uninitialized},Tt=ge(Rt,(function(){})),kt=ge(Rt,(function(){})),xt=function(e){return e.endpointName+"("+JSON.stringify(e.queryArgs,(function(e,t){return Pe(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}))+")"};function It(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n=Se((function(e){var n,r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:null!=(n=t.reducerPath)?n:"api"})})),r=v(p({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{extractRehydrationInfo:n,serializeQueryArgs:function(e){var n=xt;if("serializeQueryArgs"in e.endpointDefinition){var r=e.endpointDefinition.serializeQueryArgs;n=function(e){var t=r(e);return "string"==typeof t?t:xt(v(p({},e),{queryArgs:t}))};}else t.serializeQueryArgs&&(n=t.serializeQueryArgs);return n(e)},tagTypes:u([],t.tagTypes||[])}),i={endpointDefinitions:{},batch:function(e){e();},apiUid:Ie(),extractRehydrationInfo:n,hasRehydrationInfo:Se((function(e){return null!=n(e)}))},a={injectEndpoints:function(e){for(var t=e.endpoints({query:function(e){return v(p({},e),{type:rt.query})},mutation:function(e){return v(p({},e),{type:rt.mutation})}}),n=0,r=Object.entries(t);n<r.length;n++){var u=r[n],c=u[0],s=u[1];if(e.overrideExisting||!(c in i.endpointDefinitions)){i.endpointDefinitions[c]=s;for(var f=0,l=o;f<l.length;f++)l[f].injectEndpoint(c,s);}}return a},enhanceEndpoints:function(e){var t=e.addTagTypes,n=e.endpoints;if(t)for(var u=0,o=t;u<o.length;u++){var c=o[u];r.tagTypes.includes(c)||r.tagTypes.push(c);}if(n)for(var s=0,f=Object.entries(n);s<f.length;s++){var l=f[s],d=l[0],p=l[1];"function"==typeof p?p(i.endpointDefinitions[d]):Object.assign(i.endpointDefinitions[d]||{},p);}return a}},o=e.map((function(e){return e.init(a,r,i)}));return a.injectEndpoints({endpoints:t.endpoints})}}function Ct(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Et,Dt=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,u=n.internalActions,a=u.removeQueryResult,o=u.unsubscribeQueryResult;function c(e){var t=i.currentSubscriptions[e];return !!t&&!function(e){for(var t in e)return !1;return !0}(t)}var s={};function f(e,t,n,i){var u,o=r.endpointDefinitions[t],f=null!=(u=null==o?void 0:o.keepUnusedDataFor)?u:i.keepUnusedDataFor;if(Infinity!==f){var l=Math.max(0,Math.min(f,2147482.647));if(!c(e)){var d=s[e];d&&clearTimeout(d),s[e]=setTimeout((function(){c(e)||n.dispatch(a({queryCacheKey:e})),delete s[e];}),1e3*l);}}}return function(e,i,u){var a;if(o.match(e)){var c=i.getState()[t];f(b=e.payload.queryCacheKey,null==(a=c.queries[b])?void 0:a.endpointName,i,c.config);}if(n.util.resetApiState.match(e))for(var l=0,d=Object.entries(s);l<d.length;l++){var p=d[l],v=p[0],h=p[1];h&&clearTimeout(h),delete s[v];}if(r.hasRehydrationInfo(e)){c=i.getState()[t];for(var y=r.extractRehydrationInfo(e).queries,g=0,m=Object.entries(y);g<m.length;g++){var b,O=m[g],w=O[1];f(b=O[0],null==w?void 0:w.endpointName,i,c.config);}}}},Nt=function(e){var n=e.reducerPath,r=e.context,i=e.context.endpointDefinitions,u=e.mutationThunk,a=e.api,o=e.assertTagType,c=e.refetchQuery,s=a.internalActions.removeQueryResult,f=Ke(Je(u),Be(u));function l(e,i){var u=i.getState(),o=u[n],f=a.util.selectInvalidatedBy(u,e);r.batch((function(){for(var e,n=0,r=Array.from(f.values());n<r.length;n++){var u=r[n].queryCacheKey,a=o.queries[u],l=null!=(e=o.subscriptions[u])?e:{};a&&(0===Object.keys(l).length?i.dispatch(s({queryCacheKey:u})):a.status!==exports.QueryStatus.uninitialized&&i.dispatch(c(a,u)));}}));}return function(e,t){f(e)&&l(Ot(e,"invalidatesTags",i,o),t),a.util.invalidateTags.match(e)&&l(vt(e.payload,void 0,void 0,void 0,void 0,o),t);}},Qt=function(e){var n=e.reducerPath,r=e.queryThunk,i=e.api,u=e.refetchQuery,a=e.internalState,o={};function c(e,r){var i=e.queryCacheKey,c=r.getState()[n].queries[i];if(c&&c.status!==exports.QueryStatus.uninitialized){var s=l(a.currentSubscriptions[i]);if(Number.isFinite(s)){var f=o[i];(null==f?void 0:f.timeout)&&(clearTimeout(f.timeout),f.timeout=void 0);var d=Date.now()+s,p=o[i]={nextPollTimestamp:d,pollingInterval:s,timeout:setTimeout((function(){p.timeout=void 0,r.dispatch(u(c,i));}),s)};}}}function s(e,r){var i=e.queryCacheKey,u=r.getState()[n].queries[i];if(u&&u.status!==exports.QueryStatus.uninitialized){var s=l(a.currentSubscriptions[i]);if(Number.isFinite(s)){var d=o[i],p=Date.now()+s;(!d||p<d.nextPollTimestamp)&&c({queryCacheKey:i},r);}else f(i);}}function f(e){var t=o[e];(null==t?void 0:t.timeout)&&clearTimeout(t.timeout),delete o[e];}function l(e){void 0===e&&(e={});var t=Number.POSITIVE_INFINITY;for(var n in e)e[n].pollingInterval&&(t=Math.min(e[n].pollingInterval,t));return t}return function(e,t){(i.internalActions.updateSubscriptionOptions.match(e)||i.internalActions.unsubscribeQueryResult.match(e))&&s(e.payload,t),(r.pending.match(e)||r.rejected.match(e)&&e.meta.condition)&&s(e.meta.arg,t),(r.fulfilled.match(e)||r.rejected.match(e)&&!e.meta.condition)&&c(e.meta.arg,t),i.util.resetApiState.match(e)&&function(){for(var e=0,t=Object.keys(o);e<t.length;e++)f(t[e]);}();}},Mt=new Error("Promise never resolved before cacheEntryRemoved."),_t=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,u=e.mutationThunk,a=Ve(i),o=Ve(u),c=Je(i,u),s={};function f(e,n,i,u,a){var o=r.endpointDefinitions[e],c=null==o?void 0:o.onCacheEntryAdded;if(c){var f={},l=new Promise((function(e){f.cacheEntryRemoved=e;})),d=Promise.race([new Promise((function(e){f.valueResolved=e;})),l.then((function(){throw Mt}))]);d.catch((function(){})),s[i]=f;var h=t.endpoints[e].select(o.type===rt.query?n:i),y=u.dispatch((function(e,t,n){return n})),g=v(p({},u),{getCacheEntry:function(){return h(u.getState())},requestId:a,extra:y,updateCachedData:o.type===rt.query?function(r){return u.dispatch(t.util.updateQueryData(e,n,r))}:void 0,cacheDataLoaded:d,cacheEntryRemoved:l}),m=c(n,g);Promise.resolve(m).catch((function(e){if(e!==Mt)throw e}));}}return function(e,r,l){var d=function(e){return a(e)?e.meta.arg.queryCacheKey:o(e)?e.meta.requestId:t.internalActions.removeQueryResult.match(e)?e.payload.queryCacheKey:t.internalActions.removeMutationResult.match(e)?St(e.payload):""}(e);if(i.pending.match(e)){var p=l[n].queries[d],v=r.getState()[n].queries[d];!p&&v&&f(e.meta.arg.endpointName,e.meta.arg.originalArgs,d,r,e.meta.requestId);}else if(u.pending.match(e))(v=r.getState()[n].mutations[d])&&f(e.meta.arg.endpointName,e.meta.arg.originalArgs,d,r,e.meta.requestId);else if(c(e))(null==(m=s[d])?void 0:m.valueResolved)&&(m.valueResolved({data:e.payload,meta:e.meta.baseQueryMeta}),delete m.valueResolved);else if(t.internalActions.removeQueryResult.match(e)||t.internalActions.removeMutationResult.match(e))(m=s[d])&&(delete s[d],m.cacheEntryRemoved());else if(t.util.resetApiState.match(e))for(var h=0,y=Object.entries(s);h<y.length;h++){var g=y[h],m=g[1];delete s[g[0]],m.cacheEntryRemoved();}}},Kt=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,u=We(r,i),a=Le(r,i),o=Je(r,i),c={};return function(e,r){var i,s,f;if(u(e)){var l=e.meta,d=l.requestId,h=l.arg,y=h.endpointName,g=h.originalArgs,m=n.endpointDefinitions[y],b=null==m?void 0:m.onQueryStarted;if(b){var O={},w=new Promise((function(e,t){O.resolve=e,O.reject=t;}));w.catch((function(){})),c[d]=O;var S=t.endpoints[y].select(m.type===rt.query?g:d),j=r.dispatch((function(e,t,n){return n})),q=v(p({},r),{getCacheEntry:function(){return S(r.getState())},requestId:d,extra:j,updateCachedData:m.type===rt.query?function(e){return r.dispatch(t.util.updateQueryData(y,g,e))}:void 0,queryFulfilled:w});b(g,q);}}else if(o(e)){var A=e.meta,P=A.baseQueryMeta;null==(i=c[d=A.requestId])||i.resolve({data:e.payload,meta:P}),delete c[d];}else if(a(e)){var R=e.meta;P=R.baseQueryMeta,null==(f=c[d=R.requestId])||f.reject({error:null!=(s=e.payload)?s:e.error,isUnhandledError:!R.rejectedWithValue,meta:P}),delete c[d];}}},Ft=function(e){var t=e.api,n=e.context.apiUid;return function(e,r){t.util.resetApiState.match(e)&&r.dispatch(t.internalActions.middlewareRegistered(n));}},zt="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):function(e){return (Et||(Et=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}),0)}))};function Ut(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,u([e],t));}var Wt=Symbol(),Lt=function(){return {name:Wt,init:function(e,n,r){var a=n.baseQuery,o=n.reducerPath,c=n.serializeQueryArgs,s=n.keepUnusedDataFor,f=n.refetchOnMountOrArgChange,l=n.refetchOnFocus,d=n.refetchOnReconnect;!function(){function e(t){if(!S(t))return t;if(Array.isArray(t))return t.map(e);if(k(t))return new Map(Array.from(t.entries()).map((function(t){return [t[0],e(t[1])]})));if(x(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return A(t,ue)&&(n[ue]=t[ue]),n}function t(t){return w(t)?e(t):t}var n="add";M("Patches",{$:function(t,r){return r.forEach((function(r){for(var i=r.path,u=r.op,a=t,o=0;o<i.length-1;o++){var c=q(a),s=""+i[o];0!==c&&1!==c||"__proto__"!==s&&"constructor"!==s||O(24),"function"==typeof a&&"prototype"===s&&O(24),"object"!=typeof(a=P(a,s))&&O(15,i.join("/"));}var f=q(a),l=e(r.value),d=i[i.length-1];switch(u){case"replace":switch(f){case 2:return a.set(d,l);case 3:O(16);default:return a[d]=l}case n:switch(f){case 1:return "-"===d?a.push(l):a.splice(d,0,l);case 2:return a.set(d,l);case 3:return a.add(l);default:return a[d]=l}case"remove":switch(f){case 1:return a.splice(d,1);case 2:return a.delete(d);case 3:return a.delete(r.value);default:return delete a[d]}default:O(17,u);}})),t},R:function(e,r,i,u){switch(e.i){case 0:case 4:case 2:return o=r,c=i,s=u,f=(a=e).t,l=a.o,void j(a.D,(function(e,r){var i=P(f,e),u=P(l,e),a=r?A(f,e)?"replace":n:"remove";if(i!==u||"replace"!==a){var d=o.concat(e);c.push("remove"===a?{op:a,path:d}:{op:a,path:d,value:u}),s.push(a===n?{op:"remove",path:d}:"remove"===a?{op:n,path:d,value:t(i)}:{op:"replace",path:d,value:t(i)});}}));case 5:case 1:return function(e,r,i,u){var a=e.t,o=e.D,c=e.o;if(c.length<a.length){var s=[c,a];a=s[0],c=s[1];var f=[u,i];i=f[0],u=f[1];}for(var l=0;l<a.length;l++)if(o[l]&&c[l]!==a[l]){var d=r.concat([l]);i.push({op:"replace",path:d,value:t(c[l])}),u.push({op:"replace",path:d,value:t(a[l])});}for(var p=a.length;p<c.length;p++){var v=r.concat([p]);i.push({op:n,path:v,value:t(c[p])});}a.length<c.length&&u.push({op:"replace",path:r.concat(["length"]),value:a.length});}(e,r,i,u);case 3:return function(e,t,r,i){var u=e.t,a=e.o,o=0;u.forEach((function(e){if(!a.has(e)){var u=t.concat([o]);r.push({op:"remove",path:u,value:e}),i.unshift({op:n,path:u,value:e});}o++;})),o=0,a.forEach((function(e){if(!u.has(e)){var a=t.concat([o]);r.push({op:n,path:a,value:e}),i.unshift({op:"remove",path:a,value:e});}o++;}));}(e,r,i,u)}var a,o,c,s,f,l;},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t===ie?void 0:t}),r.push({op:"replace",path:[],value:e});}});}();var h=function(e){return e};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:st,onOffline:ft,onFocus:ot,onFocusLost:ct},util:{}});var g=function(e){var n=this,r=e.reducerPath,u=e.baseQuery,a=e.context.endpointDefinitions,o=e.serializeQueryArgs,c=e.api,s=function(e,t){return y(n,[e,t],(function(e,t){var n,r,o,c,s,l,d,p,v,h,y,g,m,b=t.signal,O=t.abort,w=t.rejectWithValue,S=t.fulfillWithValue,j=t.dispatch,q=t.getState,A=t.extra;return i(this,(function(t){switch(t.label){case 0:n=a[e.endpointName],t.label=1;case 1:return t.trys.push([1,8,,13]),r=bt,o=void 0,c={signal:b,abort:O,dispatch:j,getState:q,extra:A,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?f(e,q()):void 0},(s="query"===e.type?e[gt]:void 0)?(o=s(),[3,6]):[3,2];case 2:return n.query?[4,u(n.query(e.originalArgs),c,n.extraOptions)]:[3,4];case 3:return o=t.sent(),n.transformResponse&&(r=n.transformResponse),[3,6];case 4:return [4,n.queryFn(e.originalArgs,c,n.extraOptions,(function(e){return u(e,c,n.extraOptions)}))];case 5:o=t.sent(),t.label=6;case 6:if(o.error)throw new tt(o.error,o.meta);return l=S,[4,r(o.data,o.meta,e.originalArgs)];case 7:return [2,l.apply(void 0,[t.sent(),(g={fulfilledTimeStamp:Date.now(),baseQueryMeta:o.meta},g.RTK_autoBatch=!0,g)])];case 8:if(d=t.sent(),!((p=d)instanceof tt))return [3,12];v=bt,n.query&&n.transformErrorResponse&&(v=n.transformErrorResponse),t.label=9;case 9:return t.trys.push([9,11,,12]),h=w,[4,v(p.value,p.meta,e.originalArgs)];case 10:return [2,h.apply(void 0,[t.sent(),(m={baseQueryMeta:p.meta},m.RTK_autoBatch=!0,m)])];case 11:return y=t.sent(),p=y,[3,12];case 12:throw console.error(p),p;case 13:return [2]}}))}))};function f(e,t){var n,i,u,a,o=null==(i=null==(n=t[r])?void 0:n.queries)?void 0:i[e.queryCacheKey],c=null==(u=t[r])?void 0:u.config.refetchOnMountOrArgChange,s=null==o?void 0:o.fulfilledTimeStamp,f=null!=(a=e.forceRefetch)?a:e.subscribe&&c;return !!f&&(!0===f||(Number(new Date)-Number(s))/1e3>=f)}var l=Qe(r+"/executeQuery",s,{getPendingMeta:function(){var e;return (e={startedTimeStamp:Date.now()}).RTK_autoBatch=!0,e},condition:function(e,t){var n,i,u,o=(0, t.getState)(),c=null==(i=null==(n=o[r])?void 0:n.queries)?void 0:i[e.queryCacheKey],s=null==c?void 0:c.fulfilledTimeStamp,l=e.originalArgs,d=null==c?void 0:c.originalArgs,p=a[e.endpointName];return !(!mt(e)&&("pending"===(null==c?void 0:c.status)||!f(e,o)&&(!pt(p)||!(null==(u=null==p?void 0:p.forceRefetch)?void 0:u.call(p,{currentArg:l,previousArg:d,endpointState:c,state:o})))&&s))},dispatchConditionRejection:!0}),d=Qe(r+"/executeMutation",s,{getPendingMeta:function(){var e;return (e={startedTimeStamp:Date.now()}).RTK_autoBatch=!0,e}});function p(e){return function(t){var n,r;return (null==(r=null==(n=null==t?void 0:t.meta)?void 0:n.arg)?void 0:r.endpointName)===e}}return {queryThunk:l,mutationThunk:d,prefetch:function(e,t,n){return function(r,i){var u=function(e){return "force"in e}(n)&&n.force,a=function(e){return "ifOlderThan"in e}(n)&&n.ifOlderThan,o=function(n){return void 0===n&&(n=!0),c.endpoints[e].initiate(t,{forceRefetch:n})},s=c.endpoints[e].select(t)(i());if(u)r(o());else if(a){var f=null==s?void 0:s.fulfilledTimeStamp;if(!f)return void r(o());(Number(new Date)-Number(new Date(f)))/1e3>=a&&r(o());}else r(o(!1));}},updateQueryData:function(e,n,r){return function(i,u){var a,o,s=c.endpoints[e].select(n)(u()),f={patches:[],inversePatches:[],undo:function(){return i(c.util.patchQueryData(e,n,f.inversePatches))}};if(s.status===exports.QueryStatus.uninitialized)return f;if("data"in s)if(S(s.data)){var l=he(s.data,r),d=l[2];(a=f.patches).push.apply(a,l[1]),(o=f.inversePatches).push.apply(o,d);}else {var p=r(s.data);f.patches.push({op:"replace",path:[],value:p}),f.inversePatches.push({op:"replace",path:[],value:s.data});}return i(c.util.patchQueryData(e,n,f.patches)),f}},upsertQueryData:function(e,t,n){return function(r){var i;return r(c.endpoints[e].initiate(t,((i={subscribe:!1,forceRefetch:!0})[gt]=function(){return {data:n}},i)))}},patchQueryData:function(e,t,n){return function(r){r(c.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:t,endpointDefinition:a[e],endpointName:e}),patches:n}));}},buildMatchThunkActions:function(e,t){return {matchPending:Fe(We(e),p(t)),matchFulfilled:Fe(Je(e),p(t)),matchRejected:Fe(Le(e),p(t))}}}}({baseQuery:a,reducerPath:o,context:r,api:e,serializeQueryArgs:c}),m=g.queryThunk,R=g.mutationThunk,T=g.patchQueryData,I=g.updateQueryData,C=g.upsertQueryData,E=g.prefetch,D=g.buildMatchThunkActions,N=function(e){var n=e.reducerPath,r=e.queryThunk,i=e.mutationThunk,u=e.context,a=u.endpointDefinitions,o=u.apiUid,c=u.extractRehydrationInfo,s=u.hasRehydrationInfo,f=e.assertTagType,l=e.config,d=Te(n+"/resetApiState"),h=xe({name:n+"/queries",initialState:qt,reducers:{removeQueryResult:{reducer:function(e,t){delete e[t.payload.queryCacheKey];},prepare:function(e){var t;return {payload:e,meta:(t={},t.RTK_autoBatch=!0,t)}}},queryResultPatched:function(e,t){var n=t.payload,r=n.patches;wt(e,n.queryCacheKey,(function(e){e.data=ye(e.data,r.concat());}));}},extraReducers:function(e){e.addCase(r.pending,(function(e,n){var r,i=n.meta,u=n.meta.arg,a=mt(u);(u.subscribe||a)&&(null!=e[r=u.queryCacheKey]||(e[r]={status:exports.QueryStatus.uninitialized,endpointName:u.endpointName})),wt(e,u.queryCacheKey,(function(e){e.status=exports.QueryStatus.pending,e.requestId=a&&e.requestId?e.requestId:i.requestId,void 0!==u.originalArgs&&(e.originalArgs=u.originalArgs),e.startedTimeStamp=i.startedTimeStamp;}));})).addCase(r.fulfilled,(function(e,n){var r=n.meta,i=n.payload;wt(e,r.arg.queryCacheKey,(function(e){var n;if(e.requestId===r.requestId||mt(r.arg)){var u=a[r.arg.endpointName].merge;if(e.status=exports.QueryStatus.fulfilled,u)if(void 0!==e.data){var o=r.fulfilledTimeStamp,c=r.arg,s=r.baseQueryMeta,f=r.requestId,l=ge(e.data,(function(e){return u(e,i,{arg:c.originalArgs,baseQueryMeta:s,fulfilledTimeStamp:o,requestId:f})}));e.data=l;}else e.data=i;else e.data=null==(n=a[r.arg.endpointName].structuralSharing)||n?Ge(e.data,i):i;delete e.error,e.fulfilledTimeStamp=r.fulfilledTimeStamp;}}));})).addCase(r.rejected,(function(e,n){var r=n.meta,i=r.condition,u=r.requestId,a=n.error,o=n.payload;wt(e,r.arg.queryCacheKey,(function(e){if(i);else {if(e.requestId!==u)return;e.status=exports.QueryStatus.rejected,e.error=null!=o?o:a;}}));})).addMatcher(s,(function(e,n){for(var r=c(n).queries,i=0,u=Object.entries(r);i<u.length;i++){var a=u[i],o=a[1];(null==o?void 0:o.status)!==exports.QueryStatus.fulfilled&&(null==o?void 0:o.status)!==exports.QueryStatus.rejected||(e[a[0]]=o);}}));}}),y=xe({name:n+"/mutations",initialState:qt,reducers:{removeMutationResult:{reducer:function(e,t){var n=St(t.payload);n in e&&delete e[n];},prepare:function(e){var t;return {payload:e,meta:(t={},t.RTK_autoBatch=!0,t)}}}},extraReducers:function(e){e.addCase(i.pending,(function(e,n){var r=n.meta,i=r.requestId,u=r.arg,a=r.startedTimeStamp;u.track&&(e[St(n.meta)]={requestId:i,status:exports.QueryStatus.pending,endpointName:u.endpointName,startedTimeStamp:a});})).addCase(i.fulfilled,(function(e,n){var r=n.payload,i=n.meta;i.arg.track&&jt(e,i,(function(e){e.requestId===i.requestId&&(e.status=exports.QueryStatus.fulfilled,e.data=r,e.fulfilledTimeStamp=i.fulfilledTimeStamp);}));})).addCase(i.rejected,(function(e,n){var r=n.payload,i=n.error,u=n.meta;u.arg.track&&jt(e,u,(function(e){e.requestId===u.requestId&&(e.status=exports.QueryStatus.rejected,e.error=null!=r?r:i);}));})).addMatcher(s,(function(e,n){for(var r=c(n).mutations,i=0,u=Object.entries(r);i<u.length;i++){var a=u[i],o=a[0],s=a[1];(null==s?void 0:s.status)!==exports.QueryStatus.fulfilled&&(null==s?void 0:s.status)!==exports.QueryStatus.rejected||o===(null==s?void 0:s.requestId)||(e[o]=s);}}));}}),g=xe({name:n+"/invalidation",initialState:qt,reducers:{},extraReducers:function(e){e.addCase(h.actions.removeQueryResult,(function(e,t){for(var n=t.payload.queryCacheKey,r=0,i=Object.values(e);r<i.length;r++)for(var u=0,a=Object.values(i[r]);u<a.length;u++){var o=a[u],c=o.indexOf(n);-1!==c&&o.splice(c,1);}})).addMatcher(s,(function(e,t){for(var n,r,i,u,a=c(t).provided,o=0,s=Object.entries(a);o<s.length;o++)for(var f=s[o],l=f[0],d=0,p=Object.entries(f[1]);d<p.length;d++)for(var v=p[d],h=v[0],y=v[1],g=null!=(u=(r=null!=(n=e[l])?n:e[l]={})[i=h||"__internal_without_id"])?u:r[i]=[],m=0,b=y;m<b.length;m++){var O=b[m];g.includes(O)||g.push(O);}})).addMatcher(Ke(Je(r),Be(r)),(function(e,t){for(var n,r,i,u,o=Ot(t,"providesTags",a,f),c=t.meta.arg.queryCacheKey,s=0,l=Object.values(e);s<l.length;s++)for(var d=0,p=Object.values(l[s]);d<p.length;d++){var v=p[d],h=v.indexOf(c);-1!==h&&v.splice(h,1);}for(var y=0,g=o;y<g.length;y++){var m=g[y],b=m.type,O=m.id,w=null!=(u=(r=null!=(n=e[b])?n:e[b]={})[i=O||"__internal_without_id"])?u:r[i]=[];w.includes(c)||w.push(c);}}));}}),m=xe({name:n+"/subscriptions",initialState:qt,reducers:{updateSubscriptionOptions:function(e,t){},unsubscribeQueryResult:function(e,t){},internal_probeSubscription:function(e,t){}}}),b=xe({name:n+"/internalSubscriptions",initialState:qt,reducers:{subscriptionsUpdated:function(e,t){return ye(e,t.payload)}}}),O=xe({name:n+"/config",initialState:p({online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1},l),reducers:{middlewareRegistered:function(e,t){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&o===t.payload||"conflict";}},extraReducers:function(e){e.addCase(st,(function(e){e.online=!0;})).addCase(ft,(function(e){e.online=!1;})).addCase(ot,(function(e){e.focused=!0;})).addCase(ct,(function(e){e.focused=!1;})).addMatcher(s,(function(e){return p({},e)}));}}),w=function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];"function"==typeof e[i]&&(n[i]=e[i]);}var u,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Oe.INIT}))throw new Error(me(12));if(void 0===n(void 0,{type:Oe.PROBE_UNKNOWN_ACTION()}))throw new Error(me(13))}));}(n);}catch(e){u=e;}return function(e,t){if(void 0===e&&(e={}),u)throw u;for(var r=!1,i={},o=0;o<a.length;o++){var c=a[o],s=e[c],f=(0, n[c])(s,t);if(void 0===f)throw new Error(me(14));i[c]=f,r=r||f!==s;}return (r=r||a.length!==Object.keys(e).length)?i:e}}({queries:h.reducer,mutations:y.reducer,provided:g.reducer,subscriptions:b.reducer,config:O.reducer});return {reducer:function(e,t){return w(d.match(t)?void 0:e,t)},actions:v(p(p(p(p(p({},O.actions),h.actions),m.actions),b.actions),y.actions),{unsubscribeMutationResult:y.actions.removeMutationResult,resetApiState:d})}}({context:r,queryThunk:m,mutationThunk:R,reducerPath:o,assertTagType:h,config:{refetchOnFocus:l,refetchOnReconnect:d,refetchOnMountOrArgChange:f,keepUnusedDataFor:s,reducerPath:o}}),Q=N.reducer,_=N.actions;Ut(e.util,{patchQueryData:T,updateQueryData:I,upsertQueryData:C,prefetch:E,resetApiState:_.resetApiState}),Ut(e.internalActions,_);var K=function(e){var n=e.reducerPath,r=e.queryThunk,i=e.api,u=e.context,a=u.apiUid,o={invalidateTags:Te(n+"/invalidateTags")},c=[Ft,Dt,Nt,Qt,_t,Kt];return {middleware:function(r){var o=!1,f=v(p({},e),{internalState:{currentSubscriptions:{}},refetchQuery:s}),l=c.map((function(e){return e(f)})),d=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",u=null,a=!1,o=t.internalActions,c=o.updateSubscriptionOptions,s=o.unsubscribeQueryResult;return function(e,o){var f,l;if(u||(u=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.internalActions.internal_probeSubscription.match(e)){var d=e.payload;return [!1,!!(null==(f=r.currentSubscriptions[d.queryCacheKey])?void 0:f[d.requestId])]}var p=function(e,r){var i,u,a,o,f,l,d,p,v;if(c.match(r)){var h=r.payload,y=h.queryCacheKey,g=h.requestId;return (null==(i=null==e?void 0:e[y])?void 0:i[g])&&(e[y][g]=h.options),!0}if(s.match(r)){var m=r.payload;return g=m.requestId,e[y=m.queryCacheKey]&&delete e[y][g],!0}if(t.internalActions.removeQueryResult.match(r))return delete e[r.payload.queryCacheKey],!0;if(n.pending.match(r)){var b=r.meta;if(g=b.requestId,(S=b.arg).subscribe)return (O=null!=(a=e[u=S.queryCacheKey])?a:e[u]={})[g]=null!=(f=null!=(o=S.subscriptionOptions)?o:O[g])?f:{},!0}if(n.rejected.match(r)){var O,w=r.meta,S=w.arg;if(g=w.requestId,w.condition&&S.subscribe)return (O=null!=(d=e[l=S.queryCacheKey])?d:e[l]={})[g]=null!=(v=null!=(p=S.subscriptionOptions)?p:O[g])?v:{},!0}return !1}(r.currentSubscriptions,e);if(p){a||(zt((function(){var e=JSON.parse(JSON.stringify(r.currentSubscriptions)),n=he(u,(function(){return e}));o.next(t.internalActions.subscriptionsUpdated(n[1])),u=e,a=!1;})),a=!0);var v=!!(null==(l=e.type)?void 0:l.startsWith(i)),h=n.rejected.match(e)&&e.meta.condition&&!!e.meta.arg.subscribe;return [!v&&!h,!1]}return [!0,!1]}}(f),h=function(e){var n=e.reducerPath,r=e.context,i=e.refetchQuery,u=e.internalState,a=e.api.internalActions.removeQueryResult;function o(e,o){var c=e.getState()[n],s=c.queries,f=u.currentSubscriptions;r.batch((function(){for(var n=0,r=Object.keys(f);n<r.length;n++){var u=r[n],l=s[u],d=f[u];d&&l&&(Object.values(d).some((function(e){return !0===e[o]}))||Object.values(d).every((function(e){return void 0===e[o]}))&&c.config[o])&&(0===Object.keys(d).length?e.dispatch(a({queryCacheKey:u})):l.status!==exports.QueryStatus.uninitialized&&e.dispatch(i(l,u)));}}));}return function(e,t){ot.match(e)&&o(t,"refetchOnFocus"),st.match(e)&&o(t,"refetchOnReconnect");}}(f);return function(e){return function(t){o||(o=!0,r.dispatch(i.internalActions.middlewareRegistered(a)));var c,s=v(p({},r),{next:e}),f=r.getState(),y=d(t,s,f),g=y[1];if(c=y[0]?e(t):g,r.getState()[n]&&(h(t,s,f),function(e){return !!e&&"string"==typeof e.type&&e.type.startsWith(n+"/")}(t)||u.hasRehydrationInfo(t)))for(var m=0,b=l;m<b.length;m++)(0, b[m])(t,s,f);return c}}},actions:o};function s(e,t,n){return void 0===n&&(n={}),r(p({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},n))}}({reducerPath:o,context:r,queryThunk:m,mutationThunk:R,api:e,assertTagType:h}),F=K.middleware;Ut(e.util,K.actions),Ut(e,{reducer:Q,middleware:F});var z=function(e){var n=e.serializeQueryArgs,r=e.reducerPath,i=function(e){return Tt},u=function(e){return kt};return {buildQuerySelector:function(e,t){return function(r){var u=n({queryArgs:r,endpointDefinition:t,endpointName:e});return Ae(r===At?i:function(e){var t,n,r;return null!=(r=null==(n=null==(t=o(e))?void 0:t.queries)?void 0:n[u])?r:Tt},a)}},buildMutationSelector:function(){return function(e){var t,n;return n="object"==typeof e?null!=(t=St(e))?t:At:e,Ae(n===At?u:function(e){var t,r,i;return null!=(i=null==(r=null==(t=o(e))?void 0:t.mutations)?void 0:r[n])?i:kt},a)}},selectInvalidatedBy:function(e,t){for(var n,i=e[r],u=new Set,a=0,o=t.map(ht);a<o.length;a++){var c=o[a],s=i.provided[c.type];if(s)for(var f=0,l=null!=(n=void 0!==c.id?s[c.id]:b(Object.values(s)))?n:[];f<l.length;f++)u.add(l[f]);}return b(Array.from(u.values()).map((function(e){var t=i.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))}};function a(e){return p(p({},e),{status:n=e.status,isUninitialized:n===exports.QueryStatus.uninitialized,isLoading:n===exports.QueryStatus.pending,isSuccess:n===exports.QueryStatus.fulfilled,isError:n===exports.QueryStatus.rejected});var n;}function o(e){return e[r]}}({serializeQueryArgs:c,reducerPath:o}),U=z.buildQuerySelector,W=z.buildMutationSelector;Ut(e.util,{selectInvalidatedBy:z.selectInvalidatedBy});var L=function(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,a=e.api,o=e.context,c=new Map,s=new Map,f=a.internalActions,l=f.unsubscribeQueryResult,d=f.removeMutationResult,p=f.updateSubscriptionOptions;return {buildInitiateQuery:function(e,r){var u=function(o,s){var f=void 0===s?{}:s,d=f.subscribe,v=void 0===d||d,h=f.forceRefetch,g=f.subscriptionOptions,m=f[gt];return function(s,f){var d,b,O=t({queryArgs:o,endpointDefinition:r,endpointName:e}),w=n(((d={type:"query",subscribe:v,forceRefetch:h,subscriptionOptions:g,endpointName:e,originalArgs:o,queryCacheKey:O})[gt]=m,d)),S=a.endpoints[e].select(o),j=s(w),q=S(f()),A=j.requestId,P=j.abort,R=q.requestId!==A,T=null==(b=c.get(s))?void 0:b[O],k=function(){return S(f())},x=Object.assign(m?j.then(k):R&&!T?Promise.resolve(q):Promise.all([T,j]).then(k),{arg:o,requestId:A,subscriptionOptions:g,queryCacheKey:O,abort:P,unwrap:function(){return y(this,null,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return [4,x];case 1:if((e=t.sent()).isError)throw e.error;return [2,e.data]}}))}))},refetch:function(){return s(u(o,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){v&&s(l({queryCacheKey:O,requestId:A}));},updateSubscriptionOptions:function(t){x.subscriptionOptions=t,s(p({endpointName:e,requestId:A,queryCacheKey:O,options:t}));}});if(!T&&!R&&!m){var I=c.get(s)||{};I[O]=x,c.set(s,I),x.then((function(){delete I[O],Object.keys(I).length||c.delete(s);}));}return x}};return u},buildInitiateMutation:function(e){return function(t,n){var i=void 0===n?{}:n,u=i.track,a=void 0===u||u,o=i.fixedCacheKey;return function(n,i){var u=r({type:"mutation",endpointName:e,originalArgs:t,track:a,fixedCacheKey:o}),c=n(u),f=c.requestId,l=c.abort,p=c.unwrap,v=c.unwrap().then((function(e){return {data:e}})).catch((function(e){return {error:e}})),h=function(){n(d({requestId:f,fixedCacheKey:o}));},y=Object.assign(v,{arg:c.arg,requestId:f,abort:l,unwrap:p,unsubscribe:h,reset:h}),g=s.get(n)||{};return s.set(n,g),g[f]=y,y.then((function(){delete g[f],Object.keys(g).length||s.delete(n);})),o&&(g[o]=y,y.then((function(){g[o]===y&&(delete g[o],Object.keys(g).length||s.delete(n));}))),y}}},getRunningQueryThunk:function(e,n){return function(r){var i,u=t({queryArgs:n,endpointDefinition:o.endpointDefinitions[e],endpointName:e});return null==(i=c.get(r))?void 0:i[u]}},getRunningMutationThunk:function(e,t){return function(e){var n;return null==(n=s.get(e))?void 0:n[t]}},getRunningQueriesThunk:function(){return function(e){return Object.values(c.get(e)||{}).filter(yt)}},getRunningMutationsThunk:function(){return function(e){return Object.values(s.get(e)||{}).filter(yt)}},getRunningOperationPromises:function(){var e=function(e){return Array.from(e.values()).flatMap((function(e){return e?Object.values(e):[]}))};return u(u([],e(c)),e(s)).filter(yt)},removalWarning:function(){throw new Error("This method had to be removed due to a conceptual bug in RTK.\n Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.\n See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.")}}}({queryThunk:m,mutationThunk:R,api:e,serializeQueryArgs:c,context:r}),B=L.buildInitiateQuery,J=L.buildInitiateMutation;return Ut(e.util,{getRunningOperationPromises:L.getRunningOperationPromises,getRunningOperationPromise:L.removalWarning,getRunningMutationThunk:L.getRunningMutationThunk,getRunningMutationsThunk:L.getRunningMutationsThunk,getRunningQueryThunk:L.getRunningQueryThunk,getRunningQueriesThunk:L.getRunningQueriesThunk}),{name:Wt,injectEndpoint:function(t,n){var r,i=e;null!=(r=i.endpoints)[t]||(r[t]={}),pt(n)?Ut(i.endpoints[t],{name:t,select:U(t,n),initiate:B(t,n)},D(m,t)):n.type===rt.mutation&&Ut(i.endpoints[t],{name:t,select:W(),initiate:J(t)},D(R,t));}}}}},Bt=It(Lt()); | ||
var e;exports.QueryStatus = void 0;var n,r=undefined&&undefined.__extends||(e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);},e(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t;}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r);}),i=undefined&&undefined.__generator||function(e,t){var n,r,i,a,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u);}catch(e){a=[6,e],r=0;}finally{n=i=0;}if(5&a[0])throw a[1];return {value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},a=undefined&&undefined.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},u=Object.defineProperty,o=Object.defineProperties,c=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=function(e,t,n){return t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},p=function(e,t){for(var n in t||(t={}))f.call(t,n)&&d(e,n,t[n]);if(s)for(var r=0,i=s(t);r<i.length;r++)l.call(t,n=i[r])&&d(e,n,t[n]);return e},v=function(e,t){return o(e,c(t))},h=function(e,t){var n={};for(var r in e)f.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var i=0,a=s(e);i<a.length;i++)t.indexOf(r=a[i])<0&&l.call(e,r)&&(n[r]=e[r]);return n},y=function(e,t,n){return new Promise((function(r,i){var a=function(e){try{o(n.next(e));}catch(e){i(e);}},u=function(e){try{o(n.throw(e));}catch(e){i(e);}},o=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(a,u)};o((n=n.apply(e,t)).next());}))};(n=exports.QueryStatus||(exports.QueryStatus={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var g,m,b=function(e){return [].concat.apply([],e)};function O(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return "'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function w(e){return !!e&&!!e[ue]}function S(e){var t;return !!e&&(function(e){if(!e||"object"!=typeof e)return !1;var t=Object.getPrototypeOf(e);if(null===t)return !0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===oe}(e)||Array.isArray(e)||!!e[ae]||!!(null===(t=e.constructor)||void 0===t?void 0:t[ae])||k(e)||x(e))}function j(e,t,n){void 0===n&&(n=!1),0===q(e)?(n?Object.keys:ce)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e);})):e.forEach((function(n,r){return t(r,n,e)}));}function q(e){var t=e[ue];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:k(e)?2:x(e)?3:0}function A(e,t){return 2===q(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function R(e,t){return 2===q(e)?e.get(t):e[t]}function P(e,t,n){var r=q(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n;}function T(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function k(e){return te&&e instanceof Map}function x(e){return ne&&e instanceof Set}function I(e){return e.o||e.t}function C(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=se(e);delete t[ue];for(var n=ce(t),r=0;r<n.length;r++){var i=n[r],a=t[i];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]});}return Object.create(Object.getPrototypeOf(e),t)}function E(e,t){return void 0===t&&(t=!1),Q(e)||w(e)||!S(e)||(q(e)>1&&(e.set=e.add=e.clear=e.delete=N),Object.freeze(e),t&&j(e,(function(e,t){return E(t,!0)}),!0)),e}function N(){O(2);}function Q(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function M(e){var t=fe[e];return t||O(18,e),t}function D(e,t){fe[e]||(fe[e]=t);}function _(){return m}function K(e,t){t&&(M("Patches"),e.u=[],e.s=[],e.v=t);}function F(e){z(e),e.p.forEach(W),e.p=null;}function z(e){e===m&&(m=e.l);}function U(e){return m={p:[],l:m,h:e,m:!0,_:0}}function W(e){var t=e[ue];0===t.i||1===t.i?t.j():t.g=!0;}function B(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||M("ES5").S(t,e,r),r?(n[ue].P&&(F(t),O(4)),S(e)&&(e=L(t,e),t.l||H(t,e)),t.u&&M("Patches").M(n[ue].t,e,t.u,t.s)):e=L(t,n,[]),F(t),t.u&&t.v(t.u,t.s),e!==ie?e:void 0}function L(e,t,n){if(Q(t))return t;var r=t[ue];if(!r)return j(t,(function(i,a){return J(e,r,t,i,a,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return H(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=C(r.k):r.o,a=i,u=!1;3===r.i&&(a=new Set(i),i.clear(),u=!0),j(a,(function(t,a){return J(e,r,i,t,a,n,u)})),H(e,i,!1),n&&e.u&&M("Patches").N(r,n,e.u,e.s);}return r.o}function J(e,t,n,r,i,a,u){if(w(i)){var o=L(e,i,a&&t&&3!==t.i&&!A(t.R,r)?a.concat(r):void 0);if(P(n,r,o),!w(o))return;e.m=!1;}else u&&n.add(i);if(S(i)&&!Q(i)){if(!e.h.D&&e._<1)return;L(e,i),t&&t.A.l||H(e,i);}}function H(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&E(t,n);}function V(e,t){var n=e[ue];return (n?I(n):e)[t]}function G(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n);}}function $(e){e.P||(e.P=!0,e.l&&$(e.l));}function X(e){e.o||(e.o=C(e.t));}function Y(e,t,n){var r=k(t)?M("MapSet").F(t,n):x(t)?M("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:_(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,a=le;n&&(i=[r],a=de);var u=Proxy.revocable(i,a),o=u.revoke,c=u.proxy;return r.k=c,r.j=o,c}(t,n):M("ES5").J(t,n);return (n?n.A:_()).p.push(r),r}function Z(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return C(e)}var ee="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),te="undefined"!=typeof Map,ne="undefined"!=typeof Set,re="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,ie=ee?Symbol.for("immer-nothing"):((g={})["immer-nothing"]=!0,g),ae=ee?Symbol.for("immer-draftable"):"__$immer_draftable",ue=ee?Symbol.for("immer-state"):"__$immer_state",oe=(""+Object.prototype.constructor),ce="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,se=Object.getOwnPropertyDescriptors||function(e){var t={};return ce(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n);})),t},fe={},le={get:function(e,t){if(t===ue)return e;var n,r,i,a=I(e);if(!A(a,t))return n=e,(i=G(a,t))?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(n.k):void 0;var u=a[t];return e.I||!S(u)?u:u===V(e.t,t)?(X(e),e.o[t]=Y(e.A.h,u,e)):u},has:function(e,t){return t in I(e)},ownKeys:function(e){return Reflect.ownKeys(I(e))},set:function(e,t,n){var r=G(I(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=V(I(e),t),a=null==i?void 0:i[ue];if(a&&a.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(T(n,i)&&(void 0!==n||A(e.t,t)))return !0;X(e),$(e);}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==V(e.t,t)||t in e.t?(e.R[t]=!1,X(e),$(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=I(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){O(11);},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){O(12);}},de={};j(le,(function(e,t){de[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};})),de.deleteProperty=function(e,t){return de.set.call(this,e,t,void 0)},de.set=function(e,t,n){return le.set.call(this,e[0],t,n,e[0])};var pe=new(function(){function e(e){var t=this;this.O=re,this.D=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var i=n;n=e;var a=t;return function(e){var t=this;void 0===e&&(e=i);for(var r=arguments.length,u=Array(r>1?r-1:0),o=1;o<r;o++)u[o-1]=arguments[o];return a.produce(e,(function(e){var r;return (r=n).call.apply(r,[t,e].concat(u))}))}}var u;if("function"!=typeof n&&O(6),void 0!==r&&"function"!=typeof r&&O(7),S(e)){var o=U(t),c=Y(t,e,void 0),s=!0;try{u=n(c),s=!1;}finally{s?F(o):z(o);}return "undefined"!=typeof Promise&&u instanceof Promise?u.then((function(e){return K(o,r),B(e,o)}),(function(e){throw F(o),e})):(K(o,r),B(u,o))}if(!e||"object"!=typeof e){if(void 0===(u=n(e))&&(u=e),u===ie&&(u=void 0),t.D&&E(u,!0),r){var f=[],l=[];M("Patches").M(e,u,f,l),r(f,l);}return u}O(21,e);},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))};var r,i,a=t.produce(e,n,(function(e,t){r=e,i=t;}));return "undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return [e,r,i]})):[a,r,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze);}var t=e.prototype;return t.createDraft=function(e){S(e)||O(8),w(e)&&(e=function(e){return w(e)||O(22,e),function e(t){if(!S(t))return t;var n,r=t[ue],i=q(t);if(r){if(!r.P&&(r.i<4||!M("ES5").K(r)))return r.t;r.I=!0,n=Z(t,i),r.I=!1;}else n=Z(t,i);return j(n,(function(t,i){r&&R(r.t,t)===i||P(n,t,e(i));})),3===i?new Set(n):n}(e)}(e));var t=U(this),n=Y(this,e,void 0);return n[ue].C=!0,z(t),n},t.finishDraft=function(e,t){var n=(e&&e[ue]).A;return K(n,t),B(void 0,n)},t.setAutoFreeze=function(e){this.D=e;},t.setUseProxies=function(e){e&&!re&&O(20),this.O=e;},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var i=M("Patches").$;return w(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}()),ve=pe.produce,he=pe.produceWithPatches.bind(pe),ye=(pe.setAutoFreeze.bind(pe),pe.setUseProxies.bind(pe),pe.applyPatches.bind(pe)),ge=(pe.createDraft.bind(pe),pe.finishDraft.bind(pe),ve);function me(e){return "Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var be=function(){return Math.random().toString(36).substring(7).split("").join(".")},Oe={INIT:"@@redux/INIT"+be(),REPLACE:"@@redux/REPLACE"+be(),PROBE_UNKNOWN_ACTION:function(){return "@@redux/PROBE_UNKNOWN_ACTION"+be()}},we=function(e,t){return e===t};function Se(e,t){var n,r,i,a="object"==typeof t?t:{equalityCheck:t},u=a.equalityCheck,o=a.maxSize,c=void 0===o?1:o,s=a.resultEqualityCheck,f=(i=void 0===u?we:u,function(e,t){if(null===e||null===t||e.length!==t.length)return !1;for(var n=e.length,r=0;r<n;r++)if(!i(e[r],t[r]))return !1;return !0}),l=1===c?(n=f,{get:function(e){return r&&n(r.key,e)?r.value:"NOT_FOUND"},put:function(e,t){r={key:e,value:t};},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0;}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var i=n[r];return r>0&&(n.splice(r,1),n.unshift(i)),i.value}return "NOT_FOUND"}return {get:r,put:function(t,i){"NOT_FOUND"===r(t)&&(n.unshift({key:t,value:i}),n.length>e&&n.pop());},getEntries:function(){return n},clear:function(){n=[];}}}(c,f);function d(){var t=l.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),s){var n=l.getEntries(),r=n.find((function(e){return s(e.value,t)}));r&&(t=r.value);}l.put(arguments,t);}return t}return d.clearCache=function(){return l.clear()},d}function je(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return "function"==typeof e}))){var n=t.map((function(e){return "function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function qe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a,u=0,o={memoizeOptions:void 0},c=r.pop();if("object"==typeof c&&(o=c,c=r.pop()),"function"!=typeof c)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof c+"]");var s=o,f=s.memoizeOptions,l=void 0===f?n:f,d=Array.isArray(l)?l:[l],p=je(r),v=e.apply(void 0,[function(){return u++,c.apply(null,arguments)}].concat(d)),h=e((function(){for(var e=[],t=p.length,n=0;n<t;n++)e.push(p[n].apply(null,arguments));return a=v.apply(null,e)}));return Object.assign(h,{resultFunc:c,memoizedResultFunc:v,dependencies:p,lastResult:function(){return a},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),h};return i}var Ae=qe(Se);function Re(e){if("object"!=typeof e||null===e)return !1;var t=Object.getPrototypeOf(e);if(null===t)return !0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}function Pe(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return p(p({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return {type:e,payload:n[0]}}return n.toString=function(){return ""+e},n.type=e,n.match=function(t){return t.type===e},n}function Te(e){return S(e)?ge(e,(function(){})):e}function ke(e){var t,n={},r=[],i={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in n)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return n[r]=t,i},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return t=e,i}};return e(i),[n,r,t]}function xe(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:Te(e.initialState),i=e.reducers||{},u=Object.keys(i),o={},c={},s={};function f(){var t="function"==typeof e.extraReducers?ke(e.extraReducers):[e.extraReducers],n=t[0],i=t[1],u=void 0===i?[]:i,o=t[2],s=void 0===o?void 0:o,f=p(p({},void 0===n?{}:n),c);return function(e,t,n,r){var i,u=ke(t),o=u[0],c=u[1],s=u[2];if("function"==typeof e)i=function(){return Te(e())};else {var f=Te(e);i=function(){return f};}function l(e,t){void 0===e&&(e=i());var n=a([o[t.type]],c.filter((function(e){return (0, e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return !!e})).length&&(n=[s]),n.reduce((function(e,n){if(n){var r;if(w(e))return void 0===(r=n(e,t))?e:r;if(S(e))return ge(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return l.getInitialState=i,l}(r,(function(e){for(var t in f)e.addCase(t,f[t]);for(var n=0,r=u;n<r.length;n++){var i=r[n];e.addMatcher(i.matcher,i.reducer);}s&&e.addDefaultCase(s);}))}return u.forEach((function(e){var n,r,a=i[e],u=t+"/"+e;"reducer"in a?(n=a.reducer,r=a.prepare):n=a,o[e]=n,c[u]=n,s[e]=r?Pe(u,r):Pe(u);})),{name:t,reducer:function(e,t){return n||(n=f()),n(e,t)},actions:s,caseReducers:o,getInitialState:function(){return n||(n=f()),n.getInitialState()}}}((function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}r(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,a([void 0],e[0].concat(this)))):new(t.bind.apply(t,a([void 0],e.concat(this))))};}))(Array),function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}r(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,a([void 0],e[0].concat(this)))):new(t.bind.apply(t,a([void 0],e.concat(this))))};}(Array);var Ie=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},Ce=["name","message","stack","code"],Ee=function(e,t){this.payload=e,this.meta=t;},Ne=function(e,t){this.payload=e,this.meta=t;},Qe=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Ce;n<r.length;n++){var i=r[n];"string"==typeof e[i]&&(t[i]=e[i]);}return t}return {message:String(e)}},Me=function(){function e(e,t,n){var r=Pe(e+"/fulfilled",(function(e,t,n,r){return {payload:e,meta:v(p({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),a=Pe(e+"/pending",(function(e,t,n){return {payload:void 0,meta:v(p({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),u=Pe(e+"/rejected",(function(e,t,r,i,a){return {payload:i,error:(n&&n.serializeError||Qe)(e||"Rejected"),meta:v(p({},a||{}),{arg:r,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),o="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return !1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}};}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(c,s,f){var l,d=(null==n?void 0:n.idGenerator)?n.idGenerator(e):Ie(),p=new o;function v(e){l=e,p.abort();}var h=function(){return y(this,null,(function(){var o,h,y,g,m,b;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),null===(O=g=null==(o=null==n?void 0:n.condition)?void 0:o.call(n,e,{getState:s,extra:f}))||"object"!=typeof O||"function"!=typeof O.then?[3,2]:[4,g];case 1:g=i.sent(),i.label=2;case 2:if(!1===g||p.signal.aborted)throw {name:"ConditionError",message:"Aborted due to condition callback returning false."};return m=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:l||"Aborted"})}))})),c(a(d,e,null==(h=null==n?void 0:n.getPendingMeta)?void 0:h.call(n,{requestId:d,arg:e},{getState:s,extra:f}))),[4,Promise.race([m,Promise.resolve(t(e,{dispatch:c,getState:s,extra:f,requestId:d,signal:p.signal,abort:v,rejectWithValue:function(e,t){return new Ee(e,t)},fulfillWithValue:function(e,t){return new Ne(e,t)}})).then((function(t){if(t instanceof Ee)throw t;return t instanceof Ne?r(t.payload,d,e,t.meta):r(t,d,e)}))])];case 3:return y=i.sent(),[3,5];case 4:return b=i.sent(),y=b instanceof Ee?u(null,d,e,b.payload,b.meta):u(b,d,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&u.match(y)&&y.meta.condition||c(y),[2,y]}var O;}))}))}();return Object.assign(h,{abort:v,requestId:d,arg:e,unwrap:function(){return h.then(De)}})}}),{pending:a,rejected:u,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function De(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var _e=function(e,t){return (n=e)&&"function"==typeof n.match?e.match(t):e(t);var n;};function Ke(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return _e(e,t)}))}}function Fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.every((function(e){return _e(e,t)}))}}function ze(e,t){if(!e||!e.meta)return !1;var n="string"==typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function Ue(e){return "function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function We(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return ze(e,["pending"])}:Ue(e)?function(t){var n=e.map((function(e){return e.pending}));return Ke.apply(void 0,n)(t)}:We()(e[0])}function Be(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return ze(e,["rejected"])}:Ue(e)?function(t){var n=e.map((function(e){return e.rejected}));return Ke.apply(void 0,n)(t)}:Be()(e[0])}function Le(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||Ue(e)?function(t){return Fe(Be.apply(void 0,e),n)(t)}:Le()(e[0])}function Je(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return ze(e,["fulfilled"])}:Ue(e)?function(t){var n=e.map((function(e){return e.fulfilled}));return Ke.apply(void 0,n)(t)}:Je()(e[0])}function He(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return ze(e,["pending","fulfilled","rejected"])}:Ue(e)?function(t){for(var n=[],r=0,i=e;r<i.length;r++){var a=i[r];n.push(a.pending,a.rejected,a.fulfilled);}return Ke.apply(void 0,n)(t)}:He()(e[0])}"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){return le.get(this[ue],e)},set:function(t){le.set(this[ue],e,t);}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][ue];if(!i.P)switch(i.i){case 5:r(i)&&$(i);break;case 4:n(i)&&$(i);}}}function n(e){for(var t=e.t,n=e.k,r=ce(n),i=r.length-1;i>=0;i--){var a=r[i];if(a!==ue){var u=t[a];if(void 0===u&&!A(t,a))return !0;var o=n[a],c=o&&o[ue];if(c?c.t!==u:!T(o,u))return !0}}var s=!!t[ue];return r.length!==ce(t).length+(s?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return !0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return !0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return !0;return !1}var i={};D("ES5",{J:function(t,n){var r=Array.isArray(t),i=function(t,n){if(t){for(var r=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,""+i,e(i,!0));return r}var a=se(n);delete a[ue];for(var u=ce(a),o=0;o<u.length;o++){var c=u[o];a[c]=e(c,t||!!a[c].enumerable);}return Object.create(Object.getPrototypeOf(n),a)}(r,t),a={i:r?5:4,A:n?n.A:_(),P:!1,I:!1,R:{},l:n,t:t,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,ue,{value:a,writable:!0}),i},S:function(e,n,i){i?w(n)&&n[ue].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[ue];if(n){var i=n.t,a=n.k,u=n.R,o=n.i;if(4===o)j(a,(function(t){t!==ue&&(void 0!==i[t]||A(i,t)?u[t]||e(a[t]):(u[t]=!0,$(n)));})),j(i,(function(e){void 0!==a[e]||A(a,e)||(u[e]=!1,$(n));}));else if(5===o){if(r(n)&&($(n),u.length=!0),a.length<i.length)for(var c=a.length;c<i.length;c++)u[c]=!1;else for(var s=i.length;s<a.length;s++)u[s]=!0;for(var f=Math.min(a.length,i.length),l=0;l<f;l++)a.hasOwnProperty(l)||(u[l]=!0),void 0===u[l]&&e(a[l]);}}}}(e.p[0]),t(e.p));},K:function(e){return 4===e.i?n(e):r(e)}});}();var Ve=Re;function Ge(e,t){if(e===t||!(Ve(e)&&Ve(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,a=Array.isArray(t)?[]:{},u=0,o=n;u<o.length;u++){var c=o[u];a[c]=Ge(e[c],t[c]),i&&(i=e[c]===a[c]);}return i?e:a}var $e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},Xe=function(e){return e.status>=200&&e.status<=299},Ye=function(e){return /ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function Ze(e){if(!Re(e))return e;for(var t=p({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n];void 0===i[1]&&delete t[i[0]];}return t}function et(e){var t=this;void 0===e&&(e={});var n=e.baseUrl,r=e.prepareHeaders,a=void 0===r?function(e){return e}:r,u=e.fetchFn,o=void 0===u?$e:u,c=e.paramsSerializer,s=e.isJsonContentType,f=void 0===s?Ye:s,l=e.jsonContentType,d=void 0===l?"application/json":l,g=e.jsonReplacer,m=e.timeout,b=e.responseHandler,O=e.validateStatus,w=h(e,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return "undefined"==typeof fetch&&o===$e&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(e,r){return y(t,null,(function(){var t,u,s,l,y,j,q,A,R,P,T,k,x,I,C,E,N,Q,M,D,_,K,F,z,U,W,B,L,J,H,V,G,$,X,Y,Z;return i(this,(function(i){switch(i.label){case 0:return t=r.signal,u=r.getState,s=r.extra,l=r.endpoint,y=r.forced,j=r.type,R=(A="string"==typeof e?{url:e}:e).url,T=void 0===(P=A.headers)?new Headers(w.headers):P,x=void 0===(k=A.params)?void 0:k,C=void 0===(I=A.responseHandler)?null!=b?b:"json":I,N=void 0===(E=A.validateStatus)?null!=O?O:Xe:E,M=void 0===(Q=A.timeout)?m:Q,D=h(A,["url","headers","params","responseHandler","validateStatus","timeout"]),_=p(v(p({},w),{signal:t}),D),T=new Headers(Ze(T)),K=_,[4,a(T,{getState:u,extra:s,endpoint:l,forced:y,type:j})];case 1:K.headers=i.sent()||T,F=function(e){return "object"==typeof e&&(Re(e)||Array.isArray(e)||"function"==typeof e.toJSON)},!_.headers.has("content-type")&&F(_.body)&&_.headers.set("content-type",d),F(_.body)&&f(_.headers)&&(_.body=JSON.stringify(_.body,g)),x&&(z=~R.indexOf("?")?"&":"?",U=c?c(x):new URLSearchParams(Ze(x)),R+=z+U),R=function(e,t){if(!e)return t;if(!t)return e;if(function(e){return new RegExp("(^|:)//").test(e)}(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=function(e){return e.replace(/\/$/,"")}(e),""+e+n+function(e){return e.replace(/^\//,"")}(t)}(n,R),W=new Request(R,_),B=new Request(R,_),q={request:B},J=!1,H=M&&setTimeout((function(){J=!0,r.abort();}),M),i.label=2;case 2:return i.trys.push([2,4,5,6]),[4,o(W)];case 3:return L=i.sent(),[3,6];case 4:return V=i.sent(),[2,{error:{status:J?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(V)},meta:q}];case 5:return H&&clearTimeout(H),[7];case 6:G=L.clone(),q.response=G,X="",i.label=7;case 7:return i.trys.push([7,9,,10]),[4,Promise.all([S(L,C).then((function(e){return $=e}),(function(e){return Y=e})),G.text().then((function(e){return X=e}),(function(){}))])];case 8:if(i.sent(),Y)throw Y;return [3,10];case 9:return Z=i.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:L.status,data:X,error:String(Z)},meta:q}];case 10:return [2,N(L,$)?{data:$,meta:q}:{error:{status:L.status,data:$},meta:q}]}}))}))};function S(e,t){return y(this,null,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return "function"==typeof t?[2,t(e)]:("content-type"===t&&(t=f(e.headers)?"json":"text"),"json"!==t?[3,2]:[4,e.text()]);case 1:return [2,(n=r.sent()).length?JSON.parse(n):null];case 2:return [2,e.text()]}}))}))}}var tt=function(e,t){void 0===t&&(t=void 0),this.value=e,this.meta=t;};function nt(e,t){return void 0===e&&(e=0),void 0===t&&(t=5),y(this,null,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return n=Math.min(e,t),r=~~((Math.random()+.4)*(300<<n)),[4,new Promise((function(e){return setTimeout((function(t){return e(t)}),r)}))];case 1:return i.sent(),[2]}}))}))}var rt,it,at={},ut=Object.assign((function(e,t){return function(n,r,a){return y(void 0,null,(function(){var u,o,c,s,f,l,d;return i(this,(function(i){switch(i.label){case 0:u=[5,(t||at).maxRetries,(a||at).maxRetries].filter((function(e){return void 0!==e})),o=u.slice(-1)[0],c=function(e,t,n){return n.attempt<=o},s=p(p({maxRetries:o,backoff:nt,retryCondition:c},t),a),f=0,i.label=1;case 1:i.label=2;case 2:return i.trys.push([2,4,,6]),[4,e(n,r,a)];case 3:if((l=i.sent()).error)throw new tt(l);return [2,l];case 4:if(d=i.sent(),f++,d.throwImmediately){if(d instanceof tt)return [2,d.value];throw d}return d instanceof tt&&!s.retryCondition(d.value.error,n,{attempt:f,baseQueryApi:r,extraOptions:a})?[2,d.value]:[4,s.backoff(f,s.maxRetries)];case 5:return i.sent(),[3,6];case 6:return [3,1];case 7:return [2]}}))}))}}),{fail:function(e){throw Object.assign(new tt({error:e}),{throwImmediately:!0})}}),ot=Pe("__rtkq/focused"),ct=Pe("__rtkq/unfocused"),st=Pe("__rtkq/online"),ft=Pe("__rtkq/offline"),lt=!1;function dt(e,t){return t?t(e,{onFocus:ot,onFocusLost:ct,onOffline:ft,onOnline:st}):(n=function(){return e(ot())},r=function(){return e(st())},i=function(){return e(ft())},a=function(){"visible"===window.document.visibilityState?n():e(ct());},lt||"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",n,!1),window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),lt=!0),function(){window.removeEventListener("focus",n),window.removeEventListener("visibilitychange",a),window.removeEventListener("online",r),window.removeEventListener("offline",i),lt=!1;});var n,r,i,a;}function pt(e){return e.type===rt.query}function vt(e,t,n,r,i,a){return "function"==typeof e?e(t,n,r,i).map(ht).map(a):Array.isArray(e)?e.map(ht).map(a):[]}function ht(e){return "string"==typeof e?{type:e}:e}function yt(e){return null!=e}(it=rt||(rt={})).query="query",it.mutation="mutation";var gt=Symbol("forceQueryFn"),mt=function(e){return "function"==typeof e[gt]};function bt(e){return e}function Ot(e,t,n,r){return vt(n[e.meta.arg.endpointName][t],Je(e)?e.payload:void 0,Le(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function wt(e,t,n){var r=e[t];r&&n(r);}function St(e){var t;return null!=(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)?t:e.requestId}function jt(e,t,n){var r=e[St(t)];r&&n(r);}var qt={},At=Symbol.for("RTKQ/skipToken"),Rt=At,Pt={status:exports.QueryStatus.uninitialized},Tt=ge(Pt,(function(){})),kt=ge(Pt,(function(){})),xt=WeakMap?new WeakMap:void 0,It=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=null==xt?void 0:xt.get(n);if("string"==typeof i)r=i;else {var a=JSON.stringify(n,(function(e,t){return Re(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}));Re(n)&&(null==xt||xt.set(n,a)),r=a;}return t+"("+r+")"};function Ct(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n=Se((function(e){var n,r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:null!=(n=t.reducerPath)?n:"api"})})),r=v(p({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{extractRehydrationInfo:n,serializeQueryArgs:function(e){var n=It;if("serializeQueryArgs"in e.endpointDefinition){var r=e.endpointDefinition.serializeQueryArgs;n=function(e){var t=r(e);return "string"==typeof t?t:It(v(p({},e),{queryArgs:t}))};}else t.serializeQueryArgs&&(n=t.serializeQueryArgs);return n(e)},tagTypes:a([],t.tagTypes||[])}),i={endpointDefinitions:{},batch:function(e){e();},apiUid:Ie(),extractRehydrationInfo:n,hasRehydrationInfo:Se((function(e){return null!=n(e)}))},u={injectEndpoints:function(e){for(var t=e.endpoints({query:function(e){return v(p({},e),{type:rt.query})},mutation:function(e){return v(p({},e),{type:rt.mutation})}}),n=0,r=Object.entries(t);n<r.length;n++){var a=r[n],c=a[0],s=a[1];if(e.overrideExisting||!(c in i.endpointDefinitions)){i.endpointDefinitions[c]=s;for(var f=0,l=o;f<l.length;f++)l[f].injectEndpoint(c,s);}}return u},enhanceEndpoints:function(e){var t=e.addTagTypes,n=e.endpoints;if(t)for(var a=0,o=t;a<o.length;a++){var c=o[a];r.tagTypes.includes(c)||r.tagTypes.push(c);}if(n)for(var s=0,f=Object.entries(n);s<f.length;s++){var l=f[s],d=l[0],p=l[1];"function"==typeof p?p(i.endpointDefinitions[d]):Object.assign(i.endpointDefinitions[d]||{},p);}return u}},o=e.map((function(e){return e.init(u,r,i)}));return u.injectEndpoints({endpoints:t.endpoints})}}function Et(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Nt,Qt=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,a=n.internalActions,u=a.removeQueryResult,o=a.unsubscribeQueryResult;function c(e){var t=i.currentSubscriptions[e];return !!t&&!function(e){for(var t in e)return !1;return !0}(t)}var s={};function f(e,t,n,i){var a,o=r.endpointDefinitions[t],f=null!=(a=null==o?void 0:o.keepUnusedDataFor)?a:i.keepUnusedDataFor;if(Infinity!==f){var l=Math.max(0,Math.min(f,2147482.647));if(!c(e)){var d=s[e];d&&clearTimeout(d),s[e]=setTimeout((function(){c(e)||n.dispatch(u({queryCacheKey:e})),delete s[e];}),1e3*l);}}}return function(e,i,a){var u;if(o.match(e)){var c=i.getState()[t];f(b=e.payload.queryCacheKey,null==(u=c.queries[b])?void 0:u.endpointName,i,c.config);}if(n.util.resetApiState.match(e))for(var l=0,d=Object.entries(s);l<d.length;l++){var p=d[l],v=p[0],h=p[1];h&&clearTimeout(h),delete s[v];}if(r.hasRehydrationInfo(e)){c=i.getState()[t];for(var y=r.extractRehydrationInfo(e).queries,g=0,m=Object.entries(y);g<m.length;g++){var b,O=m[g],w=O[1];f(b=O[0],null==w?void 0:w.endpointName,i,c.config);}}}},Mt=function(e){var n=e.reducerPath,r=e.context,i=e.context.endpointDefinitions,a=e.mutationThunk,u=e.api,o=e.assertTagType,c=e.refetchQuery,s=u.internalActions.removeQueryResult,f=Ke(Je(a),Le(a));function l(e,i){var a=i.getState(),o=a[n],f=u.util.selectInvalidatedBy(a,e);r.batch((function(){for(var e,n=0,r=Array.from(f.values());n<r.length;n++){var a=r[n].queryCacheKey,u=o.queries[a],l=null!=(e=o.subscriptions[a])?e:{};u&&(0===Object.keys(l).length?i.dispatch(s({queryCacheKey:a})):u.status!==exports.QueryStatus.uninitialized&&i.dispatch(c(u,a)));}}));}return function(e,t){f(e)&&l(Ot(e,"invalidatesTags",i,o),t),u.util.invalidateTags.match(e)&&l(vt(e.payload,void 0,void 0,void 0,void 0,o),t);}},Dt=function(e){var n=e.reducerPath,r=e.queryThunk,i=e.api,a=e.refetchQuery,u=e.internalState,o={};function c(e,r){var i=e.queryCacheKey,c=r.getState()[n].queries[i];if(c&&c.status!==exports.QueryStatus.uninitialized){var s=l(u.currentSubscriptions[i]);if(Number.isFinite(s)){var f=o[i];(null==f?void 0:f.timeout)&&(clearTimeout(f.timeout),f.timeout=void 0);var d=Date.now()+s,p=o[i]={nextPollTimestamp:d,pollingInterval:s,timeout:setTimeout((function(){p.timeout=void 0,r.dispatch(a(c,i));}),s)};}}}function s(e,r){var i=e.queryCacheKey,a=r.getState()[n].queries[i];if(a&&a.status!==exports.QueryStatus.uninitialized){var s=l(u.currentSubscriptions[i]);if(Number.isFinite(s)){var d=o[i],p=Date.now()+s;(!d||p<d.nextPollTimestamp)&&c({queryCacheKey:i},r);}else f(i);}}function f(e){var t=o[e];(null==t?void 0:t.timeout)&&clearTimeout(t.timeout),delete o[e];}function l(e){void 0===e&&(e={});var t=Number.POSITIVE_INFINITY;for(var n in e)e[n].pollingInterval&&(t=Math.min(e[n].pollingInterval,t));return t}return function(e,t){(i.internalActions.updateSubscriptionOptions.match(e)||i.internalActions.unsubscribeQueryResult.match(e))&&s(e.payload,t),(r.pending.match(e)||r.rejected.match(e)&&e.meta.condition)&&s(e.meta.arg,t),(r.fulfilled.match(e)||r.rejected.match(e)&&!e.meta.condition)&&c(e.meta.arg,t),i.util.resetApiState.match(e)&&function(){for(var e=0,t=Object.keys(o);e<t.length;e++)f(t[e]);}();}},_t=new Error("Promise never resolved before cacheEntryRemoved."),Kt=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,a=e.mutationThunk,u=He(i),o=He(a),c=Je(i,a),s={};function f(e,n,i,a,u){var o=r.endpointDefinitions[e],c=null==o?void 0:o.onCacheEntryAdded;if(c){var f={},l=new Promise((function(e){f.cacheEntryRemoved=e;})),d=Promise.race([new Promise((function(e){f.valueResolved=e;})),l.then((function(){throw _t}))]);d.catch((function(){})),s[i]=f;var h=t.endpoints[e].select(o.type===rt.query?n:i),y=a.dispatch((function(e,t,n){return n})),g=v(p({},a),{getCacheEntry:function(){return h(a.getState())},requestId:u,extra:y,updateCachedData:o.type===rt.query?function(r){return a.dispatch(t.util.updateQueryData(e,n,r))}:void 0,cacheDataLoaded:d,cacheEntryRemoved:l}),m=c(n,g);Promise.resolve(m).catch((function(e){if(e!==_t)throw e}));}}return function(e,r,l){var d=function(e){return u(e)?e.meta.arg.queryCacheKey:o(e)?e.meta.requestId:t.internalActions.removeQueryResult.match(e)?e.payload.queryCacheKey:t.internalActions.removeMutationResult.match(e)?St(e.payload):""}(e);if(i.pending.match(e)){var p=l[n].queries[d],v=r.getState()[n].queries[d];!p&&v&&f(e.meta.arg.endpointName,e.meta.arg.originalArgs,d,r,e.meta.requestId);}else if(a.pending.match(e))(v=r.getState()[n].mutations[d])&&f(e.meta.arg.endpointName,e.meta.arg.originalArgs,d,r,e.meta.requestId);else if(c(e))(null==(m=s[d])?void 0:m.valueResolved)&&(m.valueResolved({data:e.payload,meta:e.meta.baseQueryMeta}),delete m.valueResolved);else if(t.internalActions.removeQueryResult.match(e)||t.internalActions.removeMutationResult.match(e))(m=s[d])&&(delete s[d],m.cacheEntryRemoved());else if(t.util.resetApiState.match(e))for(var h=0,y=Object.entries(s);h<y.length;h++){var g=y[h],m=g[1];delete s[g[0]],m.cacheEntryRemoved();}}},Ft=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,a=We(r,i),u=Be(r,i),o=Je(r,i),c={};return function(e,r){var i,s,f;if(a(e)){var l=e.meta,d=l.requestId,h=l.arg,y=h.endpointName,g=h.originalArgs,m=n.endpointDefinitions[y],b=null==m?void 0:m.onQueryStarted;if(b){var O={},w=new Promise((function(e,t){O.resolve=e,O.reject=t;}));w.catch((function(){})),c[d]=O;var S=t.endpoints[y].select(m.type===rt.query?g:d),j=r.dispatch((function(e,t,n){return n})),q=v(p({},r),{getCacheEntry:function(){return S(r.getState())},requestId:d,extra:j,updateCachedData:m.type===rt.query?function(e){return r.dispatch(t.util.updateQueryData(y,g,e))}:void 0,queryFulfilled:w});b(g,q);}}else if(o(e)){var A=e.meta,R=A.baseQueryMeta;null==(i=c[d=A.requestId])||i.resolve({data:e.payload,meta:R}),delete c[d];}else if(u(e)){var P=e.meta;R=P.baseQueryMeta,null==(f=c[d=P.requestId])||f.reject({error:null!=(s=e.payload)?s:e.error,isUnhandledError:!P.rejectedWithValue,meta:R}),delete c[d];}}},zt=function(e){var t=e.api,n=e.context.apiUid;return function(e,r){t.util.resetApiState.match(e)&&r.dispatch(t.internalActions.middlewareRegistered(n));}},Ut="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):function(e){return (Nt||(Nt=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}),0)}))};function Wt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,a([e],t));}var Bt=Symbol(),Lt=function(){return {name:Bt,init:function(e,n,r){var u=n.baseQuery,o=n.reducerPath,c=n.serializeQueryArgs,s=n.keepUnusedDataFor,f=n.refetchOnMountOrArgChange,l=n.refetchOnFocus,d=n.refetchOnReconnect;!function(){function e(t){if(!S(t))return t;if(Array.isArray(t))return t.map(e);if(k(t))return new Map(Array.from(t.entries()).map((function(t){return [t[0],e(t[1])]})));if(x(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return A(t,ae)&&(n[ae]=t[ae]),n}function t(t){return w(t)?e(t):t}var n="add";D("Patches",{$:function(t,r){return r.forEach((function(r){for(var i=r.path,a=r.op,u=t,o=0;o<i.length-1;o++){var c=q(u),s=i[o];"string"!=typeof s&&"number"!=typeof s&&(s=""+s),0!==c&&1!==c||"__proto__"!==s&&"constructor"!==s||O(24),"function"==typeof u&&"prototype"===s&&O(24),"object"!=typeof(u=R(u,s))&&O(15,i.join("/"));}var f=q(u),l=e(r.value),d=i[i.length-1];switch(a){case"replace":switch(f){case 2:return u.set(d,l);case 3:O(16);default:return u[d]=l}case n:switch(f){case 1:return "-"===d?u.push(l):u.splice(d,0,l);case 2:return u.set(d,l);case 3:return u.add(l);default:return u[d]=l}case"remove":switch(f){case 1:return u.splice(d,1);case 2:return u.delete(d);case 3:return u.delete(r.value);default:return delete u[d]}default:O(17,a);}})),t},N:function(e,r,i,a){switch(e.i){case 0:case 4:case 2:return o=r,c=i,s=a,f=(u=e).t,l=u.o,void j(u.R,(function(e,r){var i=R(f,e),a=R(l,e),u=r?A(f,e)?"replace":n:"remove";if(i!==a||"replace"!==u){var d=o.concat(e);c.push("remove"===u?{op:u,path:d}:{op:u,path:d,value:a}),s.push(u===n?{op:"remove",path:d}:"remove"===u?{op:n,path:d,value:t(i)}:{op:"replace",path:d,value:t(i)});}}));case 5:case 1:return function(e,r,i,a){var u=e.t,o=e.R,c=e.o;if(c.length<u.length){var s=[c,u];u=s[0],c=s[1];var f=[a,i];i=f[0],a=f[1];}for(var l=0;l<u.length;l++)if(o[l]&&c[l]!==u[l]){var d=r.concat([l]);i.push({op:"replace",path:d,value:t(c[l])}),a.push({op:"replace",path:d,value:t(u[l])});}for(var p=u.length;p<c.length;p++){var v=r.concat([p]);i.push({op:n,path:v,value:t(c[p])});}u.length<c.length&&a.push({op:"replace",path:r.concat(["length"]),value:u.length});}(e,r,i,a);case 3:return function(e,t,r,i){var a=e.t,u=e.o,o=0;a.forEach((function(e){if(!u.has(e)){var a=t.concat([o]);r.push({op:"remove",path:a,value:e}),i.unshift({op:n,path:a,value:e});}o++;})),o=0,u.forEach((function(e){if(!a.has(e)){var u=t.concat([o]);r.push({op:n,path:u,value:e}),i.unshift({op:"remove",path:u,value:e});}o++;}));}(e,r,i,a)}var u,o,c,s,f,l;},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t===ie?void 0:t}),r.push({op:"replace",path:[],value:e});}});}();var h=function(e){return e};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:st,onOffline:ft,onFocus:ot,onFocusLost:ct},util:{}});var g=function(e){var n=this,r=e.reducerPath,a=e.baseQuery,u=e.context.endpointDefinitions,o=e.serializeQueryArgs,c=e.api,s=e.assertTagType,f=function(e,t){return y(n,[e,t],(function(e,t){var n,r,o,c,s,f,d,p,v,h,y,g,m,b=t.signal,O=t.abort,w=t.rejectWithValue,S=t.fulfillWithValue,j=t.dispatch,q=t.getState,A=t.extra;return i(this,(function(t){switch(t.label){case 0:n=u[e.endpointName],t.label=1;case 1:return t.trys.push([1,8,,13]),r=bt,o=void 0,c={signal:b,abort:O,dispatch:j,getState:q,extra:A,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?l(e,q()):void 0},(s="query"===e.type?e[gt]:void 0)?(o=s(),[3,6]):[3,2];case 2:return n.query?[4,a(n.query(e.originalArgs),c,n.extraOptions)]:[3,4];case 3:return o=t.sent(),n.transformResponse&&(r=n.transformResponse),[3,6];case 4:return [4,n.queryFn(e.originalArgs,c,n.extraOptions,(function(e){return a(e,c,n.extraOptions)}))];case 5:o=t.sent(),t.label=6;case 6:if(o.error)throw new tt(o.error,o.meta);return f=S,[4,r(o.data,o.meta,e.originalArgs)];case 7:return [2,f.apply(void 0,[t.sent(),(g={fulfilledTimeStamp:Date.now(),baseQueryMeta:o.meta},g.RTK_autoBatch=!0,g)])];case 8:if(d=t.sent(),!((p=d)instanceof tt))return [3,12];v=bt,n.query&&n.transformErrorResponse&&(v=n.transformErrorResponse),t.label=9;case 9:return t.trys.push([9,11,,12]),h=w,[4,v(p.value,p.meta,e.originalArgs)];case 10:return [2,h.apply(void 0,[t.sent(),(m={baseQueryMeta:p.meta},m.RTK_autoBatch=!0,m)])];case 11:return y=t.sent(),p=y,[3,12];case 12:throw console.error(p),p;case 13:return [2]}}))}))};function l(e,t){var n,i,a,u,o=null==(i=null==(n=t[r])?void 0:n.queries)?void 0:i[e.queryCacheKey],c=null==(a=t[r])?void 0:a.config.refetchOnMountOrArgChange,s=null==o?void 0:o.fulfilledTimeStamp,f=null!=(u=e.forceRefetch)?u:e.subscribe&&c;return !!f&&(!0===f||(Number(new Date)-Number(s))/1e3>=f)}var d=Me(r+"/executeQuery",f,{getPendingMeta:function(){var e;return (e={startedTimeStamp:Date.now()}).RTK_autoBatch=!0,e},condition:function(e,t){var n,i,a,o=(0, t.getState)(),c=null==(i=null==(n=o[r])?void 0:n.queries)?void 0:i[e.queryCacheKey],s=null==c?void 0:c.fulfilledTimeStamp,f=e.originalArgs,d=null==c?void 0:c.originalArgs,p=u[e.endpointName];return !(!mt(e)&&("pending"===(null==c?void 0:c.status)||!l(e,o)&&(!pt(p)||!(null==(a=null==p?void 0:p.forceRefetch)?void 0:a.call(p,{currentArg:f,previousArg:d,endpointState:c,state:o})))&&s))},dispatchConditionRejection:!0}),p=Me(r+"/executeMutation",f,{getPendingMeta:function(){var e;return (e={startedTimeStamp:Date.now()}).RTK_autoBatch=!0,e}});function v(e){return function(t){var n,r;return (null==(r=null==(n=null==t?void 0:t.meta)?void 0:n.arg)?void 0:r.endpointName)===e}}return {queryThunk:d,mutationThunk:p,prefetch:function(e,t,n){return function(r,i){var a=function(e){return "force"in e}(n)&&n.force,u=function(e){return "ifOlderThan"in e}(n)&&n.ifOlderThan,o=function(n){return void 0===n&&(n=!0),c.endpoints[e].initiate(t,{forceRefetch:n})},s=c.endpoints[e].select(t)(i());if(a)r(o());else if(u){var f=null==s?void 0:s.fulfilledTimeStamp;if(!f)return void r(o());(Number(new Date)-Number(new Date(f)))/1e3>=u&&r(o());}else r(o(!1));}},updateQueryData:function(e,n,r,i){return void 0===i&&(i=!0),function(a,u){var o,s,f,l=c.endpoints[e].select(n)(u()),d={patches:[],inversePatches:[],undo:function(){return a(c.util.patchQueryData(e,n,d.inversePatches,i))}};if(l.status===exports.QueryStatus.uninitialized)return d;if("data"in l)if(S(l.data)){var p=he(l.data,r),v=p[0],h=p[2];(o=d.patches).push.apply(o,p[1]),(s=d.inversePatches).push.apply(s,h),f=v;}else f=r(l.data),d.patches.push({op:"replace",path:[],value:f}),d.inversePatches.push({op:"replace",path:[],value:l.data});return a(c.util.patchQueryData(e,n,d.patches,i)),d}},upsertQueryData:function(e,t,n){return function(r){var i;return r(c.endpoints[e].initiate(t,((i={subscribe:!1,forceRefetch:!0})[gt]=function(){return {data:n}},i)))}},patchQueryData:function(e,t,n,r){return function(i,a){var f=u[e],l=o({queryArgs:t,endpointDefinition:f,endpointName:e});if(i(c.internalActions.queryResultPatched({queryCacheKey:l,patches:n})),r){var d=c.endpoints[e].select(t)(a()),p=vt(f.providesTags,d.data,void 0,t,{},s);i(c.internalActions.updateProvidedBy({queryCacheKey:l,providedTags:p}));}}},buildMatchThunkActions:function(e,t){return {matchPending:Fe(We(e),v(t)),matchFulfilled:Fe(Je(e),v(t)),matchRejected:Fe(Be(e),v(t))}}}}({baseQuery:u,reducerPath:o,context:r,api:e,serializeQueryArgs:c,assertTagType:h}),m=g.queryThunk,P=g.mutationThunk,T=g.patchQueryData,I=g.updateQueryData,C=g.upsertQueryData,E=g.prefetch,N=g.buildMatchThunkActions,Q=function(e){var n=e.reducerPath,r=e.queryThunk,i=e.mutationThunk,a=e.context,u=a.endpointDefinitions,o=a.apiUid,c=a.extractRehydrationInfo,s=a.hasRehydrationInfo,f=e.assertTagType,l=e.config,d=Pe(n+"/resetApiState"),h=xe({name:n+"/queries",initialState:qt,reducers:{removeQueryResult:{reducer:function(e,t){delete e[t.payload.queryCacheKey];},prepare:function(e){var t;return {payload:e,meta:(t={},t.RTK_autoBatch=!0,t)}}},queryResultPatched:{reducer:function(e,t){var n=t.payload,r=n.patches;wt(e,n.queryCacheKey,(function(e){e.data=ye(e.data,r.concat());}));},prepare:function(e){var t;return {payload:e,meta:(t={},t.RTK_autoBatch=!0,t)}}}},extraReducers:function(e){e.addCase(r.pending,(function(e,n){var r,i=n.meta,a=n.meta.arg,u=mt(a);(a.subscribe||u)&&(null!=e[r=a.queryCacheKey]||(e[r]={status:exports.QueryStatus.uninitialized,endpointName:a.endpointName})),wt(e,a.queryCacheKey,(function(e){e.status=exports.QueryStatus.pending,e.requestId=u&&e.requestId?e.requestId:i.requestId,void 0!==a.originalArgs&&(e.originalArgs=a.originalArgs),e.startedTimeStamp=i.startedTimeStamp;}));})).addCase(r.fulfilled,(function(e,n){var r=n.meta,i=n.payload;wt(e,r.arg.queryCacheKey,(function(e){var n;if(e.requestId===r.requestId||mt(r.arg)){var a,o=u[r.arg.endpointName].merge;if(e.status=exports.QueryStatus.fulfilled,o)if(void 0!==e.data){var c=r.fulfilledTimeStamp,s=r.arg,f=r.baseQueryMeta,l=r.requestId,d=ge(e.data,(function(e){return o(e,i,{arg:s.originalArgs,baseQueryMeta:f,fulfilledTimeStamp:c,requestId:l})}));e.data=d;}else e.data=i;else e.data=null==(n=u[r.arg.endpointName].structuralSharing)||n?Ge(w(e.data)?(w(a=e.data)||O(23,a),a[ue].t):e.data,i):i;delete e.error,e.fulfilledTimeStamp=r.fulfilledTimeStamp;}}));})).addCase(r.rejected,(function(e,n){var r=n.meta,i=r.condition,a=r.requestId,u=n.error,o=n.payload;wt(e,r.arg.queryCacheKey,(function(e){if(i);else {if(e.requestId!==a)return;e.status=exports.QueryStatus.rejected,e.error=null!=o?o:u;}}));})).addMatcher(s,(function(e,n){for(var r=c(n).queries,i=0,a=Object.entries(r);i<a.length;i++){var u=a[i],o=u[1];(null==o?void 0:o.status)!==exports.QueryStatus.fulfilled&&(null==o?void 0:o.status)!==exports.QueryStatus.rejected||(e[u[0]]=o);}}));}}),y=xe({name:n+"/mutations",initialState:qt,reducers:{removeMutationResult:{reducer:function(e,t){var n=St(t.payload);n in e&&delete e[n];},prepare:function(e){var t;return {payload:e,meta:(t={},t.RTK_autoBatch=!0,t)}}}},extraReducers:function(e){e.addCase(i.pending,(function(e,n){var r=n.meta,i=r.requestId,a=r.arg,u=r.startedTimeStamp;a.track&&(e[St(n.meta)]={requestId:i,status:exports.QueryStatus.pending,endpointName:a.endpointName,startedTimeStamp:u});})).addCase(i.fulfilled,(function(e,n){var r=n.payload,i=n.meta;i.arg.track&&jt(e,i,(function(e){e.requestId===i.requestId&&(e.status=exports.QueryStatus.fulfilled,e.data=r,e.fulfilledTimeStamp=i.fulfilledTimeStamp);}));})).addCase(i.rejected,(function(e,n){var r=n.payload,i=n.error,a=n.meta;a.arg.track&&jt(e,a,(function(e){e.requestId===a.requestId&&(e.status=exports.QueryStatus.rejected,e.error=null!=r?r:i);}));})).addMatcher(s,(function(e,n){for(var r=c(n).mutations,i=0,a=Object.entries(r);i<a.length;i++){var u=a[i],o=u[0],s=u[1];(null==s?void 0:s.status)!==exports.QueryStatus.fulfilled&&(null==s?void 0:s.status)!==exports.QueryStatus.rejected||o===(null==s?void 0:s.requestId)||(e[o]=s);}}));}}),g=xe({name:n+"/invalidation",initialState:qt,reducers:{updateProvidedBy:{reducer:function(e,t){for(var n,r,i,a,u=t.payload,o=u.queryCacheKey,c=u.providedTags,s=0,f=Object.values(e);s<f.length;s++)for(var l=0,d=Object.values(f[s]);l<d.length;l++){var p=d[l],v=p.indexOf(o);-1!==v&&p.splice(v,1);}for(var h=0,y=c;h<y.length;h++){var g=y[h],m=g.type,b=g.id,O=null!=(a=(r=null!=(n=e[m])?n:e[m]={})[i=b||"__internal_without_id"])?a:r[i]=[];O.includes(o)||O.push(o);}},prepare:function(e){var t;return {payload:e,meta:(t={},t.RTK_autoBatch=!0,t)}}}},extraReducers:function(e){e.addCase(h.actions.removeQueryResult,(function(e,t){for(var n=t.payload.queryCacheKey,r=0,i=Object.values(e);r<i.length;r++)for(var a=0,u=Object.values(i[r]);a<u.length;a++){var o=u[a],c=o.indexOf(n);-1!==c&&o.splice(c,1);}})).addMatcher(s,(function(e,t){for(var n,r,i,a,u=c(t).provided,o=0,s=Object.entries(u);o<s.length;o++)for(var f=s[o],l=f[0],d=0,p=Object.entries(f[1]);d<p.length;d++)for(var v=p[d],h=v[0],y=v[1],g=null!=(a=(r=null!=(n=e[l])?n:e[l]={})[i=h||"__internal_without_id"])?a:r[i]=[],m=0,b=y;m<b.length;m++){var O=b[m];g.includes(O)||g.push(O);}})).addMatcher(Ke(Je(r),Le(r)),(function(e,t){var n=Ot(t,"providesTags",u,f);g.caseReducers.updateProvidedBy(e,g.actions.updateProvidedBy({queryCacheKey:t.meta.arg.queryCacheKey,providedTags:n}));}));}}),m=xe({name:n+"/subscriptions",initialState:qt,reducers:{updateSubscriptionOptions:function(e,t){},unsubscribeQueryResult:function(e,t){},internal_probeSubscription:function(e,t){}}}),b=xe({name:n+"/internalSubscriptions",initialState:qt,reducers:{subscriptionsUpdated:{reducer:function(e,t){return ye(e,t.payload)},prepare:function(e){var t;return {payload:e,meta:(t={},t.RTK_autoBatch=!0,t)}}}}}),S=xe({name:n+"/config",initialState:p({online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1},l),reducers:{middlewareRegistered:function(e,t){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&o===t.payload||"conflict";}},extraReducers:function(e){e.addCase(st,(function(e){e.online=!0;})).addCase(ft,(function(e){e.online=!1;})).addCase(ot,(function(e){e.focused=!0;})).addCase(ct,(function(e){e.focused=!1;})).addMatcher(s,(function(e){return p({},e)}));}}),j=function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];"function"==typeof e[i]&&(n[i]=e[i]);}var a,u=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Oe.INIT}))throw new Error(me(12));if(void 0===n(void 0,{type:Oe.PROBE_UNKNOWN_ACTION()}))throw new Error(me(13))}));}(n);}catch(e){a=e;}return function(e,t){if(void 0===e&&(e={}),a)throw a;for(var r=!1,i={},o=0;o<u.length;o++){var c=u[o],s=e[c],f=(0, n[c])(s,t);if(void 0===f)throw new Error(me(14));i[c]=f,r=r||f!==s;}return (r=r||u.length!==Object.keys(e).length)?i:e}}({queries:h.reducer,mutations:y.reducer,provided:g.reducer,subscriptions:b.reducer,config:S.reducer});return {reducer:function(e,t){return j(d.match(t)?void 0:e,t)},actions:v(p(p(p(p(p(p({},S.actions),h.actions),m.actions),b.actions),y.actions),g.actions),{unsubscribeMutationResult:y.actions.removeMutationResult,resetApiState:d})}}({context:r,queryThunk:m,mutationThunk:P,reducerPath:o,assertTagType:h,config:{refetchOnFocus:l,refetchOnReconnect:d,refetchOnMountOrArgChange:f,keepUnusedDataFor:s,reducerPath:o}}),M=Q.reducer,_=Q.actions;Wt(e.util,{patchQueryData:T,updateQueryData:I,upsertQueryData:C,prefetch:E,resetApiState:_.resetApiState}),Wt(e.internalActions,_);var K=function(e){var n=e.reducerPath,r=e.queryThunk,i=e.api,a=e.context,u=a.apiUid,o={invalidateTags:Pe(n+"/invalidateTags")},c=[zt,Qt,Mt,Dt,Kt,Ft];return {middleware:function(r){var o=!1,f=v(p({},e),{internalState:{currentSubscriptions:{}},refetchQuery:s}),l=c.map((function(e){return e(f)})),d=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",a=null,u=!1,o=t.internalActions,c=o.updateSubscriptionOptions,s=o.unsubscribeQueryResult;return function(e,o){var f,l;if(a||(a=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.util.resetApiState.match(e))return a=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(e)){var d=e.payload;return [!1,!!(null==(f=r.currentSubscriptions[d.queryCacheKey])?void 0:f[d.requestId])]}var p=function(e,r){var i,a,u,o,f,l,d,p,v;if(c.match(r)){var h=r.payload,y=h.queryCacheKey,g=h.requestId;return (null==(i=null==e?void 0:e[y])?void 0:i[g])&&(e[y][g]=h.options),!0}if(s.match(r)){var m=r.payload;return g=m.requestId,e[y=m.queryCacheKey]&&delete e[y][g],!0}if(t.internalActions.removeQueryResult.match(r))return delete e[r.payload.queryCacheKey],!0;if(n.pending.match(r)){var b=r.meta;if(g=b.requestId,(S=b.arg).subscribe)return (O=null!=(u=e[a=S.queryCacheKey])?u:e[a]={})[g]=null!=(f=null!=(o=S.subscriptionOptions)?o:O[g])?f:{},!0}if(n.rejected.match(r)){var O,w=r.meta,S=w.arg;if(g=w.requestId,w.condition&&S.subscribe)return (O=null!=(d=e[l=S.queryCacheKey])?d:e[l]={})[g]=null!=(v=null!=(p=S.subscriptionOptions)?p:O[g])?v:{},!0}return !1}(r.currentSubscriptions,e);if(p){u||(Ut((function(){var e=JSON.parse(JSON.stringify(r.currentSubscriptions)),n=he(a,(function(){return e}));o.next(t.internalActions.subscriptionsUpdated(n[1])),a=e,u=!1;})),u=!0);var v=!!(null==(l=e.type)?void 0:l.startsWith(i)),h=n.rejected.match(e)&&e.meta.condition&&!!e.meta.arg.subscribe;return [!v&&!h,!1]}return [!0,!1]}}(f),h=function(e){var n=e.reducerPath,r=e.context,i=e.refetchQuery,a=e.internalState,u=e.api.internalActions.removeQueryResult;function o(e,o){var c=e.getState()[n],s=c.queries,f=a.currentSubscriptions;r.batch((function(){for(var n=0,r=Object.keys(f);n<r.length;n++){var a=r[n],l=s[a],d=f[a];d&&l&&(Object.values(d).some((function(e){return !0===e[o]}))||Object.values(d).every((function(e){return void 0===e[o]}))&&c.config[o])&&(0===Object.keys(d).length?e.dispatch(u({queryCacheKey:a})):l.status!==exports.QueryStatus.uninitialized&&e.dispatch(i(l,a)));}}));}return function(e,t){ot.match(e)&&o(t,"refetchOnFocus"),st.match(e)&&o(t,"refetchOnReconnect");}}(f);return function(e){return function(t){o||(o=!0,r.dispatch(i.internalActions.middlewareRegistered(u)));var c,s=v(p({},r),{next:e}),f=r.getState(),y=d(t,s,f),g=y[1];if(c=y[0]?e(t):g,r.getState()[n]&&(h(t,s,f),function(e){return !!e&&"string"==typeof e.type&&e.type.startsWith(n+"/")}(t)||a.hasRehydrationInfo(t)))for(var m=0,b=l;m<b.length;m++)(0, b[m])(t,s,f);return c}}},actions:o};function s(e,t,n){return void 0===n&&(n={}),r(p({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},n))}}({reducerPath:o,context:r,queryThunk:m,mutationThunk:P,api:e,assertTagType:h}),F=K.middleware;Wt(e.util,K.actions),Wt(e,{reducer:M,middleware:F});var z=function(e){var n=e.serializeQueryArgs,r=e.reducerPath,i=function(e){return Tt},a=function(e){return kt};return {buildQuerySelector:function(e,t){return function(r){var a=n({queryArgs:r,endpointDefinition:t,endpointName:e});return Ae(r===At?i:function(e){var t,n,r;return null!=(r=null==(n=null==(t=o(e))?void 0:t.queries)?void 0:n[a])?r:Tt},u)}},buildMutationSelector:function(){return function(e){var t,n;return n="object"==typeof e?null!=(t=St(e))?t:At:e,Ae(n===At?a:function(e){var t,r,i;return null!=(i=null==(r=null==(t=o(e))?void 0:t.mutations)?void 0:r[n])?i:kt},u)}},selectInvalidatedBy:function(e,t){for(var n,i=e[r],a=new Set,u=0,o=t.map(ht);u<o.length;u++){var c=o[u],s=i.provided[c.type];if(s)for(var f=0,l=null!=(n=void 0!==c.id?s[c.id]:b(Object.values(s)))?n:[];f<l.length;f++)a.add(l[f]);}return b(Array.from(a.values()).map((function(e){var t=i.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))}};function u(e){return p(p({},e),{status:n=e.status,isUninitialized:n===exports.QueryStatus.uninitialized,isLoading:n===exports.QueryStatus.pending,isSuccess:n===exports.QueryStatus.fulfilled,isError:n===exports.QueryStatus.rejected});var n;}function o(e){return e[r]}}({serializeQueryArgs:c,reducerPath:o}),U=z.buildQuerySelector,W=z.buildMutationSelector;Wt(e.util,{selectInvalidatedBy:z.selectInvalidatedBy});var B=function(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,u=e.api,o=e.context,c=new Map,s=new Map,f=u.internalActions,l=f.unsubscribeQueryResult,d=f.removeMutationResult,p=f.updateSubscriptionOptions;return {buildInitiateQuery:function(e,r){var a=function(o,s){var f=void 0===s?{}:s,d=f.subscribe,v=void 0===d||d,h=f.forceRefetch,g=f.subscriptionOptions,m=f[gt];return function(s,f){var d,b,O=t({queryArgs:o,endpointDefinition:r,endpointName:e}),w=n(((d={type:"query",subscribe:v,forceRefetch:h,subscriptionOptions:g,endpointName:e,originalArgs:o,queryCacheKey:O})[gt]=m,d)),S=u.endpoints[e].select(o),j=s(w),q=S(f()),A=j.requestId,R=j.abort,P=q.requestId!==A,T=null==(b=c.get(s))?void 0:b[O],k=function(){return S(f())},x=Object.assign(m?j.then(k):P&&!T?Promise.resolve(q):Promise.all([T,j]).then(k),{arg:o,requestId:A,subscriptionOptions:g,queryCacheKey:O,abort:R,unwrap:function(){return y(this,null,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return [4,x];case 1:if((e=t.sent()).isError)throw e.error;return [2,e.data]}}))}))},refetch:function(){return s(a(o,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){v&&s(l({queryCacheKey:O,requestId:A}));},updateSubscriptionOptions:function(t){x.subscriptionOptions=t,s(p({endpointName:e,requestId:A,queryCacheKey:O,options:t}));}});if(!T&&!P&&!m){var I=c.get(s)||{};I[O]=x,c.set(s,I),x.then((function(){delete I[O],Object.keys(I).length||c.delete(s);}));}return x}};return a},buildInitiateMutation:function(e){return function(t,n){var i=void 0===n?{}:n,a=i.track,u=void 0===a||a,o=i.fixedCacheKey;return function(n,i){var a=r({type:"mutation",endpointName:e,originalArgs:t,track:u,fixedCacheKey:o}),c=n(a),f=c.requestId,l=c.abort,p=c.unwrap,v=c.unwrap().then((function(e){return {data:e}})).catch((function(e){return {error:e}})),h=function(){n(d({requestId:f,fixedCacheKey:o}));},y=Object.assign(v,{arg:c.arg,requestId:f,abort:l,unwrap:p,unsubscribe:h,reset:h}),g=s.get(n)||{};return s.set(n,g),g[f]=y,y.then((function(){delete g[f],Object.keys(g).length||s.delete(n);})),o&&(g[o]=y,y.then((function(){g[o]===y&&(delete g[o],Object.keys(g).length||s.delete(n));}))),y}}},getRunningQueryThunk:function(e,n){return function(r){var i,a=t({queryArgs:n,endpointDefinition:o.endpointDefinitions[e],endpointName:e});return null==(i=c.get(r))?void 0:i[a]}},getRunningMutationThunk:function(e,t){return function(e){var n;return null==(n=s.get(e))?void 0:n[t]}},getRunningQueriesThunk:function(){return function(e){return Object.values(c.get(e)||{}).filter(yt)}},getRunningMutationsThunk:function(){return function(e){return Object.values(s.get(e)||{}).filter(yt)}},getRunningOperationPromises:function(){var e=function(e){return Array.from(e.values()).flatMap((function(e){return e?Object.values(e):[]}))};return a(a([],e(c)),e(s)).filter(yt)},removalWarning:function(){throw new Error("This method had to be removed due to a conceptual bug in RTK.\n Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.\n See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.")}}}({queryThunk:m,mutationThunk:P,api:e,serializeQueryArgs:c,context:r}),L=B.buildInitiateQuery,J=B.buildInitiateMutation;return Wt(e.util,{getRunningOperationPromises:B.getRunningOperationPromises,getRunningOperationPromise:B.removalWarning,getRunningMutationThunk:B.getRunningMutationThunk,getRunningMutationsThunk:B.getRunningMutationsThunk,getRunningQueryThunk:B.getRunningQueryThunk,getRunningQueriesThunk:B.getRunningQueriesThunk}),{name:Bt,injectEndpoint:function(t,n){var r,i=e;null!=(r=i.endpoints)[t]||(r[t]={}),pt(n)?Wt(i.endpoints[t],{name:t,select:U(t,n),initiate:L(t,n)},N(m,t)):n.type===rt.mutation&&Wt(i.endpoints[t],{name:t,select:W(),initiate:J(t)},N(P,t));}}}}},Jt=Ct(Lt()); | ||
exports.buildCreateApi = It; | ||
exports.buildCreateApi = Ct; | ||
exports.copyWithStructuralSharing = Ge; | ||
exports.coreModule = Lt; | ||
exports.createApi = Bt; | ||
exports.defaultSerializeQueryArgs = xt; | ||
exports.fakeBaseQuery = Ct; | ||
exports.coreModuleName = Bt; | ||
exports.createApi = Jt; | ||
exports.defaultSerializeQueryArgs = It; | ||
exports.fakeBaseQuery = Et; | ||
exports.fetchBaseQuery = et; | ||
exports.retry = at; | ||
exports.retry = ut; | ||
exports.setupListeners = dt; | ||
exports.skipSelector = Pt; | ||
exports.skipSelector = Rt; | ||
exports.skipToken = At; | ||
@@ -21,0 +22,0 @@ |
@@ -18,2 +18,3 @@ export declare type Id<T> = { | ||
export declare type NoInfer<T> = [T][T extends any ? 0 : never]; | ||
export declare type NonUndefined<T> = T extends undefined ? never : T; | ||
export declare type UnwrapPromise<T> = T extends PromiseLike<infer V> ? V : T; | ||
@@ -20,0 +21,0 @@ export declare type MaybePromise<T> = T | PromiseLike<T>; |
@@ -1,2 +0,2 @@ | ||
var e,n=this&&this.__extends||(e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},e(n,t)},function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),t=this&&this.__generator||function(e,n){var t,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=n.call(e,u)}catch(e){o=[6,e],r=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=this&&this.__spreadArray||function(e,n){for(var t=0,r=n.length,i=e.length;t<r;t++,i++)e[i]=n[t];return e},i=Object.create,o=Object.defineProperty,u=Object.defineProperties,a=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,v=function(e,n,t){return n in e?o(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t},h=function(e,n){for(var t in n||(n={}))d.call(n,t)&&v(e,t,n[t]);if(l)for(var r=0,i=l(n);r<i.length;r++)p.call(n,t=i[r])&&v(e,t,n[t]);return e},y=function(e,n){return u(e,c(n))},g=function(e){return o(e,"__esModule",{value:!0})},b=function(e,n,t){if(n&&"object"==typeof n||"function"==typeof n)for(var r=function(r){d.call(e,r)||"default"===r||o(e,r,{get:function(){return n[r]},enumerable:!(t=a(n,r))||t.enumerable})},i=0,u=f(n);i<u.length;i++)r(u[i]);return e},m=function(e){return b(g(o(null!=e?i(s(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)},w=function(e,n,t){return new Promise((function(r,i){var o=function(e){try{a(t.next(e))}catch(e){i(e)}},u=function(e){try{a(t.throw(e))}catch(e){i(e)}},a=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(o,u)};a((t=t.apply(e,n)).next())}))};g(exports),function(e,n){for(var t in n)o(e,t,{get:n[t],enumerable:!0})}(exports,{MiddlewareArray:function(){return T},SHOULD_AUTOBATCH:function(){return Ue},TaskAbortError:function(){return Ae},addListener:function(){return Le},autoBatchEnhancer:function(){return He},clearAllListeners:function(){return Re},configureStore:function(){return U},createAction:function(){return W},createAsyncThunk:function(){return ce},createDraftSafeSelector:function(){return _},createEntityAdapter:function(){return te},createImmutableStateInvariantMiddleware:function(){return L},createListenerMiddleware:function(){return Ve},createNextState:function(){return j.default},createReducer:function(){return K},createSelector:function(){return E.createSelector},createSerializableStateInvariantMiddleware:function(){return V},createSlice:function(){return J},current:function(){return j.current},findNonSerializableValue:function(){return z},freeze:function(){return j.freeze},getDefaultMiddleware:function(){return B},getType:function(){return F},isAllOf:function(){return de},isAnyOf:function(){return se},isAsyncThunkAction:function(){return me},isDraft:function(){return j.isDraft},isFulfilled:function(){return be},isImmutableDefault:function(){return D},isPending:function(){return he},isPlain:function(){return R},isPlainObject:function(){return k},isRejected:function(){return ye},isRejectedWithValue:function(){return ge},miniSerializeError:function(){return ae},nanoid:function(){return re},original:function(){return j.original},prepareAutoBatched:function(){return We},removeListener:function(){return ze},unwrapResult:function(){return fe}});var O=m(require("immer"));b(exports,m(require("redux")));var j=m(require("immer")),E=m(require("reselect")),S=m(require("immer")),A=m(require("reselect")),_=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=A.createSelector.apply(void 0,e),i=function(e){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.apply(void 0,r([(0,S.isDraft)(e)?(0,S.current)(e):e],n))};return i},P=m(require("redux")),q=m(require("redux")),x="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?q.compose:q.compose.apply(null,arguments)};function k(e){if("object"!=typeof e||null===e)return!1;var n=Object.getPrototypeOf(e);if(null===n)return!0;for(var t=n;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return n===t}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window;var M=m(require("redux-thunk")),I=m(require("immer")),T=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return n(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,r([void 0],e[0].concat(this)))):new(t.bind.apply(t,r([void 0],e.concat(this))))},t}(Array);function C(e){return(0,I.isDraftable)(e)?(0,I.default)(e,(function(){})):e}function D(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function L(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}function R(e){var n=typeof e;return null==e||"string"===n||"boolean"===n||"number"===n||Array.isArray(e)||k(e)}function z(e,n,t,r,i,o){var u;if(void 0===n&&(n=""),void 0===t&&(t=R),void 0===i&&(i=[]),!t(e))return{keyPath:n||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(null==o?void 0:o.has(e))return!1;for(var a=null!=r?r(e):Object.entries(e),c=i.length>0,f=function(e,a){var f=n?n+"."+e:e;return c&&i.some((function(e){return e instanceof RegExp?e.test(f):f===e}))?"continue":t(a)?"object"==typeof a&&(u=z(a,f,t,r,i,o))?{value:u}:void 0:{value:{keyPath:f,value:a}}},l=0,s=a;l<s.length;l++){var d=s[l],p=f(d[0],d[1]);if("object"==typeof p)return p.value}return o&&N(e)&&o.add(e),!1}function N(e){if(!Object.isFrozen(e))return!1;for(var n=0,t=Object.values(e);n<t.length;n++){var r=t[n];if("object"==typeof r&&null!==r&&!N(r))return!1}return!0}function V(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}function B(e){void 0===e&&(e={});var n=e.thunk,t=void 0===n||n,r=new T;return t&&r.push("boolean"==typeof t?M.default:M.default.withExtraArgument(t.extraArgument)),r}function U(e){var n,t=function(e){return B(e)},i=e||{},o=i.reducer,u=void 0===o?void 0:o,a=i.middleware,c=void 0===a?t():a,f=i.devTools,l=void 0===f||f,s=i.preloadedState,d=void 0===s?void 0:s,p=i.enhancers,v=void 0===p?void 0:p;if("function"==typeof u)n=u;else{if(!k(u))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');n=(0,P.combineReducers)(u)}var y=c;"function"==typeof y&&(y=y(t));var g=P.applyMiddleware.apply(void 0,y),b=P.compose;l&&(b=x(h({trace:!1},"object"==typeof l&&l)));var m=[g];Array.isArray(v)?m=r([g],v):"function"==typeof v&&(m=v(m));var w=b.apply(void 0,m);return(0,P.createStore)(n,d,w)}function W(e,n){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(n){var i=n.apply(void 0,t);if(!i)throw new Error("prepareAction did not return an object");return h(h({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:t[0]}}return t.toString=function(){return""+e},t.type=e,t.match=function(n){return n.type===e},t}function X(e){return["type","payload","error","meta"].indexOf(e)>-1}function F(e){return""+e}var G=m(require("immer"));function H(e){var n,t={},r=[],i={addCase:function(e,n){var r="string"==typeof e?e:e.type;if(r in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[r]=n,i},addMatcher:function(e,n){return r.push({matcher:e,reducer:n}),i},addDefaultCase:function(e){return n=e,i}};return e(i),[t,r,n]}function K(e,n,t,i){void 0===t&&(t=[]);var o,u="function"==typeof n?H(n):[n,t,i],a=u[0],c=u[1],f=u[2];if("function"==typeof e)o=function(){return C(e())};else{var l=C(e);o=function(){return l}}function s(e,n){void 0===e&&(e=o());var t=r([a[n.type]],c.filter((function(e){return(0,e.matcher)(n)})).map((function(e){return e.reducer})));return 0===t.filter((function(e){return!!e})).length&&(t=[f]),t.reduce((function(e,t){if(t){var r;if((0,G.isDraft)(e))return void 0===(r=t(e,n))?e:r;if((0,G.isDraftable)(e))return(0,G.default)(e,(function(e){return t(e,n)}));if(void 0===(r=t(e,n))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return s.getInitialState=o,s}function J(e){var n=e.name;if(!n)throw new Error("`name` is a required option for createSlice");var t,r="function"==typeof e.initialState?e.initialState:C(e.initialState),i=e.reducers||{},o=Object.keys(i),u={},a={},c={};function f(){var n="function"==typeof e.extraReducers?H(e.extraReducers):[e.extraReducers],t=n[0],i=n[1],o=void 0===i?[]:i,u=n[2],c=void 0===u?void 0:u,f=h(h({},void 0===t?{}:t),a);return K(r,(function(e){for(var n in f)e.addCase(n,f[n]);for(var t=0,r=o;t<r.length;t++){var i=r[t];e.addMatcher(i.matcher,i.reducer)}c&&e.addDefaultCase(c)}))}return o.forEach((function(e){var t,r,o=i[e],f=n+"/"+e;"reducer"in o?(t=o.reducer,r=o.prepare):t=o,u[e]=t,a[f]=t,c[e]=r?W(f,r):W(f)})),{name:n,reducer:function(e,n){return t||(t=f()),t(e,n)},actions:c,caseReducers:u,getInitialState:function(){return t||(t=f()),t.getInitialState()}}}var Q=m(require("immer"));function Y(e){return function(n,t){var r=function(n){var r;k(r=t)&&"string"==typeof r.type&&Object.keys(r).every(X)?e(t.payload,n):e(t,n)};return(0,Q.isDraft)(n)?(r(n),n):(0,Q.default)(n,r)}}function Z(e,n){return n(e)}function $(e){return Array.isArray(e)||(e=Object.values(e)),e}function ee(e,n,t){for(var r=[],i=[],o=0,u=e=$(e);o<u.length;o++){var a=u[o],c=Z(a,n);c in t.entities?i.push({id:c,changes:a}):r.push(a)}return[r,i]}function ne(e){function n(n,t){var r=Z(n,e);r in t.entities||(t.ids.push(r),t.entities[r]=n)}function t(e,t){for(var r=0,i=e=$(e);r<i.length;r++)n(i[r],t)}function r(n,t){var r=Z(n,e);r in t.entities||t.ids.push(r),t.entities[r]=n}function i(e,n){var t=!1;e.forEach((function(e){e in n.entities&&(delete n.entities[e],t=!0)})),t&&(n.ids=n.ids.filter((function(e){return e in n.entities})))}function o(n,t){var r={},i={};if(n.forEach((function(e){e.id in t.entities&&(i[e.id]={id:e.id,changes:h(h({},i[e.id]?i[e.id].changes:null),e.changes)})})),(n=Object.values(i)).length>0){var o=n.filter((function(n){return function(n,t,r){var i=Object.assign({},r.entities[t.id],t.changes),o=Z(i,e),u=o!==t.id;return u&&(n[t.id]=o,delete r.entities[t.id]),r.entities[o]=i,u}(r,n,t)})).length>0;o&&(t.ids=Object.keys(t.entities))}}function u(n,r){var i=ee(n,e,r),u=i[0];o(i[1],r),t(u,r)}return{removeAll:(a=function(e){Object.assign(e,{ids:[],entities:{}})},c=Y((function(e,n){return a(n)})),function(e){return c(e,void 0)}),addOne:Y(n),addMany:Y(t),setOne:Y(r),setMany:Y((function(e,n){for(var t=0,i=e=$(e);t<i.length;t++)r(i[t],n)})),setAll:Y((function(e,n){e=$(e),n.ids=[],n.entities={},t(e,n)})),updateOne:Y((function(e,n){return o([e],n)})),updateMany:Y(o),upsertOne:Y((function(e,n){return u([e],n)})),upsertMany:Y(u),removeOne:Y((function(e,n){return i([e],n)})),removeMany:Y(i)};var a,c}function te(e){void 0===e&&(e={});var n=h({sortComparer:!1,selectId:function(e){return e.id}},e),t=n.selectId,r=n.sortComparer,i={getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},o={getSelectors:function(e){var n=function(e){return e.ids},t=function(e){return e.entities},r=_(n,t,(function(e,n){return e.map((function(e){return n[e]}))})),i=function(e,n){return n},o=function(e,n){return e[n]},u=_(n,(function(e){return e.length}));if(!e)return{selectIds:n,selectEntities:t,selectAll:r,selectTotal:u,selectById:_(t,i,o)};var a=_(e,t);return{selectIds:_(e,n),selectEntities:a,selectAll:_(e,r),selectTotal:_(e,u),selectById:_(a,i,o)}}},u=r?function(e,n){var t=ne(e);function r(n,t){var r=(n=$(n)).filter((function(n){return!(Z(n,e)in t.entities)}));0!==r.length&&a(r,t)}function i(e,n){0!==(e=$(e)).length&&a(e,n)}function o(n,t){for(var r=!1,i=0,o=n;i<o.length;i++){var u=o[i],a=t.entities[u.id];if(a){r=!0,Object.assign(a,u.changes);var f=e(a);u.id!==f&&(delete t.entities[u.id],t.entities[f]=a)}}r&&c(t)}function u(n,t){var i=ee(n,e,t),u=i[0];o(i[1],t),r(u,t)}function a(n,t){n.forEach((function(n){t.entities[e(n)]=n})),c(t)}function c(t){var r=Object.values(t.entities);r.sort(n);var i=r.map(e);(function(e,n){if(e.length!==n.length)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(e[t]!==n[t])return!1;return!0})(t.ids,i)||(t.ids=i)}return{removeOne:t.removeOne,removeMany:t.removeMany,removeAll:t.removeAll,addOne:Y((function(e,n){return r([e],n)})),updateOne:Y((function(e,n){return o([e],n)})),upsertOne:Y((function(e,n){return u([e],n)})),setOne:Y((function(e,n){return i([e],n)})),setMany:Y(i),setAll:Y((function(e,n){e=$(e),n.entities={},n.ids=[],r(e,n)})),addMany:Y(r),updateMany:Y(o),upsertMany:Y(u)}}(t,r):ne(t);return h(h(h({selectId:t,sortComparer:r},i),o),u)}var re=function(e){void 0===e&&(e=21);for(var n="",t=e;t--;)n+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return n},ie=["name","message","stack","code"],oe=function(e,n){this.payload=e,this.meta=n},ue=function(e,n){this.payload=e,this.meta=n},ae=function(e){if("object"==typeof e&&null!==e){for(var n={},t=0,r=ie;t<r.length;t++){var i=r[t];"string"==typeof e[i]&&(n[i]=e[i])}return n}return{message:String(e)}},ce=function(){function e(e,n,r){var i=W(e+"/fulfilled",(function(e,n,t,r){return{payload:e,meta:y(h({},r||{}),{arg:t,requestId:n,requestStatus:"fulfilled"})}})),o=W(e+"/pending",(function(e,n,t){return{payload:void 0,meta:y(h({},t||{}),{arg:n,requestId:e,requestStatus:"pending"})}})),u=W(e+"/rejected",(function(e,n,t,i,o){return{payload:i,error:(r&&r.serializeError||ae)(e||"Rejected"),meta:y(h({},o||{}),{arg:t,requestId:n,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(c,f,l){var s,d=(null==r?void 0:r.idGenerator)?r.idGenerator(e):re(),p=new a;function v(e){s=e,p.abort()}var h=function(){return w(this,null,(function(){var a,h,y,g,b,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),null===(w=g=null==(a=null==r?void 0:r.condition)?void 0:a.call(r,e,{getState:f,extra:l}))||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,g];case 1:g=t.sent(),t.label=2;case 2:if(!1===g||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,n){return p.signal.addEventListener("abort",(function(){return n({name:"AbortError",message:s||"Aborted"})}))})),c(o(d,e,null==(h=null==r?void 0:r.getPendingMeta)?void 0:h.call(r,{requestId:d,arg:e},{getState:f,extra:l}))),[4,Promise.race([b,Promise.resolve(n(e,{dispatch:c,getState:f,extra:l,requestId:d,signal:p.signal,abort:v,rejectWithValue:function(e,n){return new oe(e,n)},fulfillWithValue:function(e,n){return new ue(e,n)}})).then((function(n){if(n instanceof oe)throw n;return n instanceof ue?i(n.payload,d,e,n.meta):i(n,d,e)}))])];case 3:return y=t.sent(),[3,5];case 4:return m=t.sent(),y=m instanceof oe?u(null,d,e,m.payload,m.meta):u(m,d,e),[3,5];case 5:return r&&!r.dispatchConditionRejection&&u.match(y)&&y.meta.condition||c(y),[2,y]}var w}))}))}();return Object.assign(h,{abort:v,requestId:d,arg:e,unwrap:function(){return h.then(fe)}})}}),{pending:o,rejected:u,fulfilled:i,typePrefix:e})}return e.withTypes=function(){return e},e}();function fe(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var le=function(e,n){return(t=e)&&"function"==typeof t.match?e.match(n):e(n);var t};function se(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(n){return e.some((function(e){return le(e,n)}))}}function de(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(n){return e.every((function(e){return le(e,n)}))}}function pe(e,n){if(!e||!e.meta)return!1;var t="string"==typeof e.meta.requestId,r=n.indexOf(e.meta.requestStatus)>-1;return t&&r}function ve(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function he(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return pe(e,["pending"])}:ve(e)?function(n){var t=e.map((function(e){return e.pending}));return se.apply(void 0,t)(n)}:he()(e[0])}function ye(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return pe(e,["rejected"])}:ve(e)?function(n){var t=e.map((function(e){return e.rejected}));return se.apply(void 0,t)(n)}:ye()(e[0])}function ge(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||ve(e)?function(n){return de(ye.apply(void 0,e),t)(n)}:ge()(e[0])}function be(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return pe(e,["fulfilled"])}:ve(e)?function(n){var t=e.map((function(e){return e.fulfilled}));return se.apply(void 0,t)(n)}:be()(e[0])}function me(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return pe(e,["pending","fulfilled","rejected"])}:ve(e)?function(n){for(var t=[],r=0,i=e;r<i.length;r++){var o=i[r];t.push(o.pending,o.rejected,o.fulfilled)}return se.apply(void 0,t)(n)}:me()(e[0])}var we=function(e,n){if("function"!=typeof e)throw new TypeError(n+" is not a function")},Oe=function(){},je=function(e,n){return void 0===n&&(n=Oe),e.catch(n),e},Ee=function(e,n){return e.addEventListener("abort",n,{once:!0}),function(){return e.removeEventListener("abort",n)}},Se=function(e,n){var t=e.signal;t.aborted||("reason"in t||Object.defineProperty(t,"reason",{enumerable:!0,value:n,configurable:!0,writable:!0}),e.abort(n))},Ae=function(e){this.code=e,this.name="TaskAbortError",this.message="task cancelled (reason: "+e+")"},_e=function(e){if(e.aborted)throw new Ae(e.reason)};function Pe(e,n){var t=Oe;return new Promise((function(r,i){var o=function(){return i(new Ae(e.reason))};e.aborted?o():(t=Ee(e,o),n.finally((function(){return t()})).then(r,i))})).finally((function(){t=Oe}))}var qe=function(e){return function(n){return je(Pe(e,n).then((function(n){return _e(e),n})))}},xe=function(e){var n=qe(e);return function(e){return n(new Promise((function(n){return setTimeout(n,e)})))}},ke=Object.assign,Me={},Ie="listenerMiddleware",Te=function(e){var n=e.type,t=e.actionCreator,r=e.matcher,i=e.predicate,o=e.effect;if(n)i=W(n).match;else if(t)n=t.type,i=t.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return we(o,"options.listener"),{predicate:i,type:n,effect:o}},Ce=function(e){e.pending.forEach((function(e){Se(e,"listener-cancelled")}))},De=function(e,n,t){try{e(n,t)}catch(e){setTimeout((function(){throw e}),0)}},Le=W(Ie+"/add"),Re=W(Ie+"/removeAll"),ze=W(Ie+"/remove"),Ne=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,r([Ie+"/error"],e))};function Ve(e){var n=this;void 0===e&&(e={});var r=new Map,i=e.extra,o=e.onError,u=void 0===o?Ne:o;we(u,"onError");var a=function(e){for(var n=0,t=Array.from(r.values());n<t.length;n++){var i=t[n];if(e(i))return i}},c=function(e){var n=a((function(n){return n.effect===e.effect}));return n||(n=function(e){var n=Te(e),t=n.type,r=n.predicate,i=n.effect;return{id:re(),effect:i,type:t,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}}(e)),function(e){return e.unsubscribe=function(){return r.delete(e.id)},r.set(e.id,e),function(n){e.unsubscribe(),(null==n?void 0:n.cancelActive)&&Ce(e)}}(n)},f=function(e){var n=Te(e),t=n.type,r=n.effect,i=n.predicate,o=a((function(e){return("string"==typeof t?e.type===t:e.predicate===i)&&e.effect===r}));return o&&(o.unsubscribe(),e.cancelActive&&Ce(o)),!!o},l=function(e,o,a,f){return w(n,null,(function(){var n,l,s;return t(this,(function(d){switch(d.label){case 0:n=new AbortController,l=function(e,n){return function(r,i){return je(function(r,i){return w(void 0,null,(function(){var o,u,a,c;return t(this,(function(t){switch(t.label){case 0:_e(n),o=function(){},u=new Promise((function(n,t){var i=e({predicate:r,effect:function(e,t){t.unsubscribe(),n([e,t.getState(),t.getOriginalState()])}});o=function(){i(),t()}})),a=[u],null!=i&&a.push(new Promise((function(e){return setTimeout(e,i,null)}))),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,Pe(n,Promise.race(a))];case 2:return c=t.sent(),_e(n),[2,c];case 3:return o(),[7];case 4:return[2]}}))}))}(r,i))}}(c,n.signal),d.label=1;case 1:return d.trys.push([1,3,4,5]),e.pending.add(n),[4,Promise.resolve(e.effect(o,ke({},a,{getOriginalState:f,condition:function(e,n){return l(e,n).then(Boolean)},take:l,delay:xe(n.signal),pause:qe(n.signal),extra:i,signal:n.signal,fork:(p=n.signal,function(e){we(e,"taskExecutor");var n,r=new AbortController;n=r,Ee(p,(function(){return Se(n,p.reason)}));var i,o,u=(i=function(){return w(void 0,null,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return _e(p),_e(r.signal),[4,e({pause:qe(r.signal),delay:xe(r.signal),signal:r.signal})];case 1:return n=t.sent(),_e(r.signal),[2,n]}}))}))},o=function(){return Se(r,"task-completed")},w(void 0,null,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return n.sent(),[4,i()];case 2:return[2,{status:"ok",value:n.sent()}];case 3:return[2,{status:(e=n.sent())instanceof Ae?"cancelled":"rejected",error:e}];case 4:return null==o||o(),[7];case 5:return[2]}}))})));return{result:qe(p)(u),cancel:function(){Se(r,"task-cancelled")}}}),unsubscribe:e.unsubscribe,subscribe:function(){r.set(e.id,e)},cancelActiveListeners:function(){e.pending.forEach((function(e,t,r){e!==n&&(Se(e,"listener-cancelled"),r.delete(e))}))}})))];case 2:return d.sent(),[3,5];case 3:return(s=d.sent())instanceof Ae||De(u,s,{raisedBy:"effect"}),[3,5];case 4:return Se(n,"listener-completed"),e.pending.delete(n),[7];case 5:return[2]}var p}))}))},s=function(e){return function(){e.forEach(Ce),e.clear()}}(r);return{middleware:function(e){return function(n){return function(t){if(Le.match(t))return c(t.payload);if(!Re.match(t)){if(ze.match(t))return f(t.payload);var i,o=e.getState(),a=function(){if(o===Me)throw new Error(Ie+": getOriginalState can only be called synchronously");return o};try{if(i=n(t),r.size>0)for(var d=e.getState(),p=Array.from(r.values()),v=0,h=p;v<h.length;v++){var y=h[v],g=!1;try{g=y.predicate(t,d,o)}catch(e){g=!1,De(u,e,{raisedBy:"predicate"})}g&&l(y,t,e,a)}}finally{o=Me}return i}s()}}},startListening:c,stopListening:f,clearListeners:s}}var Be,Ue="RTK_autoBatch",We=function(){return function(e){var n;return{payload:e,meta:(n={},n[Ue]=!0,n)}}},Xe="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):function(e){return(Be||(Be=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}),0)}))},Fe=function(e){return function(n){setTimeout(n,e)}},Ge="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Fe(10),He=function(e){return void 0===e&&(e={type:"raf"}),function(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=n.apply(void 0,t),o=!0,u=!1,a=!1,c=new Set,f="tick"===e.type?Xe:"raf"===e.type?Ge:"callback"===e.type?e.queueNotification:Fe(e.timeout),l=function(){a=!1,u&&(u=!1,c.forEach((function(e){return e()})))};return Object.assign({},i,{subscribe:function(e){var n=i.subscribe((function(){return o&&e()}));return c.add(e),function(){n(),c.delete(e)}},dispatch:function(e){var n;try{return o=!(null==(n=null==e?void 0:e.meta)?void 0:n[Ue]),(u=!o)&&(a||(a=!0,f(l))),i.dispatch(e)}finally{o=!0}}})}}};(0,O.enableES5)(); | ||
var e,n=this&&this.__extends||(e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},e(n,t)},function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),t=this&&this.__generator||function(e,n){var t,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=n.call(e,u)}catch(e){o=[6,e],r=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=this&&this.__spreadArray||function(e,n){for(var t=0,r=n.length,i=e.length;t<r;t++,i++)e[i]=n[t];return e},i=Object.create,o=Object.defineProperty,u=Object.defineProperties,a=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,v=function(e,n,t){return n in e?o(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t},y=function(e,n){for(var t in n||(n={}))d.call(n,t)&&v(e,t,n[t]);if(l)for(var r=0,i=l(n);r<i.length;r++)p.call(n,t=i[r])&&v(e,t,n[t]);return e},h=function(e,n){return u(e,c(n))},g=function(e){return o(e,"__esModule",{value:!0})},b=function(e,n,t){if(n&&"object"==typeof n||"function"==typeof n)for(var r=function(r){d.call(e,r)||"default"===r||o(e,r,{get:function(){return n[r]},enumerable:!(t=a(n,r))||t.enumerable})},i=0,u=f(n);i<u.length;i++)r(u[i]);return e},m=function(e){return b(g(o(null!=e?i(s(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)},w=function(e,n,t){return new Promise((function(r,i){var o=function(e){try{a(t.next(e))}catch(e){i(e)}},u=function(e){try{a(t.throw(e))}catch(e){i(e)}},a=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(o,u)};a((t=t.apply(e,n)).next())}))};g(exports),function(e,n){for(var t in n)o(e,t,{get:n[t],enumerable:!0})}(exports,{EnhancerArray:function(){return F},MiddlewareArray:function(){return B},SHOULD_AUTOBATCH:function(){return Je},TaskAbortError:function(){return ke},addListener:function(){return Fe},autoBatchEnhancer:function(){return $e},clearAllListeners:function(){return Ue},configureStore:function(){return Y},createAction:function(){return T},createActionCreatorInvariantMiddleware:function(){return N},createAsyncThunk:function(){return ve},createDraftSafeSelector:function(){return P},createEntityAdapter:function(){return ce},createImmutableStateInvariantMiddleware:function(){return X},createListenerMiddleware:function(){return Ge},createNextState:function(){return j.default},createReducer:function(){return ee},createSelector:function(){return A.createSelector},createSerializableStateInvariantMiddleware:function(){return K},createSlice:function(){return ne},current:function(){return j.current},findNonSerializableValue:function(){return H},freeze:function(){return j.freeze},getDefaultMiddleware:function(){return Q},getType:function(){return z},isAction:function(){return C},isActionCreator:function(){return D},isAllOf:function(){return be},isAnyOf:function(){return ge},isAsyncThunkAction:function(){return Se},isDraft:function(){return j.isDraft},isFluxStandardAction:function(){return L},isFulfilled:function(){return Ee},isImmutableDefault:function(){return W},isPending:function(){return Oe},isPlain:function(){return G},isPlainObject:function(){return M},isRejected:function(){return je},isRejectedWithValue:function(){return Ae},miniSerializeError:function(){return pe},nanoid:function(){return fe},original:function(){return j.original},prepareAutoBatched:function(){return Ke},removeListener:function(){return We},unwrapResult:function(){return ye}});var O=m(require("immer"));b(exports,m(require("redux")));var j=m(require("immer")),A=m(require("reselect")),E=m(require("immer")),S=m(require("reselect")),P=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=S.createSelector.apply(void 0,e),i=function(e){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.apply(void 0,r([(0,E.isDraft)(e)?(0,E.current)(e):e],n))};return i},_=m(require("redux")),q=m(require("redux")),x="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?q.compose:q.compose.apply(null,arguments)};function M(e){if("object"!=typeof e||null===e)return!1;var n=Object.getPrototypeOf(e);if(null===n)return!0;for(var t=n;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return n===t}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window;var k=m(require("redux-thunk")),I=function(e){return e&&"function"==typeof e.match};function T(e,n){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(n){var i=n.apply(void 0,t);if(!i)throw new Error("prepareAction did not return an object");return y(y({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:t[0]}}return t.toString=function(){return""+e},t.type=e,t.match=function(n){return n.type===e},t}function C(e){return M(e)&&"type"in e}function D(e){return"function"==typeof e&&"type"in e&&I(e)}function L(e){return C(e)&&"string"==typeof e.type&&Object.keys(e).every(R)}function R(e){return["type","payload","error","meta"].indexOf(e)>-1}function z(e){return""+e}function N(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}var V=m(require("immer")),B=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return n(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,r([void 0],e[0].concat(this)))):new(t.bind.apply(t,r([void 0],e.concat(this))))},t}(Array),F=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return n(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,r([void 0],e[0].concat(this)))):new(t.bind.apply(t,r([void 0],e.concat(this))))},t}(Array);function U(e){return(0,V.isDraftable)(e)?(0,V.default)(e,(function(){})):e}function W(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function X(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}function G(e){var n=typeof e;return null==e||"string"===n||"boolean"===n||"number"===n||Array.isArray(e)||M(e)}function H(e,n,t,r,i,o){var u;if(void 0===n&&(n=""),void 0===t&&(t=G),void 0===i&&(i=[]),!t(e))return{keyPath:n||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(null==o?void 0:o.has(e))return!1;for(var a=null!=r?r(e):Object.entries(e),c=i.length>0,f=function(e,a){var f=n?n+"."+e:e;return c&&i.some((function(e){return e instanceof RegExp?e.test(f):f===e}))?"continue":t(a)?"object"==typeof a&&(u=H(a,f,t,r,i,o))?{value:u}:void 0:{value:{keyPath:f,value:a}}},l=0,s=a;l<s.length;l++){var d=s[l],p=f(d[0],d[1]);if("object"==typeof p)return p.value}return o&&J(e)&&o.add(e),!1}function J(e){if(!Object.isFrozen(e))return!1;for(var n=0,t=Object.values(e);n<t.length;n++){var r=t[n];if("object"==typeof r&&null!==r&&!J(r))return!1}return!0}function K(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}function Q(e){void 0===e&&(e={});var n=e.thunk,t=void 0===n||n,r=new B;return t&&r.push("boolean"==typeof t?k.default:k.default.withExtraArgument(t.extraArgument)),r}function Y(e){var n,t=function(e){return Q(e)},i=e||{},o=i.reducer,u=void 0===o?void 0:o,a=i.middleware,c=void 0===a?t():a,f=i.devTools,l=void 0===f||f,s=i.preloadedState,d=void 0===s?void 0:s,p=i.enhancers,v=void 0===p?void 0:p;if("function"==typeof u)n=u;else{if(!M(u))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');n=(0,_.combineReducers)(u)}var h=c;"function"==typeof h&&(h=h(t));var g=_.applyMiddleware.apply(void 0,h),b=_.compose;l&&(b=x(y({trace:!1},"object"==typeof l&&l)));var m=new F(g),w=m;Array.isArray(v)?w=r([g],v):"function"==typeof v&&(w=v(m));var O=b.apply(void 0,w);return(0,_.createStore)(n,d,O)}var Z=m(require("immer"));function $(e){var n,t={},r=[],i={addCase:function(e,n){var r="string"==typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[r]=n,i},addMatcher:function(e,n){return r.push({matcher:e,reducer:n}),i},addDefaultCase:function(e){return n=e,i}};return e(i),[t,r,n]}function ee(e,n,t,i){void 0===t&&(t=[]);var o,u="function"==typeof n?$(n):[n,t,i],a=u[0],c=u[1],f=u[2];if("function"==typeof e)o=function(){return U(e())};else{var l=U(e);o=function(){return l}}function s(e,n){void 0===e&&(e=o());var t=r([a[n.type]],c.filter((function(e){return(0,e.matcher)(n)})).map((function(e){return e.reducer})));return 0===t.filter((function(e){return!!e})).length&&(t=[f]),t.reduce((function(e,t){if(t){var r;if((0,Z.isDraft)(e))return void 0===(r=t(e,n))?e:r;if((0,Z.isDraftable)(e))return(0,Z.default)(e,(function(e){return t(e,n)}));if(void 0===(r=t(e,n))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return s.getInitialState=o,s}function ne(e){var n=e.name;if(!n)throw new Error("`name` is a required option for createSlice");var t,r="function"==typeof e.initialState?e.initialState:U(e.initialState),i=e.reducers||{},o=Object.keys(i),u={},a={},c={};function f(){var n="function"==typeof e.extraReducers?$(e.extraReducers):[e.extraReducers],t=n[0],i=n[1],o=void 0===i?[]:i,u=n[2],c=void 0===u?void 0:u,f=y(y({},void 0===t?{}:t),a);return ee(r,(function(e){for(var n in f)e.addCase(n,f[n]);for(var t=0,r=o;t<r.length;t++){var i=r[t];e.addMatcher(i.matcher,i.reducer)}c&&e.addDefaultCase(c)}))}return o.forEach((function(e){var t,r,o=i[e],f=n+"/"+e;"reducer"in o?(t=o.reducer,r=o.prepare):t=o,u[e]=t,a[f]=t,c[e]=r?T(f,r):T(f)})),{name:n,reducer:function(e,n){return t||(t=f()),t(e,n)},actions:c,caseReducers:u,getInitialState:function(){return t||(t=f()),t.getInitialState()}}}var te=m(require("immer"));function re(e){return function(n,t){var r=function(n){L(t)?e(t.payload,n):e(t,n)};return(0,te.isDraft)(n)?(r(n),n):(0,te.default)(n,r)}}function ie(e,n){return n(e)}function oe(e){return Array.isArray(e)||(e=Object.values(e)),e}function ue(e,n,t){for(var r=[],i=[],o=0,u=e=oe(e);o<u.length;o++){var a=u[o],c=ie(a,n);c in t.entities?i.push({id:c,changes:a}):r.push(a)}return[r,i]}function ae(e){function n(n,t){var r=ie(n,e);r in t.entities||(t.ids.push(r),t.entities[r]=n)}function t(e,t){for(var r=0,i=e=oe(e);r<i.length;r++)n(i[r],t)}function r(n,t){var r=ie(n,e);r in t.entities||t.ids.push(r),t.entities[r]=n}function i(e,n){var t=!1;e.forEach((function(e){e in n.entities&&(delete n.entities[e],t=!0)})),t&&(n.ids=n.ids.filter((function(e){return e in n.entities})))}function o(n,t){var r={},i={};if(n.forEach((function(e){e.id in t.entities&&(i[e.id]={id:e.id,changes:y(y({},i[e.id]?i[e.id].changes:null),e.changes)})})),(n=Object.values(i)).length>0){var o=n.filter((function(n){return function(n,t,r){var i=Object.assign({},r.entities[t.id],t.changes),o=ie(i,e),u=o!==t.id;return u&&(n[t.id]=o,delete r.entities[t.id]),r.entities[o]=i,u}(r,n,t)})).length>0;o&&(t.ids=Object.keys(t.entities))}}function u(n,r){var i=ue(n,e,r),u=i[0];o(i[1],r),t(u,r)}return{removeAll:(a=function(e){Object.assign(e,{ids:[],entities:{}})},c=re((function(e,n){return a(n)})),function(e){return c(e,void 0)}),addOne:re(n),addMany:re(t),setOne:re(r),setMany:re((function(e,n){for(var t=0,i=e=oe(e);t<i.length;t++)r(i[t],n)})),setAll:re((function(e,n){e=oe(e),n.ids=[],n.entities={},t(e,n)})),updateOne:re((function(e,n){return o([e],n)})),updateMany:re(o),upsertOne:re((function(e,n){return u([e],n)})),upsertMany:re(u),removeOne:re((function(e,n){return i([e],n)})),removeMany:re(i)};var a,c}function ce(e){void 0===e&&(e={});var n=y({sortComparer:!1,selectId:function(e){return e.id}},e),t=n.selectId,r=n.sortComparer,i={getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},o={getSelectors:function(e){var n=function(e){return e.ids},t=function(e){return e.entities},r=P(n,t,(function(e,n){return e.map((function(e){return n[e]}))})),i=function(e,n){return n},o=function(e,n){return e[n]},u=P(n,(function(e){return e.length}));if(!e)return{selectIds:n,selectEntities:t,selectAll:r,selectTotal:u,selectById:P(t,i,o)};var a=P(e,t);return{selectIds:P(e,n),selectEntities:a,selectAll:P(e,r),selectTotal:P(e,u),selectById:P(a,i,o)}}},u=r?function(e,n){var t=ae(e);function r(n,t){var r=(n=oe(n)).filter((function(n){return!(ie(n,e)in t.entities)}));0!==r.length&&a(r,t)}function i(e,n){0!==(e=oe(e)).length&&a(e,n)}function o(n,t){for(var r=!1,i=0,o=n;i<o.length;i++){var u=o[i],a=t.entities[u.id];if(a){r=!0,Object.assign(a,u.changes);var f=e(a);u.id!==f&&(delete t.entities[u.id],t.entities[f]=a)}}r&&c(t)}function u(n,t){var i=ue(n,e,t),u=i[0];o(i[1],t),r(u,t)}function a(n,t){n.forEach((function(n){t.entities[e(n)]=n})),c(t)}function c(t){var r=Object.values(t.entities);r.sort(n);var i=r.map(e);(function(e,n){if(e.length!==n.length)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(e[t]!==n[t])return!1;return!0})(t.ids,i)||(t.ids=i)}return{removeOne:t.removeOne,removeMany:t.removeMany,removeAll:t.removeAll,addOne:re((function(e,n){return r([e],n)})),updateOne:re((function(e,n){return o([e],n)})),upsertOne:re((function(e,n){return u([e],n)})),setOne:re((function(e,n){return i([e],n)})),setMany:re(i),setAll:re((function(e,n){e=oe(e),n.entities={},n.ids=[],r(e,n)})),addMany:re(r),updateMany:re(o),upsertMany:re(u)}}(t,r):ae(t);return y(y(y({selectId:t,sortComparer:r},i),o),u)}var fe=function(e){void 0===e&&(e=21);for(var n="",t=e;t--;)n+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return n},le=["name","message","stack","code"],se=function(e,n){this.payload=e,this.meta=n},de=function(e,n){this.payload=e,this.meta=n},pe=function(e){if("object"==typeof e&&null!==e){for(var n={},t=0,r=le;t<r.length;t++){var i=r[t];"string"==typeof e[i]&&(n[i]=e[i])}return n}return{message:String(e)}},ve=function(){function e(e,n,r){var i=T(e+"/fulfilled",(function(e,n,t,r){return{payload:e,meta:h(y({},r||{}),{arg:t,requestId:n,requestStatus:"fulfilled"})}})),o=T(e+"/pending",(function(e,n,t){return{payload:void 0,meta:h(y({},t||{}),{arg:n,requestId:e,requestStatus:"pending"})}})),u=T(e+"/rejected",(function(e,n,t,i,o){return{payload:i,error:(r&&r.serializeError||pe)(e||"Rejected"),meta:h(y({},o||{}),{arg:t,requestId:n,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(c,f,l){var s,d=(null==r?void 0:r.idGenerator)?r.idGenerator(e):fe(),p=new a;function v(e){s=e,p.abort()}var y=function(){return w(this,null,(function(){var a,y,h,g,b,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),null===(w=g=null==(a=null==r?void 0:r.condition)?void 0:a.call(r,e,{getState:f,extra:l}))||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,g];case 1:g=t.sent(),t.label=2;case 2:if(!1===g||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,n){return p.signal.addEventListener("abort",(function(){return n({name:"AbortError",message:s||"Aborted"})}))})),c(o(d,e,null==(y=null==r?void 0:r.getPendingMeta)?void 0:y.call(r,{requestId:d,arg:e},{getState:f,extra:l}))),[4,Promise.race([b,Promise.resolve(n(e,{dispatch:c,getState:f,extra:l,requestId:d,signal:p.signal,abort:v,rejectWithValue:function(e,n){return new se(e,n)},fulfillWithValue:function(e,n){return new de(e,n)}})).then((function(n){if(n instanceof se)throw n;return n instanceof de?i(n.payload,d,e,n.meta):i(n,d,e)}))])];case 3:return h=t.sent(),[3,5];case 4:return m=t.sent(),h=m instanceof se?u(null,d,e,m.payload,m.meta):u(m,d,e),[3,5];case 5:return r&&!r.dispatchConditionRejection&&u.match(h)&&h.meta.condition||c(h),[2,h]}var w}))}))}();return Object.assign(y,{abort:v,requestId:d,arg:e,unwrap:function(){return y.then(ye)}})}}),{pending:o,rejected:u,fulfilled:i,typePrefix:e})}return e.withTypes=function(){return e},e}();function ye(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var he=function(e,n){return I(e)?e.match(n):e(n)};function ge(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(n){return e.some((function(e){return he(e,n)}))}}function be(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(n){return e.every((function(e){return he(e,n)}))}}function me(e,n){if(!e||!e.meta)return!1;var t="string"==typeof e.meta.requestId,r=n.indexOf(e.meta.requestStatus)>-1;return t&&r}function we(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Oe(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return me(e,["pending"])}:we(e)?function(n){var t=e.map((function(e){return e.pending}));return ge.apply(void 0,t)(n)}:Oe()(e[0])}function je(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return me(e,["rejected"])}:we(e)?function(n){var t=e.map((function(e){return e.rejected}));return ge.apply(void 0,t)(n)}:je()(e[0])}function Ae(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||we(e)?function(n){return be(je.apply(void 0,e),t)(n)}:Ae()(e[0])}function Ee(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return me(e,["fulfilled"])}:we(e)?function(n){var t=e.map((function(e){return e.fulfilled}));return ge.apply(void 0,t)(n)}:Ee()(e[0])}function Se(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return me(e,["pending","fulfilled","rejected"])}:we(e)?function(n){for(var t=[],r=0,i=e;r<i.length;r++){var o=i[r];t.push(o.pending,o.rejected,o.fulfilled)}return ge.apply(void 0,t)(n)}:Se()(e[0])}var Pe=function(e,n){if("function"!=typeof e)throw new TypeError(n+" is not a function")},_e=function(){},qe=function(e,n){return void 0===n&&(n=_e),e.catch(n),e},xe=function(e,n){return e.addEventListener("abort",n,{once:!0}),function(){return e.removeEventListener("abort",n)}},Me=function(e,n){var t=e.signal;t.aborted||("reason"in t||Object.defineProperty(t,"reason",{enumerable:!0,value:n,configurable:!0,writable:!0}),e.abort(n))},ke=function(e){this.code=e,this.name="TaskAbortError",this.message="task cancelled (reason: "+e+")"},Ie=function(e){if(e.aborted)throw new ke(e.reason)};function Te(e,n){var t=_e;return new Promise((function(r,i){var o=function(){return i(new ke(e.reason))};e.aborted?o():(t=xe(e,o),n.finally((function(){return t()})).then(r,i))})).finally((function(){t=_e}))}var Ce=function(e){return function(n){return qe(Te(e,n).then((function(n){return Ie(e),n})))}},De=function(e){var n=Ce(e);return function(e){return n(new Promise((function(n){return setTimeout(n,e)})))}},Le=Object.assign,Re={},ze="listenerMiddleware",Ne=function(e){var n=e.type,t=e.actionCreator,r=e.matcher,i=e.predicate,o=e.effect;if(n)i=T(n).match;else if(t)n=t.type,i=t.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Pe(o,"options.listener"),{predicate:i,type:n,effect:o}},Ve=function(e){e.pending.forEach((function(e){Me(e,"listener-cancelled")}))},Be=function(e,n,t){try{e(n,t)}catch(e){setTimeout((function(){throw e}),0)}},Fe=T(ze+"/add"),Ue=T(ze+"/removeAll"),We=T(ze+"/remove"),Xe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,r([ze+"/error"],e))};function Ge(e){var n=this;void 0===e&&(e={});var r=new Map,i=e.extra,o=e.onError,u=void 0===o?Xe:o;Pe(u,"onError");var a=function(e){for(var n=0,t=Array.from(r.values());n<t.length;n++){var i=t[n];if(e(i))return i}},c=function(e){var n=a((function(n){return n.effect===e.effect}));return n||(n=function(e){var n=Ne(e),t=n.type,r=n.predicate,i=n.effect;return{id:fe(),effect:i,type:t,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}}(e)),function(e){return e.unsubscribe=function(){return r.delete(e.id)},r.set(e.id,e),function(n){e.unsubscribe(),(null==n?void 0:n.cancelActive)&&Ve(e)}}(n)},f=function(e){var n=Ne(e),t=n.type,r=n.effect,i=n.predicate,o=a((function(e){return("string"==typeof t?e.type===t:e.predicate===i)&&e.effect===r}));return o&&(o.unsubscribe(),e.cancelActive&&Ve(o)),!!o},l=function(e,o,a,f){return w(n,null,(function(){var n,l,s,d;return t(this,(function(p){switch(p.label){case 0:n=new AbortController,l=function(e,n){return function(r,i){return qe(function(r,i){return w(void 0,null,(function(){var o,u,a,c;return t(this,(function(t){switch(t.label){case 0:Ie(n),o=function(){},u=new Promise((function(n,t){var i=e({predicate:r,effect:function(e,t){t.unsubscribe(),n([e,t.getState(),t.getOriginalState()])}});o=function(){i(),t()}})),a=[u],null!=i&&a.push(new Promise((function(e){return setTimeout(e,i,null)}))),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,Te(n,Promise.race(a))];case 2:return c=t.sent(),Ie(n),[2,c];case 3:return o(),[7];case 4:return[2]}}))}))}(r,i))}}(c,n.signal),s=[],p.label=1;case 1:return p.trys.push([1,3,4,6]),e.pending.add(n),[4,Promise.resolve(e.effect(o,Le({},a,{getOriginalState:f,condition:function(e,n){return l(e,n).then(Boolean)},take:l,delay:De(n.signal),pause:Ce(n.signal),extra:i,signal:n.signal,fork:(v=n.signal,y=s,function(e,n){Pe(e,"taskExecutor");var r,i=new AbortController;r=i,xe(v,(function(){return Me(r,v.reason)}));var o,u,a=(o=function(){return w(void 0,null,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return Ie(v),Ie(i.signal),[4,e({pause:Ce(i.signal),delay:De(i.signal),signal:i.signal})];case 1:return n=t.sent(),Ie(i.signal),[2,n]}}))}))},u=function(){return Me(i,"task-completed")},w(void 0,null,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return n.sent(),[4,o()];case 2:return[2,{status:"ok",value:n.sent()}];case 3:return[2,{status:(e=n.sent())instanceof ke?"cancelled":"rejected",error:e}];case 4:return null==u||u(),[7];case 5:return[2]}}))})));return(null==n?void 0:n.autoJoin)&&y.push(a),{result:Ce(v)(a),cancel:function(){Me(i,"task-cancelled")}}}),unsubscribe:e.unsubscribe,subscribe:function(){r.set(e.id,e)},cancelActiveListeners:function(){e.pending.forEach((function(e,t,r){e!==n&&(Me(e,"listener-cancelled"),r.delete(e))}))}})))];case 2:return p.sent(),[3,6];case 3:return(d=p.sent())instanceof ke||Be(u,d,{raisedBy:"effect"}),[3,6];case 4:return[4,Promise.allSettled(s)];case 5:return p.sent(),Me(n,"listener-completed"),e.pending.delete(n),[7];case 6:return[2]}var v,y}))}))},s=function(e){return function(){e.forEach(Ve),e.clear()}}(r);return{middleware:function(e){return function(n){return function(t){if(!C(t))return n(t);if(Fe.match(t))return c(t.payload);if(!Ue.match(t)){if(We.match(t))return f(t.payload);var i,o=e.getState(),a=function(){if(o===Re)throw new Error(ze+": getOriginalState can only be called synchronously");return o};try{if(i=n(t),r.size>0)for(var d=e.getState(),p=Array.from(r.values()),v=0,y=p;v<y.length;v++){var h=y[v],g=!1;try{g=h.predicate(t,d,o)}catch(e){g=!1,Be(u,e,{raisedBy:"predicate"})}g&&l(h,t,e,a)}}finally{o=Re}return i}s()}}},startListening:c,stopListening:f,clearListeners:s}}var He,Je="RTK_autoBatch",Ke=function(){return function(e){var n;return{payload:e,meta:(n={},n[Je]=!0,n)}}},Qe="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):function(e){return(He||(He=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}),0)}))},Ye=function(e){return function(n){setTimeout(n,e)}},Ze="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ye(10),$e=function(e){return void 0===e&&(e={type:"raf"}),function(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=n.apply(void 0,t),o=!0,u=!1,a=!1,c=new Set,f="tick"===e.type?Qe:"raf"===e.type?Ze:"callback"===e.type?e.queueNotification:Ye(e.timeout),l=function(){a=!1,u&&(u=!1,c.forEach((function(e){return e()})))};return Object.assign({},i,{subscribe:function(e){var n=i.subscribe((function(){return o&&e()}));return c.add(e),function(){n(),c.delete(e)}},dispatch:function(e){var n;try{return o=!(null==(n=null==e?void 0:e.meta)?void 0:n[Je]),(u=!o)&&(a||(a=!0,f(l))),i.dispatch(e)}finally{o=!0}}})}}};(0,O.enableES5)(); | ||
//# sourceMappingURL=redux-toolkit.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&a(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&a(e,n,t[n]);return e},s=(e,r)=>t(e,n(r));import{enableES5 as u}from"immer";export*from"redux";import{default as l,current as f,freeze as d,original as p,isDraft as m}from"immer";import{createSelector as y}from"reselect";import{current as h,isDraft as g}from"immer";import{createSelector as b}from"reselect";var w=(...e)=>{const t=b(...e);return(e,...n)=>t(g(e)?h(e):e,...n)};import{createStore as v,compose as O,applyMiddleware as j,combineReducers as E}from"redux";import{compose as S}from"redux";var A="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?S:S.apply(null,arguments)};function P(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window;import k from"redux-thunk";import x,{isDraftable as I}from"immer";var _=class extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,_.prototype)}static get[Symbol.species](){return _}concat(...e){return super.concat.apply(this,e)}prepend(...e){return 1===e.length&&Array.isArray(e[0])?new _(...e[0].concat(this)):new _(...e.concat(this))}};function C(e){return I(e)?x(e,(()=>{})):e}function M(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function T(e={}){return()=>e=>t=>e(t)}function q(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||P(e)}function D(e,t="",n=q,r,o=[],i){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(null==i?void 0:i.has(e))return!1;const c=null!=r?r(e):Object.entries(e),s=o.length>0;for(const[e,u]of c){const c=t?t+"."+e:e;if(!s||!o.some((e=>e instanceof RegExp?e.test(c):c===e))){if(!n(u))return{keyPath:c,value:u};if("object"==typeof u&&(a=D(u,c,n,r,o,i),a))return a}}return i&&R(e)&&i.add(e),!1}function R(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!R(t))return!1;return!0}function L(e={}){return()=>e=>t=>e(t)}function $(e={}){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0}=e;let o=new _;return t&&o.push("boolean"==typeof t?k:k.withExtraArgument(t.extraArgument)),o}function B(e){const t=function(e){return $(e)},{reducer:n,middleware:r=t(),devTools:o=!0,preloadedState:i,enhancers:a}=e||{};let s;if("function"==typeof n)s=n;else{if(!P(n))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');s=E(n)}let u=r;"function"==typeof u&&(u=u(t));const l=j(...u);let f=O;o&&(f=A(c({trace:!1},"object"==typeof o&&o)));let d=[l];Array.isArray(a)?d=[l,...a]:"function"==typeof a&&(d=a(d));const p=f(...d);return v(s,i,p)}function N(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error("prepareAction did not return an object");return c(c({type:e,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>t.type===e,n}function V(e){return["type","payload","error","meta"].indexOf(e)>-1}function z(e){return`${e}`}import X,{isDraft as W,isDraftable as F}from"immer";function U(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(r in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[r]=n,o},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function K(e,t,n=[],r){let o,[i,a,c]="function"==typeof t?U(t):[t,n,r];if("function"==typeof e)o=()=>C(e());else{const t=C(e);o=()=>t}function s(e=o(),t){let n=[i[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===n.filter((e=>!!e)).length&&(n=[c]),n.reduce(((e,n)=>{if(n){if(W(e)){const r=n(e,t);return void 0===r?e:r}if(F(e))return X(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return s.getInitialState=o,s}function G(e){const{name:t}=e;if(!t)throw new Error("`name` is a required option for createSlice");const n="function"==typeof e.initialState?e.initialState:C(e.initialState),r=e.reducers||{},o=Object.keys(r),i={},a={},s={};function u(){const[t={},r=[],o]="function"==typeof e.extraReducers?U(e.extraReducers):[e.extraReducers],i=c(c({},t),a);return K(n,(e=>{for(let t in i)e.addCase(t,i[t]);for(let t of r)e.addMatcher(t.matcher,t.reducer);o&&e.addDefaultCase(o)}))}let l;return o.forEach((e=>{const n=r[e],o=`${t}/${e}`;let c,u;"reducer"in n?(c=n.reducer,u=n.prepare):c=n,i[e]=c,a[o]=c,s[e]=u?N(o,u):N(o)})),{name:t,reducer:(e,t)=>(l||(l=u()),l(e,t)),actions:s,caseReducers:i,getInitialState:()=>(l||(l=u()),l.getInitialState())}}import H,{isDraft as J}from"immer";function Q(e){const t=Y(((t,n)=>e(n)));return function(e){return t(e,void 0)}}function Y(e){return function(t,n){const r=t=>{var r;P(r=n)&&"string"==typeof r.type&&Object.keys(r).every(V)?e(n.payload,t):e(n,t)};return J(t)?(r(t),t):H(t,r)}}function Z(e,t){return t(e)}function ee(e){return Array.isArray(e)||(e=Object.values(e)),e}function te(e,t,n){e=ee(e);const r=[],o=[];for(const i of e){const e=Z(i,t);e in n.entities?o.push({id:e,changes:i}):r.push(i)}return[r,o]}function ne(e){function t(t,n){const r=Z(t,e);r in n.entities||(n.ids.push(r),n.entities[r]=t)}function n(e,n){e=ee(e);for(const r of e)t(r,n)}function r(t,n){const r=Z(t,e);r in n.entities||n.ids.push(r),n.entities[r]=t}function o(e,t){let n=!1;e.forEach((e=>{e in t.entities&&(delete t.entities[e],n=!0)})),n&&(t.ids=t.ids.filter((e=>e in t.entities)))}function i(t,n){const r={},o={};if(t.forEach((e=>{e.id in n.entities&&(o[e.id]={id:e.id,changes:c(c({},o[e.id]?o[e.id].changes:null),e.changes)})})),(t=Object.values(o)).length>0){const o=t.filter((t=>function(t,n,r){const o=Object.assign({},r.entities[n.id],n.changes),i=Z(o,e),a=i!==n.id;return a&&(t[n.id]=i,delete r.entities[n.id]),r.entities[i]=o,a}(r,t,n))).length>0;o&&(n.ids=Object.keys(n.entities))}}function a(t,r){const[o,a]=te(t,e,r);i(a,r),n(o,r)}return{removeAll:Q((function(e){Object.assign(e,{ids:[],entities:{}})})),addOne:Y(t),addMany:Y(n),setOne:Y(r),setMany:Y((function(e,t){e=ee(e);for(const n of e)r(n,t)})),setAll:Y((function(e,t){e=ee(e),t.ids=[],t.entities={},n(e,t)})),updateOne:Y((function(e,t){return i([e],t)})),updateMany:Y(i),upsertOne:Y((function(e,t){return a([e],t)})),upsertMany:Y(a),removeOne:Y((function(e,t){return o([e],t)})),removeMany:Y(o)}}function re(e={}){const{selectId:t,sortComparer:n}=c({sortComparer:!1,selectId:e=>e.id},e),r={getInitialState:function(e={}){return Object.assign({ids:[],entities:{}},e)}},o={getSelectors:function(e){const t=e=>e.ids,n=e=>e.entities,r=w(t,n,((e,t)=>e.map((e=>t[e])))),o=(e,t)=>t,i=(e,t)=>e[t],a=w(t,(e=>e.length));if(!e)return{selectIds:t,selectEntities:n,selectAll:r,selectTotal:a,selectById:w(n,o,i)};const c=w(e,n);return{selectIds:w(e,t),selectEntities:c,selectAll:w(e,r),selectTotal:w(e,a),selectById:w(c,o,i)}}},i=n?function(e,t){const{removeOne:n,removeMany:r,removeAll:o}=ne(e);function i(t,n){const r=(t=ee(t)).filter((t=>!(Z(t,e)in n.entities)));0!==r.length&&u(r,n)}function a(e,t){0!==(e=ee(e)).length&&u(e,t)}function c(t,n){let r=!1;for(let o of t){const t=n.entities[o.id];if(!t)continue;r=!0,Object.assign(t,o.changes);const i=e(t);o.id!==i&&(delete n.entities[o.id],n.entities[i]=t)}r&&l(n)}function s(t,n){const[r,o]=te(t,e,n);c(o,n),i(r,n)}function u(t,n){t.forEach((t=>{n.entities[e(t)]=t})),l(n)}function l(n){const r=Object.values(n.entities);r.sort(t);const o=r.map(e),{ids:i}=n;(function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length&&n<t.length;n++)if(e[n]!==t[n])return!1;return!0})(i,o)||(n.ids=o)}return{removeOne:n,removeMany:r,removeAll:o,addOne:Y((function(e,t){return i([e],t)})),updateOne:Y((function(e,t){return c([e],t)})),upsertOne:Y((function(e,t){return s([e],t)})),setOne:Y((function(e,t){return a([e],t)})),setMany:Y(a),setAll:Y((function(e,t){e=ee(e),t.entities={},t.ids=[],i(e,t)})),addMany:Y(i),updateMany:Y(c),upsertMany:Y(s)}}(t,n):ne(t);return c(c(c({selectId:t,sortComparer:n},r),o),i)}var oe=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},ie=["name","message","stack","code"],ae=class{constructor(e,t){this.payload=e,this.meta=t}},ce=class{constructor(e,t){this.payload=e,this.meta=t}},se=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of ie)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ue=(()=>{function e(e,t,n){const r=N(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:s(c({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}))),o=N(e+"/pending",((e,t,n)=>({payload:void 0,meta:s(c({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}))),i=N(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||se)(e||"Rejected"),meta:s(c({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}))),a="undefined"!=typeof AbortController?AbortController:class{constructor(){this.signal={aborted:!1,addEventListener(){},dispatchEvent:()=>!1,onabort(){},removeEventListener(){},reason:void 0,throwIfAborted(){}}}abort(){}};return Object.assign((function(e){return(c,s,u)=>{const l=(null==n?void 0:n.idGenerator)?n.idGenerator(e):oe(),f=new a;let d,p=!1;function m(e){d=e,f.abort()}const y=async function(){var a,y;let h;try{let i=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:s,extra:u});if(null!==(g=i)&&"object"==typeof g&&"function"==typeof g.then&&(i=await i),!1===i||f.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};p=!0;const b=new Promise(((e,t)=>f.signal.addEventListener("abort",(()=>t({name:"AbortError",message:d||"Aborted"})))));c(o(l,e,null==(y=null==n?void 0:n.getPendingMeta)?void 0:y.call(n,{requestId:l,arg:e},{getState:s,extra:u}))),h=await Promise.race([b,Promise.resolve(t(e,{dispatch:c,getState:s,extra:u,requestId:l,signal:f.signal,abort:m,rejectWithValue:(e,t)=>new ae(e,t),fulfillWithValue:(e,t)=>new ce(e,t)})).then((t=>{if(t instanceof ae)throw t;return t instanceof ce?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){h=t instanceof ae?i(null,l,e,t.payload,t.meta):i(t,l,e)}var g;return n&&!n.dispatchConditionRejection&&i.match(h)&&h.meta.condition||c(h),h}();return Object.assign(y,{abort:m,requestId:l,arg:e,unwrap:()=>y.then(le)})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=()=>e,e})();function le(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var fe=(e,t)=>{return(n=e)&&"function"==typeof n.match?e.match(t):e(t);var n};function de(...e){return t=>e.some((e=>fe(e,t)))}function pe(...e){return t=>e.every((e=>fe(e,t)))}function me(e,t){if(!e||!e.meta)return!1;const n="string"==typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function ye(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function he(...e){return 0===e.length?e=>me(e,["pending"]):ye(e)?t=>de(...e.map((e=>e.pending)))(t):he()(e[0])}function ge(...e){return 0===e.length?e=>me(e,["rejected"]):ye(e)?t=>de(...e.map((e=>e.rejected)))(t):ge()(e[0])}function be(...e){const t=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===e.length||ye(e)?n=>pe(ge(...e),t)(n):be()(e[0])}function we(...e){return 0===e.length?e=>me(e,["fulfilled"]):ye(e)?t=>de(...e.map((e=>e.fulfilled)))(t):we()(e[0])}function ve(...e){return 0===e.length?e=>me(e,["pending","fulfilled","rejected"]):ye(e)?t=>{const n=[];for(const t of e)n.push(t.pending,t.rejected,t.fulfilled);return de(...n)(t)}:ve()(e[0])}var Oe=(e,t)=>{if("function"!=typeof e)throw new TypeError(`${t} is not a function`)},je=()=>{},Ee=(e,t=je)=>(e.catch(t),e),Se=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ae=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Pe=class{constructor(e){this.code=e,this.name="TaskAbortError",this.message=`task cancelled (reason: ${e})`}},ke=e=>{if(e.aborted)throw new Pe(e.reason)};function xe(e,t){let n=je;return new Promise(((r,o)=>{const i=()=>o(new Pe(e.reason));e.aborted?i():(n=Se(e,i),t.finally((()=>n())).then(r,o))})).finally((()=>{n=je}))}var Ie=e=>t=>Ee(xe(e,t).then((t=>(ke(e),t)))),_e=e=>{const t=Ie(e);return e=>t(new Promise((t=>setTimeout(t,e))))},{assign:Ce}=Object,Me={},Te="listenerMiddleware",qe=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=N(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Oe(i,"options.listener"),{predicate:o,type:t,effect:i}},De=e=>{e.pending.forEach((e=>{Ae(e,"listener-cancelled")}))},Re=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout((()=>{throw e}),0)}},Le=N(`${Te}/add`),$e=N(`${Te}/removeAll`),Be=N(`${Te}/remove`),Ne=(...e)=>{console.error(`${Te}/error`,...e)};function Ve(e={}){const t=new Map,{extra:n,onError:r=Ne}=e;Oe(r,"onError");const o=e=>{for(const n of Array.from(t.values()))if(e(n))return n},i=e=>{let n=o((t=>t.effect===e.effect));return n||(n=(e=>{const{type:t,predicate:n,effect:r}=qe(e);return{id:oe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error("Unsubscribe not initialized")}}})(e)),(e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),(null==t?void 0:t.cancelActive)&&De(e)}))(n)},a=e=>{const{type:t,effect:n,predicate:r}=qe(e),i=o((e=>("string"==typeof t?e.type===t:e.predicate===r)&&e.effect===n));return i&&(i.unsubscribe(),e.cancelActive&&De(i)),!!i},c=async(e,o,a,c)=>{const s=new AbortController,u=((e,t)=>(n,r)=>Ee((async(n,r)=>{ke(t);let o=()=>{};const i=[new Promise(((t,r)=>{let i=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});o=()=>{i(),r()}}))];null!=r&&i.push(new Promise((e=>setTimeout(e,r,null))));try{const e=await xe(t,Promise.race(i));return ke(t),e}finally{o()}})(n,r)))(i,s.signal);try{e.pending.add(s),await Promise.resolve(e.effect(o,Ce({},a,{getOriginalState:c,condition:(e,t)=>u(e,t).then(Boolean),take:u,delay:_e(s.signal),pause:Ie(s.signal),extra:n,signal:s.signal,fork:(l=s.signal,e=>{Oe(e,"taskExecutor");const t=new AbortController;var n;n=t,Se(l,(()=>Ae(n,l.reason)));const r=(async(n,r)=>{try{return await Promise.resolve(),{status:"ok",value:await(async()=>{ke(l),ke(t.signal);const n=await e({pause:Ie(t.signal),delay:_e(t.signal),signal:t.signal});return ke(t.signal),n})()}}catch(e){return{status:e instanceof Pe?"cancelled":"rejected",error:e}}finally{null==r||r()}})(0,(()=>Ae(t,"task-completed")));return{result:Ie(l)(r),cancel(){Ae(t,"task-cancelled")}}}),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach(((e,t,n)=>{e!==s&&(Ae(e,"listener-cancelled"),n.delete(e))}))}})))}catch(e){e instanceof Pe||Re(r,e,{raisedBy:"effect"})}finally{Ae(s,"listener-completed"),e.pending.delete(s)}var l},s=(e=>()=>{e.forEach(De),e.clear()})(t);return{middleware:e=>n=>o=>{if(Le.match(o))return i(o.payload);if($e.match(o))return void s();if(Be.match(o))return a(o.payload);let u=e.getState();const l=()=>{if(u===Me)throw new Error(`${Te}: getOriginalState can only be called synchronously`);return u};let f;try{if(f=n(o),t.size>0){let n=e.getState();const i=Array.from(t.values());for(let t of i){let i=!1;try{i=t.predicate(o,n,u)}catch(e){i=!1,Re(r,e,{raisedBy:"predicate"})}i&&c(t,o,e,l)}}}finally{u=Me}return f},startListening:i,stopListening:a,clearListeners:s}}var ze,Xe="RTK_autoBatch",We=()=>e=>({payload:e,meta:{RTK_autoBatch:!0}}),Fe="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):e=>(ze||(ze=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0))),Ue=e=>t=>{setTimeout(t,e)},Ke="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ue(10),Ge=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const c=new Set,s="tick"===e.type?Fe:"raf"===e.type?Ke:"callback"===e.type?e.queueNotification:Ue(e.timeout),u=()=>{a=!1,i&&(i=!1,c.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return c.add(e),()=>{t(),c.delete(e)}},dispatch(e){var t;try{return o=!(null==(t=null==e?void 0:e.meta)?void 0:t.RTK_autoBatch),i=!o,i&&(a||(a=!0,s(u))),r.dispatch(e)}finally{o=!0}}})};u();export{_ as MiddlewareArray,Xe as SHOULD_AUTOBATCH,Pe as TaskAbortError,Le as addListener,Ge as autoBatchEnhancer,$e as clearAllListeners,B as configureStore,N as createAction,ue as createAsyncThunk,w as createDraftSafeSelector,re as createEntityAdapter,T as createImmutableStateInvariantMiddleware,Ve as createListenerMiddleware,l as createNextState,K as createReducer,y as createSelector,L as createSerializableStateInvariantMiddleware,G as createSlice,f as current,D as findNonSerializableValue,d as freeze,$ as getDefaultMiddleware,z as getType,pe as isAllOf,de as isAnyOf,ve as isAsyncThunkAction,m as isDraft,we as isFulfilled,M as isImmutableDefault,he as isPending,q as isPlain,P as isPlainObject,ge as isRejected,be as isRejectedWithValue,se as miniSerializeError,oe as nanoid,p as original,We as prepareAutoBatched,Be as removeListener,le as unwrapResult}; | ||
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&a(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&a(e,n,t[n]);return e},s=(e,r)=>t(e,n(r));import{enableES5 as u}from"immer";export*from"redux";import{default as l,current as f,freeze as d,original as p,isDraft as y}from"immer";import{createSelector as m}from"reselect";import{current as h,isDraft as g}from"immer";import{createSelector as b}from"reselect";var w=(...e)=>{const t=b(...e);return(e,...n)=>t(g(e)?h(e):e,...n)};import{createStore as v,compose as O,applyMiddleware as j,combineReducers as E}from"redux";import{compose as S}from"redux";var A="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?S:S.apply(null,arguments)};function P(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window;import k from"redux-thunk";var x=e=>e&&"function"==typeof e.match;function C(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error("prepareAction did not return an object");return c(c({type:e,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>t.type===e,n}function I(e){return P(e)&&"type"in e}function _(e){return"function"==typeof e&&"type"in e&&x(e)}function M(e){return I(e)&&"string"==typeof e.type&&Object.keys(e).every(T)}function T(e){return["type","payload","error","meta"].indexOf(e)>-1}function q(e){return`${e}`}function D(e={}){return()=>e=>t=>e(t)}import R,{isDraftable as L}from"immer";var $=class extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,$.prototype)}static get[Symbol.species](){return $}concat(...e){return super.concat.apply(this,e)}prepend(...e){return 1===e.length&&Array.isArray(e[0])?new $(...e[0].concat(this)):new $(...e.concat(this))}},B=class extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,B.prototype)}static get[Symbol.species](){return B}concat(...e){return super.concat.apply(this,e)}prepend(...e){return 1===e.length&&Array.isArray(e[0])?new B(...e[0].concat(this)):new B(...e.concat(this))}};function N(e){return L(e)?R(e,(()=>{})):e}function V(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function z(e={}){return()=>e=>t=>e(t)}function X(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||P(e)}function F(e,t="",n=X,r,o=[],i){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(null==i?void 0:i.has(e))return!1;const c=null!=r?r(e):Object.entries(e),s=o.length>0;for(const[e,u]of c){const c=t?t+"."+e:e;if(!s||!o.some((e=>e instanceof RegExp?e.test(c):c===e))){if(!n(u))return{keyPath:c,value:u};if("object"==typeof u&&(a=F(u,c,n,r,o,i),a))return a}}return i&&W(e)&&i.add(e),!1}function W(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!W(t))return!1;return!0}function U(e={}){return()=>e=>t=>e(t)}function K(e={}){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e;let i=new $;return t&&i.push("boolean"==typeof t?k:k.withExtraArgument(t.extraArgument)),i}function G(e){const t=function(e){return K(e)},{reducer:n,middleware:r=t(),devTools:o=!0,preloadedState:i,enhancers:a}=e||{};let s;if("function"==typeof n)s=n;else{if(!P(n))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');s=E(n)}let u=r;"function"==typeof u&&(u=u(t));const l=j(...u);let f=O;o&&(f=A(c({trace:!1},"object"==typeof o&&o)));const d=new B(l);let p=d;Array.isArray(a)?p=[l,...a]:"function"==typeof a&&(p=a(d));const y=f(...p);return v(s,i,y)}import J,{isDraft as H,isDraftable as Q}from"immer";function Y(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[r]=n,o},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function Z(e,t,n=[],r){let o,[i,a,c]="function"==typeof t?Y(t):[t,n,r];if("function"==typeof e)o=()=>N(e());else{const t=N(e);o=()=>t}function s(e=o(),t){let n=[i[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===n.filter((e=>!!e)).length&&(n=[c]),n.reduce(((e,n)=>{if(n){if(H(e)){const r=n(e,t);return void 0===r?e:r}if(Q(e))return J(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return s.getInitialState=o,s}function ee(e){const{name:t}=e;if(!t)throw new Error("`name` is a required option for createSlice");const n="function"==typeof e.initialState?e.initialState:N(e.initialState),r=e.reducers||{},o=Object.keys(r),i={},a={},s={};function u(){const[t={},r=[],o]="function"==typeof e.extraReducers?Y(e.extraReducers):[e.extraReducers],i=c(c({},t),a);return Z(n,(e=>{for(let t in i)e.addCase(t,i[t]);for(let t of r)e.addMatcher(t.matcher,t.reducer);o&&e.addDefaultCase(o)}))}let l;return o.forEach((e=>{const n=r[e],o=`${t}/${e}`;let c,u;"reducer"in n?(c=n.reducer,u=n.prepare):c=n,i[e]=c,a[o]=c,s[e]=u?C(o,u):C(o)})),{name:t,reducer:(e,t)=>(l||(l=u()),l(e,t)),actions:s,caseReducers:i,getInitialState:()=>(l||(l=u()),l.getInitialState())}}import te,{isDraft as ne}from"immer";function re(e){const t=oe(((t,n)=>e(n)));return function(e){return t(e,void 0)}}function oe(e){return function(t,n){const r=t=>{M(n)?e(n.payload,t):e(n,t)};return ne(t)?(r(t),t):te(t,r)}}function ie(e,t){return t(e)}function ae(e){return Array.isArray(e)||(e=Object.values(e)),e}function ce(e,t,n){e=ae(e);const r=[],o=[];for(const i of e){const e=ie(i,t);e in n.entities?o.push({id:e,changes:i}):r.push(i)}return[r,o]}function se(e){function t(t,n){const r=ie(t,e);r in n.entities||(n.ids.push(r),n.entities[r]=t)}function n(e,n){e=ae(e);for(const r of e)t(r,n)}function r(t,n){const r=ie(t,e);r in n.entities||n.ids.push(r),n.entities[r]=t}function o(e,t){let n=!1;e.forEach((e=>{e in t.entities&&(delete t.entities[e],n=!0)})),n&&(t.ids=t.ids.filter((e=>e in t.entities)))}function i(t,n){const r={},o={};if(t.forEach((e=>{e.id in n.entities&&(o[e.id]={id:e.id,changes:c(c({},o[e.id]?o[e.id].changes:null),e.changes)})})),(t=Object.values(o)).length>0){const o=t.filter((t=>function(t,n,r){const o=Object.assign({},r.entities[n.id],n.changes),i=ie(o,e),a=i!==n.id;return a&&(t[n.id]=i,delete r.entities[n.id]),r.entities[i]=o,a}(r,t,n))).length>0;o&&(n.ids=Object.keys(n.entities))}}function a(t,r){const[o,a]=ce(t,e,r);i(a,r),n(o,r)}return{removeAll:re((function(e){Object.assign(e,{ids:[],entities:{}})})),addOne:oe(t),addMany:oe(n),setOne:oe(r),setMany:oe((function(e,t){e=ae(e);for(const n of e)r(n,t)})),setAll:oe((function(e,t){e=ae(e),t.ids=[],t.entities={},n(e,t)})),updateOne:oe((function(e,t){return i([e],t)})),updateMany:oe(i),upsertOne:oe((function(e,t){return a([e],t)})),upsertMany:oe(a),removeOne:oe((function(e,t){return o([e],t)})),removeMany:oe(o)}}function ue(e={}){const{selectId:t,sortComparer:n}=c({sortComparer:!1,selectId:e=>e.id},e),r={getInitialState:function(e={}){return Object.assign({ids:[],entities:{}},e)}},o={getSelectors:function(e){const t=e=>e.ids,n=e=>e.entities,r=w(t,n,((e,t)=>e.map((e=>t[e])))),o=(e,t)=>t,i=(e,t)=>e[t],a=w(t,(e=>e.length));if(!e)return{selectIds:t,selectEntities:n,selectAll:r,selectTotal:a,selectById:w(n,o,i)};const c=w(e,n);return{selectIds:w(e,t),selectEntities:c,selectAll:w(e,r),selectTotal:w(e,a),selectById:w(c,o,i)}}},i=n?function(e,t){const{removeOne:n,removeMany:r,removeAll:o}=se(e);function i(t,n){const r=(t=ae(t)).filter((t=>!(ie(t,e)in n.entities)));0!==r.length&&u(r,n)}function a(e,t){0!==(e=ae(e)).length&&u(e,t)}function c(t,n){let r=!1;for(let o of t){const t=n.entities[o.id];if(!t)continue;r=!0,Object.assign(t,o.changes);const i=e(t);o.id!==i&&(delete n.entities[o.id],n.entities[i]=t)}r&&l(n)}function s(t,n){const[r,o]=ce(t,e,n);c(o,n),i(r,n)}function u(t,n){t.forEach((t=>{n.entities[e(t)]=t})),l(n)}function l(n){const r=Object.values(n.entities);r.sort(t);const o=r.map(e),{ids:i}=n;(function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length&&n<t.length;n++)if(e[n]!==t[n])return!1;return!0})(i,o)||(n.ids=o)}return{removeOne:n,removeMany:r,removeAll:o,addOne:oe((function(e,t){return i([e],t)})),updateOne:oe((function(e,t){return c([e],t)})),upsertOne:oe((function(e,t){return s([e],t)})),setOne:oe((function(e,t){return a([e],t)})),setMany:oe(a),setAll:oe((function(e,t){e=ae(e),t.entities={},t.ids=[],i(e,t)})),addMany:oe(i),updateMany:oe(c),upsertMany:oe(s)}}(t,n):se(t);return c(c(c({selectId:t,sortComparer:n},r),o),i)}var le=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},fe=["name","message","stack","code"],de=class{constructor(e,t){this.payload=e,this.meta=t}},pe=class{constructor(e,t){this.payload=e,this.meta=t}},ye=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of fe)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},me=(()=>{function e(e,t,n){const r=C(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:s(c({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}))),o=C(e+"/pending",((e,t,n)=>({payload:void 0,meta:s(c({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}))),i=C(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||ye)(e||"Rejected"),meta:s(c({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}))),a="undefined"!=typeof AbortController?AbortController:class{constructor(){this.signal={aborted:!1,addEventListener(){},dispatchEvent:()=>!1,onabort(){},removeEventListener(){},reason:void 0,throwIfAborted(){}}}abort(){}};return Object.assign((function(e){return(c,s,u)=>{const l=(null==n?void 0:n.idGenerator)?n.idGenerator(e):le(),f=new a;let d,p=!1;function y(e){d=e,f.abort()}const m=async function(){var a,m;let h;try{let i=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:s,extra:u});if(null!==(g=i)&&"object"==typeof g&&"function"==typeof g.then&&(i=await i),!1===i||f.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};p=!0;const b=new Promise(((e,t)=>f.signal.addEventListener("abort",(()=>t({name:"AbortError",message:d||"Aborted"})))));c(o(l,e,null==(m=null==n?void 0:n.getPendingMeta)?void 0:m.call(n,{requestId:l,arg:e},{getState:s,extra:u}))),h=await Promise.race([b,Promise.resolve(t(e,{dispatch:c,getState:s,extra:u,requestId:l,signal:f.signal,abort:y,rejectWithValue:(e,t)=>new de(e,t),fulfillWithValue:(e,t)=>new pe(e,t)})).then((t=>{if(t instanceof de)throw t;return t instanceof pe?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){h=t instanceof de?i(null,l,e,t.payload,t.meta):i(t,l,e)}var g;return n&&!n.dispatchConditionRejection&&i.match(h)&&h.meta.condition||c(h),h}();return Object.assign(m,{abort:y,requestId:l,arg:e,unwrap:()=>m.then(he)})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=()=>e,e})();function he(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ge=(e,t)=>x(e)?e.match(t):e(t);function be(...e){return t=>e.some((e=>ge(e,t)))}function we(...e){return t=>e.every((e=>ge(e,t)))}function ve(e,t){if(!e||!e.meta)return!1;const n="string"==typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function Oe(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function je(...e){return 0===e.length?e=>ve(e,["pending"]):Oe(e)?t=>be(...e.map((e=>e.pending)))(t):je()(e[0])}function Ee(...e){return 0===e.length?e=>ve(e,["rejected"]):Oe(e)?t=>be(...e.map((e=>e.rejected)))(t):Ee()(e[0])}function Se(...e){const t=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===e.length||Oe(e)?n=>we(Ee(...e),t)(n):Se()(e[0])}function Ae(...e){return 0===e.length?e=>ve(e,["fulfilled"]):Oe(e)?t=>be(...e.map((e=>e.fulfilled)))(t):Ae()(e[0])}function Pe(...e){return 0===e.length?e=>ve(e,["pending","fulfilled","rejected"]):Oe(e)?t=>{const n=[];for(const t of e)n.push(t.pending,t.rejected,t.fulfilled);return be(...n)(t)}:Pe()(e[0])}var ke=(e,t)=>{if("function"!=typeof e)throw new TypeError(`${t} is not a function`)},xe=()=>{},Ce=(e,t=xe)=>(e.catch(t),e),Ie=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),_e=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Me=class{constructor(e){this.code=e,this.name="TaskAbortError",this.message=`task cancelled (reason: ${e})`}},Te=e=>{if(e.aborted)throw new Me(e.reason)};function qe(e,t){let n=xe;return new Promise(((r,o)=>{const i=()=>o(new Me(e.reason));e.aborted?i():(n=Ie(e,i),t.finally((()=>n())).then(r,o))})).finally((()=>{n=xe}))}var De=e=>t=>Ce(qe(e,t).then((t=>(Te(e),t)))),Re=e=>{const t=De(e);return e=>t(new Promise((t=>setTimeout(t,e))))},{assign:Le}=Object,$e={},Be="listenerMiddleware",Ne=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=C(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return ke(i,"options.listener"),{predicate:o,type:t,effect:i}},Ve=e=>{e.pending.forEach((e=>{_e(e,"listener-cancelled")}))},ze=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout((()=>{throw e}),0)}},Xe=C(`${Be}/add`),Fe=C(`${Be}/removeAll`),We=C(`${Be}/remove`),Ue=(...e)=>{console.error(`${Be}/error`,...e)};function Ke(e={}){const t=new Map,{extra:n,onError:r=Ue}=e;ke(r,"onError");const o=e=>{for(const n of Array.from(t.values()))if(e(n))return n},i=e=>{let n=o((t=>t.effect===e.effect));return n||(n=(e=>{const{type:t,predicate:n,effect:r}=Ne(e);return{id:le(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error("Unsubscribe not initialized")}}})(e)),(e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),(null==t?void 0:t.cancelActive)&&Ve(e)}))(n)},a=e=>{const{type:t,effect:n,predicate:r}=Ne(e),i=o((e=>("string"==typeof t?e.type===t:e.predicate===r)&&e.effect===n));return i&&(i.unsubscribe(),e.cancelActive&&Ve(i)),!!i},c=async(e,o,a,c)=>{const s=new AbortController,u=((e,t)=>(n,r)=>Ce((async(n,r)=>{Te(t);let o=()=>{};const i=[new Promise(((t,r)=>{let i=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});o=()=>{i(),r()}}))];null!=r&&i.push(new Promise((e=>setTimeout(e,r,null))));try{const e=await qe(t,Promise.race(i));return Te(t),e}finally{o()}})(n,r)))(i,s.signal),l=[];try{e.pending.add(s),await Promise.resolve(e.effect(o,Le({},a,{getOriginalState:c,condition:(e,t)=>u(e,t).then(Boolean),take:u,delay:Re(s.signal),pause:De(s.signal),extra:n,signal:s.signal,fork:(f=s.signal,d=l,(e,t)=>{ke(e,"taskExecutor");const n=new AbortController;var r;r=n,Ie(f,(()=>_e(r,f.reason)));const o=(async(t,r)=>{try{return await Promise.resolve(),{status:"ok",value:await(async()=>{Te(f),Te(n.signal);const t=await e({pause:De(n.signal),delay:Re(n.signal),signal:n.signal});return Te(n.signal),t})()}}catch(e){return{status:e instanceof Me?"cancelled":"rejected",error:e}}finally{null==r||r()}})(0,(()=>_e(n,"task-completed")));return(null==t?void 0:t.autoJoin)&&d.push(o),{result:De(f)(o),cancel(){_e(n,"task-cancelled")}}}),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach(((e,t,n)=>{e!==s&&(_e(e,"listener-cancelled"),n.delete(e))}))}})))}catch(e){e instanceof Me||ze(r,e,{raisedBy:"effect"})}finally{await Promise.allSettled(l),_e(s,"listener-completed"),e.pending.delete(s)}var f,d},s=(e=>()=>{e.forEach(Ve),e.clear()})(t);return{middleware:e=>n=>o=>{if(!I(o))return n(o);if(Xe.match(o))return i(o.payload);if(Fe.match(o))return void s();if(We.match(o))return a(o.payload);let u=e.getState();const l=()=>{if(u===$e)throw new Error(`${Be}: getOriginalState can only be called synchronously`);return u};let f;try{if(f=n(o),t.size>0){let n=e.getState();const i=Array.from(t.values());for(let t of i){let i=!1;try{i=t.predicate(o,n,u)}catch(e){i=!1,ze(r,e,{raisedBy:"predicate"})}i&&c(t,o,e,l)}}}finally{u=$e}return f},startListening:i,stopListening:a,clearListeners:s}}var Ge,Je="RTK_autoBatch",He=()=>e=>({payload:e,meta:{RTK_autoBatch:!0}}),Qe="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):e=>(Ge||(Ge=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0))),Ye=e=>t=>{setTimeout(t,e)},Ze="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ye(10),et=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const c=new Set,s="tick"===e.type?Qe:"raf"===e.type?Ze:"callback"===e.type?e.queueNotification:Ye(e.timeout),u=()=>{a=!1,i&&(i=!1,c.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return c.add(e),()=>{t(),c.delete(e)}},dispatch(e){var t;try{return o=!(null==(t=null==e?void 0:e.meta)?void 0:t.RTK_autoBatch),i=!o,i&&(a||(a=!0,s(u))),r.dispatch(e)}finally{o=!0}}})};u();export{B as EnhancerArray,$ as MiddlewareArray,Je as SHOULD_AUTOBATCH,Me as TaskAbortError,Xe as addListener,et as autoBatchEnhancer,Fe as clearAllListeners,G as configureStore,C as createAction,D as createActionCreatorInvariantMiddleware,me as createAsyncThunk,w as createDraftSafeSelector,ue as createEntityAdapter,z as createImmutableStateInvariantMiddleware,Ke as createListenerMiddleware,l as createNextState,Z as createReducer,m as createSelector,U as createSerializableStateInvariantMiddleware,ee as createSlice,f as current,F as findNonSerializableValue,d as freeze,K as getDefaultMiddleware,q as getType,I as isAction,_ as isActionCreator,we as isAllOf,be as isAnyOf,Pe as isAsyncThunkAction,y as isDraft,M as isFluxStandardAction,Ae as isFulfilled,V as isImmutableDefault,je as isPending,X as isPlain,P as isPlainObject,Ee as isRejected,Se as isRejectedWithValue,ye as miniSerializeError,le as nanoid,p as original,He as prepareAutoBatched,We as removeListener,he as unwrapResult}; | ||
//# sourceMappingURL=redux-toolkit.modern.production.min.js.map |
@@ -7,51 +7,56 @@ (function (global, factory) { | ||
var t,e,n,r=undefined&&undefined.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e;}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r);}),o=undefined&&undefined.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u);}catch(t){i=[6,t],r=0;}finally{n=o=0;}if(5&i[0])throw i[1];return {value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},i=undefined&&undefined.__spreadArray||function(t,e){for(var n=0,r=e.length,o=t.length;n<r;n++,o++)t[o]=e[n];return t},u=Object.defineProperty,c=Object.defineProperties,a=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,d=function(t,e,n){return e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},p=function(t,e){for(var n in e||(e={}))l.call(e,n)&&d(t,n,e[n]);if(f)for(var r=0,o=f(e);r<o.length;r++)s.call(e,n=o[r])&&d(t,n,e[n]);return t},v=function(t,e){return c(t,a(e))},y=function(t,e,n){return new Promise((function(r,o){var i=function(t){try{c(n.next(t));}catch(t){o(t);}},u=function(t){try{c(n.throw(t));}catch(t){o(t);}},c=function(t){return t.done?r(t.value):Promise.resolve(t.value).then(i,u)};c((n=n.apply(t,e)).next());}))};function h(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(n.length?" "+n.map((function(t){return "'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function g(t){return !!t&&!!t[nt]}function b(t){var e;return !!t&&(function(t){if(!t||"object"!=typeof t)return !1;var e=Object.getPrototypeOf(t);if(null===e)return !0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===rt}(t)||Array.isArray(t)||!!t[et]||!!(null===(e=t.constructor)||void 0===e?void 0:e[et])||A(t)||S(t))}function m(t){return g(t)||h(23,t),t[nt].t}function w(t,e,n){void 0===n&&(n=!1),0===O(t)?(n?Object.keys:ot)(t).forEach((function(r){n&&"symbol"==typeof r||e(r,t[r],t);})):t.forEach((function(n,r){return e(r,n,t)}));}function O(t){var e=t[nt];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:A(t)?2:S(t)?3:0}function j(t,e){return 2===O(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function P(t,e,n){var r=O(t);2===r?t.set(e,n):3===r?(t.delete(e),t.add(n)):t[e]=n;}function E(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function A(t){return Q&&t instanceof Map}function S(t){return Y&&t instanceof Set}function _(t){return t.o||t.t}function k(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=it(t);delete e[nt];for(var n=ot(e),r=0;r<n.length;r++){var o=n[r],i=e[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]});}return Object.create(Object.getPrototypeOf(t),e)}function x(t,e){return void 0===e&&(e=!1),D(t)||g(t)||!b(t)||(O(t)>1&&(t.set=t.add=t.clear=t.delete=I),Object.freeze(t),e&&w(t,(function(t,e){return x(e,!0)}),!0)),t}function I(){h(2);}function D(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function T(t){var e=ut[t];return e||h(18,t),e}function N(){return n}function C(t,e){e&&(T("Patches"),t.u=[],t.s=[],t.v=e);}function R(t){M(t),t.p.forEach(q),t.p=null;}function M(t){t===n&&(n=t.l);}function F(t){return n={p:[],l:n,h:t,m:!0,_:0}}function q(t){var e=t[nt];0===e.i||1===e.i?e.j():e.O=!0;}function z(t,e){e._=e.p.length;var n=e.p[0],r=void 0!==t&&t!==n;return e.h.g||T("ES5").S(e,t,r),r?(n[nt].P&&(R(e),h(4)),b(t)&&(t=L(e,t),e.l||K(e,t)),e.u&&T("Patches").M(n[nt].t,t,e.u,e.s)):t=L(e,n,[]),R(e),e.u&&e.v(e.u,e.s),t!==tt?t:void 0}function L(t,e,n){if(D(e))return e;var r=e[nt];if(!r)return w(e,(function(o,i){return U(t,r,e,o,i,n)}),!0),e;if(r.A!==t)return e;if(!r.P)return K(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=k(r.k):r.o;w(3===r.i?new Set(o):o,(function(e,i){return U(t,r,o,e,i,n)})),K(t,o,!1),n&&t.u&&T("Patches").R(r,n,t.u,t.s);}return r.o}function U(t,e,n,r,o,i){if(g(o)){var u=L(t,o,i&&e&&3!==e.i&&!j(e.D,r)?i.concat(r):void 0);if(P(n,r,u),!g(u))return;t.m=!1;}if(b(o)&&!D(o)){if(!t.h.F&&t._<1)return;L(t,o),e&&e.A.l||K(t,o);}}function K(t,e,n){void 0===n&&(n=!1),t.h.F&&t.m&&x(e,n);}function W(t,e){var n=t[nt];return (n?_(n):t)[e]}function B(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n);}}function V(t){t.P||(t.P=!0,t.l&&V(t.l));}function X(t){t.o||(t.o=k(t.t));}function G(t,e,n){var r=A(e)?T("MapSet").N(e,n):S(e)?T("MapSet").T(e,n):t.g?function(t,e){var n=Array.isArray(t),r={i:n?1:0,A:e?e.A:N(),P:!1,I:!1,D:{},l:e,t:t,k:null,o:null,j:null,C:!1},o=r,i=ct;n&&(o=[r],i=at);var u=Proxy.revocable(o,i),c=u.revoke,a=u.proxy;return r.k=a,r.j=c,a}(e,n):T("ES5").J(e,n);return (n?n.A:N()).p.push(r),r}function J(t){return g(t)||h(22,t),function t(e){if(!b(e))return e;var n,r=e[nt],o=O(e);if(r){if(!r.P&&(r.i<4||!T("ES5").K(r)))return r.t;r.I=!0,n=$(e,o),r.I=!1;}else n=$(e,o);return w(n,(function(e,o){r&&function(t,e){return 2===O(t)?t.get(e):t[e]}(r.t,e)===o||P(n,e,t(o));})),3===o?new Set(n):n}(t)}function $(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return k(t)}var H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Q="undefined"!=typeof Map,Y="undefined"!=typeof Set,Z="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,tt=H?Symbol.for("immer-nothing"):((e={})["immer-nothing"]=!0,e),et=H?Symbol.for("immer-draftable"):"__$immer_draftable",nt=H?Symbol.for("immer-state"):"__$immer_state",rt=(""+Object.prototype.constructor),ot="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,it=Object.getOwnPropertyDescriptors||function(t){var e={};return ot(t).forEach((function(n){e[n]=Object.getOwnPropertyDescriptor(t,n);})),e},ut={},ct={get:function(t,e){if(e===nt)return t;var n,r,o,i=_(t);if(!j(i,e))return n=t,(o=B(i,e))?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(n.k):void 0;var u=i[e];return t.I||!b(u)?u:u===W(t.t,e)?(X(t),t.o[e]=G(t.A.h,u,t)):u},has:function(t,e){return e in _(t)},ownKeys:function(t){return Reflect.ownKeys(_(t))},set:function(t,e,n){var r=B(_(t),e);if(null==r?void 0:r.set)return r.set.call(t.k,n),!0;if(!t.P){var o=W(_(t),e),i=null==o?void 0:o[nt];if(i&&i.t===n)return t.o[e]=n,t.D[e]=!1,!0;if(E(n,o)&&(void 0!==n||j(t.t,e)))return !0;X(t),V(t);}return t.o[e]===n&&"number"!=typeof n&&(void 0!==n||e in t.o)||(t.o[e]=n,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==W(t.t,e)||e in t.t?(t.D[e]=!1,X(t),V(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=_(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:r.enumerable,value:n[e]}:r},defineProperty:function(){h(11);},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){h(12);}},at={};w(ct,(function(t,e){at[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)};})),at.deleteProperty=function(t,e){return at.set.call(this,t,e,void 0)},at.set=function(t,e,n){return ct.set.call(this,t[0],e,n,t[0])};var ft=new(function(){function t(t){var e=this;this.g=Z,this.F=!0,this.produce=function(t,n,r){if("function"==typeof t&&"function"!=typeof n){var o=n;n=t;var i=e;return function(t){var e=this;void 0===t&&(t=o);for(var r=arguments.length,u=Array(r>1?r-1:0),c=1;c<r;c++)u[c-1]=arguments[c];return i.produce(t,(function(t){var r;return (r=n).call.apply(r,[e,t].concat(u))}))}}var u;if("function"!=typeof n&&h(6),void 0!==r&&"function"!=typeof r&&h(7),b(t)){var c=F(e),a=G(e,t,void 0),f=!0;try{u=n(a),f=!1;}finally{f?R(c):M(c);}return "undefined"!=typeof Promise&&u instanceof Promise?u.then((function(t){return C(c,r),z(t,c)}),(function(t){throw R(c),t})):(C(c,r),z(u,c))}if(!t||"object"!=typeof t){if(void 0===(u=n(t))&&(u=t),u===tt&&(u=void 0),e.F&&x(u,!0),r){var l=[],s=[];T("Patches").M(t,u,l,s),r(l,s);}return u}h(21,t);},this.produceWithPatches=function(t,n){if("function"==typeof t)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.produceWithPatches(n,(function(e){return t.apply(void 0,[e].concat(o))}))};var r,o,i=e.produce(t,n,(function(t,e){r=t,o=e;}));return "undefined"!=typeof Promise&&i instanceof Promise?i.then((function(t){return [t,r,o]})):[i,r,o]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze);}var e=t.prototype;return e.createDraft=function(t){b(t)||h(8),g(t)&&(t=J(t));var e=F(this),n=G(this,t,void 0);return n[nt].C=!0,M(e),n},e.finishDraft=function(t,e){var n=(t&&t[nt]).A;return C(n,e),z(void 0,n)},e.setAutoFreeze=function(t){this.F=t;},e.setUseProxies=function(t){t&&!Z&&h(20),this.g=t;},e.applyPatches=function(t,e){var n;for(n=e.length-1;n>=0;n--){var r=e[n];if(0===r.path.length&&"replace"===r.op){t=r.value;break}}n>-1&&(e=e.slice(n+1));var o=T("Patches").$;return g(t)?o(t,e):this.produce(t,(function(t){return o(t,e)}))},t}()),lt=ft.produce,st=(ft.produceWithPatches.bind(ft),ft.setAutoFreeze.bind(ft),ft.setUseProxies.bind(ft),ft.applyPatches.bind(ft),ft.createDraft.bind(ft),ft.finishDraft.bind(ft),lt);function dt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function vt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(n),!0).forEach((function(e){dt(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}function yt(t){return "Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ht="function"==typeof Symbol&&Symbol.observable||"@@observable",gt=function(){return Math.random().toString(36).substring(7).split("").join(".")},bt={INIT:"@@redux/INIT"+gt(),REPLACE:"@@redux/REPLACE"+gt(),PROBE_UNKNOWN_ACTION:function(){return "@@redux/PROBE_UNKNOWN_ACTION"+gt()}};function mt(t){if("object"!=typeof t||null===t)return !1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function wt(t,e,n){var r;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(yt(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(yt(1));return n(wt)(t,e)}if("function"!=typeof t)throw new Error(yt(2));var o=t,i=e,u=[],c=u,a=!1;function f(){c===u&&(c=u.slice());}function l(){if(a)throw new Error(yt(3));return i}function s(t){if("function"!=typeof t)throw new Error(yt(4));if(a)throw new Error(yt(5));var e=!0;return f(),c.push(t),function(){if(e){if(a)throw new Error(yt(6));e=!1,f();var n=c.indexOf(t);c.splice(n,1),u=null;}}}function d(t){if(!mt(t))throw new Error(yt(7));if(void 0===t.type)throw new Error(yt(8));if(a)throw new Error(yt(9));try{a=!0,i=o(i,t);}finally{a=!1;}for(var e=u=c,n=0;n<e.length;n++)(0, e[n])();return t}function p(t){if("function"!=typeof t)throw new Error(yt(10));o=t,d({type:bt.REPLACE});}function v(){var t,e=s;return (t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(yt(11));function n(){t.next&&t.next(l());}return n(),{unsubscribe:e(n)}}})[ht]=function(){return this},t}return d({type:bt.INIT}),(r={dispatch:d,subscribe:s,getState:l,replaceReducer:p})[ht]=v,r}var Ot=wt;function jt(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++){var o=e[r];"function"==typeof t[o]&&(n[o]=t[o]);}var i,u=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:bt.INIT}))throw new Error(yt(12));if(void 0===n(void 0,{type:bt.PROBE_UNKNOWN_ACTION()}))throw new Error(yt(13))}));}(n);}catch(t){i=t;}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var r=!1,o={},c=0;c<u.length;c++){var a=u[c],f=t[a],l=(0, n[a])(f,e);if(void 0===l)throw new Error(yt(14));o[a]=l,r=r||l!==f;}return (r=r||u.length!==Object.keys(t).length)?o:t}}function Pt(t,e){return function(){return e(t.apply(this,arguments))}}function Et(t,e){if("function"==typeof t)return Pt(t,e);if("object"!=typeof t||null===t)throw new Error(yt(16));var n={};for(var r in t){var o=t[r];"function"==typeof o&&(n[r]=Pt(o,e));}return n}function At(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function St(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),r=function(){throw new Error(yt(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return r=At.apply(void 0,i)(n.dispatch),vt(vt({},n),{},{dispatch:r})}}}var _t=function(t,e){return t===e};function kt(t,e){var n,r,o,i="object"==typeof e?e:{equalityCheck:e},u=i.equalityCheck,c=i.maxSize,a=void 0===c?1:c,f=i.resultEqualityCheck,l=(o=void 0===u?_t:u,function(t,e){if(null===t||null===e||t.length!==e.length)return !1;for(var n=t.length,r=0;r<n;r++)if(!o(t[r],e[r]))return !1;return !0}),s=1===a?(n=l,{get:function(t){return r&&n(r.key,t)?r.value:"NOT_FOUND"},put:function(t,e){r={key:t,value:e};},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0;}}):function(t,e){var n=[];function r(t){var r=n.findIndex((function(n){return e(t,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return "NOT_FOUND"}return {get:r,put:function(e,o){"NOT_FOUND"===r(e)&&(n.unshift({key:e,value:o}),n.length>t&&n.pop());},getEntries:function(){return n},clear:function(){n=[];}}}(a,l);function d(){var e=s.get(arguments);if("NOT_FOUND"===e){if(e=t.apply(null,arguments),f){var n=s.getEntries(),r=n.find((function(t){return f(t.value,e)}));r&&(e=r.value);}s.put(arguments,e);}return e}return d.clearCache=function(){return s.clear()},d}function xt(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every((function(t){return "function"==typeof t}))){var n=e.map((function(t){return "function"==typeof t?"function "+(t.name||"unnamed")+"()":typeof t})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return e}function It(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i,u=0,c={memoizeOptions:void 0},a=r.pop();if("object"==typeof a&&(c=a,a=r.pop()),"function"!=typeof a)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof a+"]");var f=c,l=f.memoizeOptions,s=void 0===l?n:l,d=Array.isArray(s)?s:[s],p=xt(r),v=t.apply(void 0,[function(){return u++,a.apply(null,arguments)}].concat(d)),y=t((function(){for(var t=[],e=p.length,n=0;n<e;n++)t.push(p[n].apply(null,arguments));return i=v.apply(null,t)}));return Object.assign(y,{resultFunc:a,memoizedResultFunc:v,dependencies:p,lastResult:function(){return i},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),y};return o}var Dt=It(kt),Tt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt.apply(void 0,t),r=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return n.apply(void 0,i([g(t)?J(t):t],e))};return r},Nt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return "object"==typeof arguments[0]?At:At.apply(null,arguments)};function Ct(t){if("object"!=typeof t||null===t)return !1;var e=Object.getPrototypeOf(t);if(null===e)return !0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n}function Rt(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(o){return "function"==typeof o?o(n,r,t):e(o)}}}}var Mt=Rt();Mt.withExtraArgument=Rt;var Ft=Mt,qt=function(t){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.apply(this,n)||this;return Object.setPrototypeOf(o,e.prototype),o}return r(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,i([void 0],t[0].concat(this)))):new(e.bind.apply(e,i([void 0],t.concat(this))))},e}(Array);function zt(t){return b(t)?st(t,(function(){})):t}function Lt(t){var e=typeof t;return null==t||"string"===e||"boolean"===e||"number"===e||Array.isArray(t)||Ct(t)}function Ut(t,e,n,r,o,i){var u;if(void 0===e&&(e=""),void 0===n&&(n=Lt),void 0===o&&(o=[]),!n(t))return {keyPath:e||"<root>",value:t};if("object"!=typeof t||null===t)return !1;if(null==i?void 0:i.has(t))return !1;for(var c=null!=r?r(t):Object.entries(t),a=o.length>0,f=function(t,c){var f=e?e+"."+t:t;return a&&o.some((function(t){return t instanceof RegExp?t.test(f):f===t}))?"continue":n(c)?"object"==typeof c&&(u=Ut(c,f,n,r,o,i))?{value:u}:void 0:{value:{keyPath:f,value:c}}},l=0,s=c;l<s.length;l++){var d=s[l],p=f(d[0],d[1]);if("object"==typeof p)return p.value}return i&&Kt(t)&&i.add(t),!1}function Kt(t){if(!Object.isFrozen(t))return !1;for(var e=0,n=Object.values(t);e<n.length;e++){var r=n[e];if("object"==typeof r&&null!==r&&!Kt(r))return !1}return !0}function Wt(t){return function(){return function(t){return function(e){return t(e)}}}}function Bt(t){void 0===t&&(t={});var e=t.thunk,n=void 0===e||e,r=new qt;return n&&r.push("boolean"==typeof n?Ft:Ft.withExtraArgument(n.extraArgument)),r}function Vt(t){var e,n=function(t){return Bt(t)},r=t||{},o=r.reducer,u=void 0===o?void 0:o,c=r.middleware,a=void 0===c?n():c,f=r.devTools,l=void 0===f||f,s=r.preloadedState,d=void 0===s?void 0:s,v=r.enhancers,y=void 0===v?void 0:v;if("function"==typeof u)e=u;else {if(!Ct(u))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=jt(u);}var h=a;"function"==typeof h&&(h=h(n));var g=St.apply(void 0,h),b=At;l&&(b=Nt(p({trace:!1},"object"==typeof l&&l)));var m=[g];return Array.isArray(y)?m=i([g],y):"function"==typeof y&&(m=y(m)),wt(e,d,b.apply(void 0,m))}function Xt(t,e){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(e){var o=e.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return p(p({type:t,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return {type:t,payload:n[0]}}return n.toString=function(){return ""+t},n.type=t,n.match=function(e){return e.type===t},n}function Gt(t){return ["type","payload","error","meta"].indexOf(t)>-1}function Jt(t){return ""+t}function $t(t){var e,n={},r=[],o={addCase:function(t,e){var r="string"==typeof t?t:t.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=e,o},addMatcher:function(t,e){return r.push({matcher:t,reducer:e}),o},addDefaultCase:function(t){return e=t,o}};return t(o),[n,r,e]}function Ht(t,e,n,r){void 0===n&&(n=[]);var o,u="function"==typeof e?$t(e):[e,n,r],c=u[0],a=u[1],f=u[2];if("function"==typeof t)o=function(){return zt(t())};else {var l=zt(t);o=function(){return l};}function s(t,e){void 0===t&&(t=o());var n=i([c[e.type]],a.filter((function(t){return (0, t.matcher)(e)})).map((function(t){return t.reducer})));return 0===n.filter((function(t){return !!t})).length&&(n=[f]),n.reduce((function(t,n){if(n){var r;if(g(t))return void 0===(r=n(t,e))?t:r;if(b(t))return st(t,(function(t){return n(t,e)}));if(void 0===(r=n(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return t}),t)}return s.getInitialState=o,s}function Qt(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof t.initialState?t.initialState:zt(t.initialState),o=t.reducers||{},i=Object.keys(o),u={},c={},a={};function f(){var e="function"==typeof t.extraReducers?$t(t.extraReducers):[t.extraReducers],n=e[0],o=e[1],i=void 0===o?[]:o,u=e[2],a=void 0===u?void 0:u,f=p(p({},void 0===n?{}:n),c);return Ht(r,(function(t){for(var e in f)t.addCase(e,f[e]);for(var n=0,r=i;n<r.length;n++){var o=r[n];t.addMatcher(o.matcher,o.reducer);}a&&t.addDefaultCase(a);}))}return i.forEach((function(t){var n,r,i=o[t],f=e+"/"+t;"reducer"in i?(n=i.reducer,r=i.prepare):n=i,u[t]=n,c[f]=n,a[t]=r?Xt(f,r):Xt(f);})),{name:e,reducer:function(t,e){return n||(n=f()),n(t,e)},actions:a,caseReducers:u,getInitialState:function(){return n||(n=f()),n.getInitialState()}}}function Yt(t){return "object"!=typeof t||null==t||Object.isFrozen(t)}function Zt(t){return function(){return function(t){return function(e){return t(e)}}}}function te(t){return function(e,n){var r=function(e){var r;Ct(r=n)&&"string"==typeof r.type&&Object.keys(r).every(Gt)?t(n.payload,e):t(n,e);};return g(e)?(r(e),e):st(e,r)}}function ee(t,e){return e(t)}function ne(t){return Array.isArray(t)||(t=Object.values(t)),t}function re(t,e,n){for(var r=[],o=[],i=0,u=t=ne(t);i<u.length;i++){var c=u[i],a=ee(c,e);a in n.entities?o.push({id:a,changes:c}):r.push(c);}return [r,o]}function oe(t){function e(e,n){var r=ee(e,t);r in n.entities||(n.ids.push(r),n.entities[r]=e);}function n(t,n){for(var r=0,o=t=ne(t);r<o.length;r++)e(o[r],n);}function r(e,n){var r=ee(e,t);r in n.entities||n.ids.push(r),n.entities[r]=e;}function o(t,e){var n=!1;t.forEach((function(t){t in e.entities&&(delete e.entities[t],n=!0);})),n&&(e.ids=e.ids.filter((function(t){return t in e.entities})));}function i(e,n){var r={},o={};if(e.forEach((function(t){t.id in n.entities&&(o[t.id]={id:t.id,changes:p(p({},o[t.id]?o[t.id].changes:null),t.changes)});})),(e=Object.values(o)).length>0){var i=e.filter((function(e){return function(e,n,r){var o=Object.assign({},r.entities[n.id],n.changes),i=ee(o,t),u=i!==n.id;return u&&(e[n.id]=i,delete r.entities[n.id]),r.entities[i]=o,u}(r,e,n)})).length>0;i&&(n.ids=Object.keys(n.entities));}}function u(e,r){var o=re(e,t,r),u=o[0];i(o[1],r),n(u,r);}return {removeAll:(c=function(t){Object.assign(t,{ids:[],entities:{}});},a=te((function(t,e){return c(e)})),function(t){return a(t,void 0)}),addOne:te(e),addMany:te(n),setOne:te(r),setMany:te((function(t,e){for(var n=0,o=t=ne(t);n<o.length;n++)r(o[n],e);})),setAll:te((function(t,e){t=ne(t),e.ids=[],e.entities={},n(t,e);})),updateOne:te((function(t,e){return i([t],e)})),updateMany:te(i),upsertOne:te((function(t,e){return u([t],e)})),upsertMany:te(u),removeOne:te((function(t,e){return o([t],e)})),removeMany:te(o)};var c,a;}function ie(t){void 0===t&&(t={});var e=p({sortComparer:!1,selectId:function(t){return t.id}},t),n=e.selectId,r=e.sortComparer,o={getInitialState:function(t){return void 0===t&&(t={}),Object.assign({ids:[],entities:{}},t)}},i={getSelectors:function(t){var e=function(t){return t.ids},n=function(t){return t.entities},r=Tt(e,n,(function(t,e){return t.map((function(t){return e[t]}))})),o=function(t,e){return e},i=function(t,e){return t[e]},u=Tt(e,(function(t){return t.length}));if(!t)return {selectIds:e,selectEntities:n,selectAll:r,selectTotal:u,selectById:Tt(n,o,i)};var c=Tt(t,n);return {selectIds:Tt(t,e),selectEntities:c,selectAll:Tt(t,r),selectTotal:Tt(t,u),selectById:Tt(c,o,i)}}},u=r?function(t,e){var n=oe(t);function r(e,n){var r=(e=ne(e)).filter((function(e){return !(ee(e,t)in n.entities)}));0!==r.length&&c(r,n);}function o(t,e){0!==(t=ne(t)).length&&c(t,e);}function i(e,n){for(var r=!1,o=0,i=e;o<i.length;o++){var u=i[o],c=n.entities[u.id];if(c){r=!0,Object.assign(c,u.changes);var f=t(c);u.id!==f&&(delete n.entities[u.id],n.entities[f]=c);}}r&&a(n);}function u(e,n){var o=re(e,t,n),u=o[0];i(o[1],n),r(u,n);}function c(e,n){e.forEach((function(e){n.entities[t(e)]=e;})),a(n);}function a(n){var r=Object.values(n.entities);r.sort(e);var o=r.map(t);(function(t,e){if(t.length!==e.length)return !1;for(var n=0;n<t.length&&n<e.length;n++)if(t[n]!==e[n])return !1;return !0})(n.ids,o)||(n.ids=o);}return {removeOne:n.removeOne,removeMany:n.removeMany,removeAll:n.removeAll,addOne:te((function(t,e){return r([t],e)})),updateOne:te((function(t,e){return i([t],e)})),upsertOne:te((function(t,e){return u([t],e)})),setOne:te((function(t,e){return o([t],e)})),setMany:te(o),setAll:te((function(t,e){t=ne(t),e.entities={},e.ids=[],r(t,e);})),addMany:te(r),updateMany:te(i),upsertMany:te(u)}}(n,r):oe(n);return p(p(p({selectId:n,sortComparer:r},o),i),u)}var ue=function(t){void 0===t&&(t=21);for(var e="",n=t;n--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e},ce=["name","message","stack","code"],ae=function(t,e){this.payload=t,this.meta=e;},fe=function(t,e){this.payload=t,this.meta=e;},le=function(t){if("object"==typeof t&&null!==t){for(var e={},n=0,r=ce;n<r.length;n++){var o=r[n];"string"==typeof t[o]&&(e[o]=t[o]);}return e}return {message:String(t)}},se=function(){function t(t,e,n){var r=Xt(t+"/fulfilled",(function(t,e,n,r){return {payload:t,meta:v(p({},r||{}),{arg:n,requestId:e,requestStatus:"fulfilled"})}})),i=Xt(t+"/pending",(function(t,e,n){return {payload:void 0,meta:v(p({},n||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),u=Xt(t+"/rejected",(function(t,e,r,o,i){return {payload:o,error:(n&&n.serializeError||le)(t||"Rejected"),meta:v(p({},i||{}),{arg:r,requestId:e,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),c="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return !1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}};}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(a,f,l){var s,d=(null==n?void 0:n.idGenerator)?n.idGenerator(t):ue(),p=new c;function v(t){s=t,p.abort();}var h=function(){return y(this,null,(function(){var c,y,h,g,b,m;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),null===(w=g=null==(c=null==n?void 0:n.condition)?void 0:c.call(n,t,{getState:f,extra:l}))||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,g];case 1:g=o.sent(),o.label=2;case 2:if(!1===g||p.signal.aborted)throw {name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(t,e){return p.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:s||"Aborted"})}))})),a(i(d,t,null==(y=null==n?void 0:n.getPendingMeta)?void 0:y.call(n,{requestId:d,arg:t},{getState:f,extra:l}))),[4,Promise.race([b,Promise.resolve(e(t,{dispatch:a,getState:f,extra:l,requestId:d,signal:p.signal,abort:v,rejectWithValue:function(t,e){return new ae(t,e)},fulfillWithValue:function(t,e){return new fe(t,e)}})).then((function(e){if(e instanceof ae)throw e;return e instanceof fe?r(e.payload,d,t,e.meta):r(e,d,t)}))])];case 3:return h=o.sent(),[3,5];case 4:return m=o.sent(),h=m instanceof ae?u(null,d,t,m.payload,m.meta):u(m,d,t),[3,5];case 5:return n&&!n.dispatchConditionRejection&&u.match(h)&&h.meta.condition||a(h),[2,h]}var w;}))}))}();return Object.assign(h,{abort:v,requestId:d,arg:t,unwrap:function(){return h.then(de)}})}}),{pending:i,rejected:u,fulfilled:r,typePrefix:t})}return t.withTypes=function(){return t},t}();function de(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}var pe=function(t,e){return (n=t)&&"function"==typeof n.match?t.match(e):t(e);var n;};function ve(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.some((function(t){return pe(t,e)}))}}function ye(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.every((function(t){return pe(t,e)}))}}function he(t,e){if(!t||!t.meta)return !1;var n="string"==typeof t.meta.requestId,r=e.indexOf(t.meta.requestStatus)>-1;return n&&r}function ge(t){return "function"==typeof t[0]&&"pending"in t[0]&&"fulfilled"in t[0]&&"rejected"in t[0]}function be(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return he(t,["pending"])}:ge(t)?function(e){var n=t.map((function(t){return t.pending}));return ve.apply(void 0,n)(e)}:be()(t[0])}function me(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return he(t,["rejected"])}:ge(t)?function(e){var n=t.map((function(t){return t.rejected}));return ve.apply(void 0,n)(e)}:me()(t[0])}function we(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t){return t&&t.meta&&t.meta.rejectedWithValue};return 0===t.length||ge(t)?function(e){return ye(me.apply(void 0,t),n)(e)}:we()(t[0])}function Oe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return he(t,["fulfilled"])}:ge(t)?function(e){var n=t.map((function(t){return t.fulfilled}));return ve.apply(void 0,n)(e)}:Oe()(t[0])}function je(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return he(t,["pending","fulfilled","rejected"])}:ge(t)?function(e){for(var n=[],r=0,o=t;r<o.length;r++){var i=o[r];n.push(i.pending,i.rejected,i.fulfilled);}return ve.apply(void 0,n)(e)}:je()(t[0])}var Pe=function(t,e){if("function"!=typeof t)throw new TypeError(e+" is not a function")},Ee=function(){},Ae=function(t,e){return void 0===e&&(e=Ee),t.catch(e),t},Se=function(t,e){return t.addEventListener("abort",e,{once:!0}),function(){return t.removeEventListener("abort",e)}},_e=function(t,e){var n=t.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:e,configurable:!0,writable:!0}),t.abort(e));},ke=function(t){this.code=t,this.name="TaskAbortError",this.message="task cancelled (reason: "+t+")";},xe=function(t){if(t.aborted)throw new ke(t.reason)};function Ie(t,e){var n=Ee;return new Promise((function(r,o){var i=function(){return o(new ke(t.reason))};t.aborted?i():(n=Se(t,i),e.finally((function(){return n()})).then(r,o));})).finally((function(){n=Ee;}))}var De=function(t){return function(e){return Ae(Ie(t,e).then((function(e){return xe(t),e})))}},Te=function(t){var e=De(t);return function(t){return e(new Promise((function(e){return setTimeout(e,t)})))}},Ne=Object.assign,Ce={},Re="listenerMiddleware",Me=function(t){var e=t.type,n=t.actionCreator,r=t.matcher,o=t.predicate,i=t.effect;if(e)o=Xt(e).match;else if(n)e=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Pe(i,"options.listener"),{predicate:o,type:e,effect:i}},Fe=function(t){t.pending.forEach((function(t){_e(t,"listener-cancelled");}));},qe=function(t,e,n){try{t(e,n);}catch(t){setTimeout((function(){throw t}),0);}},ze=Xt(Re+"/add"),Le=Xt(Re+"/removeAll"),Ue=Xt(Re+"/remove"),Ke=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,i([Re+"/error"],t));};function We(t){var e=this;void 0===t&&(t={});var n=new Map,r=t.extra,i=t.onError,u=void 0===i?Ke:i;Pe(u,"onError");var c=function(t){for(var e=0,r=Array.from(n.values());e<r.length;e++){var o=r[e];if(t(o))return o}},a=function(t){var e=c((function(e){return e.effect===t.effect}));return e||(e=function(t){var e=Me(t),n=e.type,r=e.predicate,o=e.effect;return {id:ue(),effect:o,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}}(t)),function(t){return t.unsubscribe=function(){return n.delete(t.id)},n.set(t.id,t),function(e){t.unsubscribe(),(null==e?void 0:e.cancelActive)&&Fe(t);}}(e)},f=function(t){var e=Me(t),n=e.type,r=e.effect,o=e.predicate,i=c((function(t){return ("string"==typeof n?t.type===n:t.predicate===o)&&t.effect===r}));return i&&(i.unsubscribe(),t.cancelActive&&Fe(i)),!!i},l=function(t,i,c,f){return y(e,null,(function(){var e,l,s;return o(this,(function(d){switch(d.label){case 0:e=new AbortController,l=function(t,e){return function(n,r){return Ae(function(n,r){return y(void 0,null,(function(){var i,u,c,a;return o(this,(function(o){switch(o.label){case 0:xe(e),i=function(){},u=new Promise((function(e,r){var o=t({predicate:n,effect:function(t,n){n.unsubscribe(),e([t,n.getState(),n.getOriginalState()]);}});i=function(){o(),r();};})),c=[u],null!=r&&c.push(new Promise((function(t){return setTimeout(t,r,null)}))),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,Ie(e,Promise.race(c))];case 2:return a=o.sent(),xe(e),[2,a];case 3:return i(),[7];case 4:return [2]}}))}))}(n,r))}}(a,e.signal),d.label=1;case 1:return d.trys.push([1,3,4,5]),t.pending.add(e),[4,Promise.resolve(t.effect(i,Ne({},c,{getOriginalState:f,condition:function(t,e){return l(t,e).then(Boolean)},take:l,delay:Te(e.signal),pause:De(e.signal),extra:r,signal:e.signal,fork:(p=e.signal,function(t){Pe(t,"taskExecutor");var e,n=new AbortController;e=n,Se(p,(function(){return _e(e,p.reason)}));var r,i,u=(r=function(){return y(void 0,null,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return xe(p),xe(n.signal),[4,t({pause:De(n.signal),delay:Te(n.signal),signal:n.signal})];case 1:return e=r.sent(),xe(n.signal),[2,e]}}))}))},i=function(){return _e(n,"task-completed")},y(void 0,null,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return e.sent(),[4,r()];case 2:return [2,{status:"ok",value:e.sent()}];case 3:return [2,{status:(t=e.sent())instanceof ke?"cancelled":"rejected",error:t}];case 4:return null==i||i(),[7];case 5:return [2]}}))})));return {result:De(p)(u),cancel:function(){_e(n,"task-cancelled");}}}),unsubscribe:t.unsubscribe,subscribe:function(){n.set(t.id,t);},cancelActiveListeners:function(){t.pending.forEach((function(t,n,r){t!==e&&(_e(t,"listener-cancelled"),r.delete(t));}));}})))];case 2:return d.sent(),[3,5];case 3:return (s=d.sent())instanceof ke||qe(u,s,{raisedBy:"effect"}),[3,5];case 4:return _e(e,"listener-completed"),t.pending.delete(e),[7];case 5:return [2]}var p;}))}))},s=function(t){return function(){t.forEach(Fe),t.clear();}}(n);return {middleware:function(t){return function(e){return function(r){if(ze.match(r))return a(r.payload);if(!Le.match(r)){if(Ue.match(r))return f(r.payload);var o,i=t.getState(),c=function(){if(i===Ce)throw new Error(Re+": getOriginalState can only be called synchronously");return i};try{if(o=e(r),n.size>0)for(var d=t.getState(),p=Array.from(n.values()),v=0,y=p;v<y.length;v++){var h=y[v],g=!1;try{g=h.predicate(r,d,i);}catch(t){g=!1,qe(u,t,{raisedBy:"predicate"});}g&&l(h,r,t,c);}}finally{i=Ce;}return o}s();}}},startListening:a,stopListening:f,clearListeners:s}}var Be,Ve="RTK_autoBatch",Xe=function(){return function(t){var e;return {payload:t,meta:(e={},e.RTK_autoBatch=!0,e)}}},Ge="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):function(t){return (Be||(Be=Promise.resolve())).then(t).catch((function(t){return setTimeout((function(){throw t}),0)}))},Je=function(t){return function(e){setTimeout(e,t);}},$e="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Je(10),He=function(t){return void 0===t&&(t={type:"raf"}),function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(void 0,n),i=!0,u=!1,c=!1,a=new Set,f="tick"===t.type?Ge:"raf"===t.type?$e:"callback"===t.type?t.queueNotification:Je(t.timeout),l=function(){c=!1,u&&(u=!1,a.forEach((function(t){return t()})));};return Object.assign({},o,{subscribe:function(t){var e=o.subscribe((function(){return i&&t()}));return a.add(t),function(){e(),a.delete(t);}},dispatch:function(t){var e;try{return i=!(null==(e=null==t?void 0:t.meta)?void 0:e.RTK_autoBatch),(u=!i)&&(c||(c=!0,f(l))),o.dispatch(t)}finally{i=!0;}}})}}};!function(){function t(t,e){var n=o[t];return n?n.enumerable=e:o[t]=n={configurable:!0,enumerable:e,get:function(){return ct.get(this[nt],t)},set:function(e){ct.set(this[nt],t,e);}},n}function e(t){for(var e=t.length-1;e>=0;e--){var o=t[e][nt];if(!o.P)switch(o.i){case 5:r(o)&&V(o);break;case 4:n(o)&&V(o);}}}function n(t){for(var e=t.t,n=t.k,r=ot(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==nt){var u=e[i];if(void 0===u&&!j(e,i))return !0;var c=n[i],a=c&&c[nt];if(a?a.t!==u:!E(c,u))return !0}}var f=!!e[nt];return r.length!==ot(e).length+(f?0:1)}function r(t){var e=t.k;if(e.length!==t.t.length)return !0;var n=Object.getOwnPropertyDescriptor(e,e.length-1);if(n&&!n.get)return !0;for(var r=0;r<e.length;r++)if(!e.hasOwnProperty(r))return !0;return !1}var o={};ut.ES5||(ut.ES5={J:function(e,n){var r=Array.isArray(e),o=function(e,n){if(e){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,t(o,!0));return r}var i=it(n);delete i[nt];for(var u=ot(i),c=0;c<u.length;c++){var a=u[c];i[a]=t(a,e||!!i[a].enumerable);}return Object.create(Object.getPrototypeOf(n),i)}(r,e),i={i:r?5:4,A:n?n.A:N(),P:!1,I:!1,D:{},l:n,t:e,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,nt,{value:i,writable:!0}),o},S:function(t,n,o){o?g(n)&&n[nt].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var n=e[nt];if(n){var o=n.t,i=n.k,u=n.D,c=n.i;if(4===c)w(i,(function(e){e!==nt&&(void 0!==o[e]||j(o,e)?u[e]||t(i[e]):(u[e]=!0,V(n)));})),w(o,(function(t){void 0!==i[t]||j(i,t)||(u[t]=!1,V(n));}));else if(5===c){if(r(n)&&(V(n),u.length=!0),i.length<o.length)for(var a=i.length;a<o.length;a++)u[a]=!1;else for(var f=o.length;f<i.length;f++)u[f]=!0;for(var l=Math.min(i.length,o.length),s=0;s<l;s++)i.hasOwnProperty(s)||(u[s]=!0),void 0===u[s]&&t(i[s]);}}}}(t.p[0]),e(t.p));},K:function(t){return 4===t.i?n(t):r(t)}});}(); | ||
var t,n,e,r=undefined&&undefined.__extends||(t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n;}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);},t(n,e)},function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n;}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r);}),o=undefined&&undefined.__generator||function(t,n){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(t,u);}catch(t){i=[6,t],r=0;}finally{e=o=0;}if(5&i[0])throw i[1];return {value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},i=undefined&&undefined.__spreadArray||function(t,n){for(var e=0,r=n.length,o=t.length;e<r;e++,o++)t[o]=n[e];return t},u=Object.defineProperty,c=Object.defineProperties,a=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,d=function(t,n,e){return n in t?u(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e},p=function(t,n){for(var e in n||(n={}))l.call(n,e)&&d(t,e,n[e]);if(f)for(var r=0,o=f(n);r<o.length;r++)s.call(n,e=o[r])&&d(t,e,n[e]);return t},v=function(t,n){return c(t,a(n))},y=function(t,n,e){return new Promise((function(r,o){var i=function(t){try{c(e.next(t));}catch(t){o(t);}},u=function(t){try{c(e.throw(t));}catch(t){o(t);}},c=function(t){return t.done?r(t.value):Promise.resolve(t.value).then(i,u)};c((e=e.apply(t,n)).next());}))};function h(t){for(var n=arguments.length,e=Array(n>1?n-1:0),r=1;r<n;r++)e[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(e.length?" "+e.map((function(t){return "'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function b(t){return !!t&&!!t[et]}function g(t){var n;return !!t&&(function(t){if(!t||"object"!=typeof t)return !1;var n=Object.getPrototypeOf(t);if(null===n)return !0;var e=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return e===Object||"function"==typeof e&&Function.toString.call(e)===rt}(t)||Array.isArray(t)||!!t[nt]||!!(null===(n=t.constructor)||void 0===n?void 0:n[nt])||A(t)||S(t))}function m(t){return b(t)||h(23,t),t[et].t}function w(t,n,e){void 0===e&&(e=!1),0===O(t)?(e?Object.keys:ot)(t).forEach((function(r){e&&"symbol"==typeof r||n(r,t[r],t);})):t.forEach((function(e,r){return n(r,e,t)}));}function O(t){var n=t[et];return n?n.i>3?n.i-4:n.i:Array.isArray(t)?1:A(t)?2:S(t)?3:0}function j(t,n){return 2===O(t)?t.has(n):Object.prototype.hasOwnProperty.call(t,n)}function P(t,n,e){var r=O(t);2===r?t.set(n,e):3===r?t.add(e):t[n]=e;}function E(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}function A(t){return Q&&t instanceof Map}function S(t){return Y&&t instanceof Set}function _(t){return t.o||t.t}function k(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var n=it(t);delete n[et];for(var e=ot(n),r=0;r<e.length;r++){var o=e[r],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]});}return Object.create(Object.getPrototypeOf(t),n)}function x(t,n){return void 0===n&&(n=!1),N(t)||b(t)||!g(t)||(O(t)>1&&(t.set=t.add=t.clear=t.delete=I),Object.freeze(t),n&&w(t,(function(t,n){return x(n,!0)}),!0)),t}function I(){h(2);}function N(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function R(t){var n=ut[t];return n||h(18,t),n}function T(){return e}function C(t,n){n&&(R("Patches"),t.u=[],t.s=[],t.v=n);}function D(t){M(t),t.p.forEach(F),t.p=null;}function M(t){t===e&&(e=t.l);}function q(t){return e={p:[],l:e,h:t,m:!0,_:0}}function F(t){var n=t[et];0===n.i||1===n.i?n.j():n.g=!0;}function z(t,n){n._=n.p.length;var e=n.p[0],r=void 0!==t&&t!==e;return n.h.O||R("ES5").S(n,t,r),r?(e[et].P&&(D(n),h(4)),g(t)&&(t=L(n,t),n.l||K(n,t)),n.u&&R("Patches").M(e[et].t,t,n.u,n.s)):t=L(n,e,[]),D(n),n.u&&n.v(n.u,n.s),t!==tt?t:void 0}function L(t,n,e){if(N(n))return n;var r=n[et];if(!r)return w(n,(function(o,i){return U(t,r,n,o,i,e)}),!0),n;if(r.A!==t)return n;if(!r.P)return K(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=k(r.k):r.o,i=o,u=!1;3===r.i&&(i=new Set(o),o.clear(),u=!0),w(i,(function(n,i){return U(t,r,o,n,i,e,u)})),K(t,o,!1),e&&t.u&&R("Patches").N(r,e,t.u,t.s);}return r.o}function U(t,n,e,r,o,i,u){if(b(o)){var c=L(t,o,i&&n&&3!==n.i&&!j(n.R,r)?i.concat(r):void 0);if(P(e,r,c),!b(c))return;t.m=!1;}else u&&e.add(o);if(g(o)&&!N(o)){if(!t.h.D&&t._<1)return;L(t,o),n&&n.A.l||K(t,o);}}function K(t,n,e){void 0===e&&(e=!1),!t.l&&t.h.D&&t.m&&x(n,e);}function W(t,n){var e=t[et];return (e?_(e):t)[n]}function B(t,n){if(n in t)for(var e=Object.getPrototypeOf(t);e;){var r=Object.getOwnPropertyDescriptor(e,n);if(r)return r;e=Object.getPrototypeOf(e);}}function V(t){t.P||(t.P=!0,t.l&&V(t.l));}function X(t){t.o||(t.o=k(t.t));}function G(t,n,e){var r=A(n)?R("MapSet").F(n,e):S(n)?R("MapSet").T(n,e):t.O?function(t,n){var e=Array.isArray(t),r={i:e?1:0,A:n?n.A:T(),P:!1,I:!1,R:{},l:n,t:t,k:null,o:null,j:null,C:!1},o=r,i=ct;e&&(o=[r],i=at);var u=Proxy.revocable(o,i),c=u.revoke,a=u.proxy;return r.k=a,r.j=c,a}(n,e):R("ES5").J(n,e);return (e?e.A:T()).p.push(r),r}function J(t){return b(t)||h(22,t),function t(n){if(!g(n))return n;var e,r=n[et],o=O(n);if(r){if(!r.P&&(r.i<4||!R("ES5").K(r)))return r.t;r.I=!0,e=$(n,o),r.I=!1;}else e=$(n,o);return w(e,(function(n,o){r&&function(t,n){return 2===O(t)?t.get(n):t[n]}(r.t,n)===o||P(e,n,t(o));})),3===o?new Set(e):e}(t)}function $(t,n){switch(n){case 2:return new Map(t);case 3:return Array.from(t)}return k(t)}var H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Q="undefined"!=typeof Map,Y="undefined"!=typeof Set,Z="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,tt=H?Symbol.for("immer-nothing"):((n={})["immer-nothing"]=!0,n),nt=H?Symbol.for("immer-draftable"):"__$immer_draftable",et=H?Symbol.for("immer-state"):"__$immer_state",rt=(""+Object.prototype.constructor),ot="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,it=Object.getOwnPropertyDescriptors||function(t){var n={};return ot(t).forEach((function(e){n[e]=Object.getOwnPropertyDescriptor(t,e);})),n},ut={},ct={get:function(t,n){if(n===et)return t;var e,r,o,i=_(t);if(!j(i,n))return e=t,(o=B(i,n))?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0;var u=i[n];return t.I||!g(u)?u:u===W(t.t,n)?(X(t),t.o[n]=G(t.A.h,u,t)):u},has:function(t,n){return n in _(t)},ownKeys:function(t){return Reflect.ownKeys(_(t))},set:function(t,n,e){var r=B(_(t),n);if(null==r?void 0:r.set)return r.set.call(t.k,e),!0;if(!t.P){var o=W(_(t),n),i=null==o?void 0:o[et];if(i&&i.t===e)return t.o[n]=e,t.R[n]=!1,!0;if(E(e,o)&&(void 0!==e||j(t.t,n)))return !0;X(t),V(t);}return t.o[n]===e&&(void 0!==e||n in t.o)||Number.isNaN(e)&&Number.isNaN(t.o[n])||(t.o[n]=e,t.R[n]=!0),!0},deleteProperty:function(t,n){return void 0!==W(t.t,n)||n in t.t?(t.R[n]=!1,X(t),V(t)):delete t.R[n],t.o&&delete t.o[n],!0},getOwnPropertyDescriptor:function(t,n){var e=_(t),r=Reflect.getOwnPropertyDescriptor(e,n);return r?{writable:!0,configurable:1!==t.i||"length"!==n,enumerable:r.enumerable,value:e[n]}:r},defineProperty:function(){h(11);},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){h(12);}},at={};w(ct,(function(t,n){at[t]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)};})),at.deleteProperty=function(t,n){return at.set.call(this,t,n,void 0)},at.set=function(t,n,e){return ct.set.call(this,t[0],n,e,t[0])};var ft=new(function(){function t(t){var n=this;this.O=Z,this.D=!0,this.produce=function(t,e,r){if("function"==typeof t&&"function"!=typeof e){var o=e;e=t;var i=n;return function(t){var n=this;void 0===t&&(t=o);for(var r=arguments.length,u=Array(r>1?r-1:0),c=1;c<r;c++)u[c-1]=arguments[c];return i.produce(t,(function(t){var r;return (r=e).call.apply(r,[n,t].concat(u))}))}}var u;if("function"!=typeof e&&h(6),void 0!==r&&"function"!=typeof r&&h(7),g(t)){var c=q(n),a=G(n,t,void 0),f=!0;try{u=e(a),f=!1;}finally{f?D(c):M(c);}return "undefined"!=typeof Promise&&u instanceof Promise?u.then((function(t){return C(c,r),z(t,c)}),(function(t){throw D(c),t})):(C(c,r),z(u,c))}if(!t||"object"!=typeof t){if(void 0===(u=e(t))&&(u=t),u===tt&&(u=void 0),n.D&&x(u,!0),r){var l=[],s=[];R("Patches").M(t,u,l,s),r(l,s);}return u}h(21,t);},this.produceWithPatches=function(t,e){if("function"==typeof t)return function(e){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n.produceWithPatches(e,(function(n){return t.apply(void 0,[n].concat(o))}))};var r,o,i=n.produce(t,e,(function(t,n){r=t,o=n;}));return "undefined"!=typeof Promise&&i instanceof Promise?i.then((function(t){return [t,r,o]})):[i,r,o]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze);}var n=t.prototype;return n.createDraft=function(t){g(t)||h(8),b(t)&&(t=J(t));var n=q(this),e=G(this,t,void 0);return e[et].C=!0,M(n),e},n.finishDraft=function(t,n){var e=(t&&t[et]).A;return C(e,n),z(void 0,e)},n.setAutoFreeze=function(t){this.D=t;},n.setUseProxies=function(t){t&&!Z&&h(20),this.O=t;},n.applyPatches=function(t,n){var e;for(e=n.length-1;e>=0;e--){var r=n[e];if(0===r.path.length&&"replace"===r.op){t=r.value;break}}e>-1&&(n=n.slice(e+1));var o=R("Patches").$;return b(t)?o(t,n):this.produce(t,(function(t){return o(t,n)}))},t}()),lt=ft.produce,st=(ft.produceWithPatches.bind(ft),ft.setAutoFreeze.bind(ft),ft.setUseProxies.bind(ft),ft.applyPatches.bind(ft),ft.createDraft.bind(ft),ft.finishDraft.bind(ft),lt);function dt(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function pt(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r);}return e}function vt(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?pt(Object(e),!0).forEach((function(n){dt(t,n,e[n]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):pt(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n));}));}return t}function yt(t){return "Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ht="function"==typeof Symbol&&Symbol.observable||"@@observable",bt=function(){return Math.random().toString(36).substring(7).split("").join(".")},gt={INIT:"@@redux/INIT"+bt(),REPLACE:"@@redux/REPLACE"+bt(),PROBE_UNKNOWN_ACTION:function(){return "@@redux/PROBE_UNKNOWN_ACTION"+bt()}};function mt(t){if("object"!=typeof t||null===t)return !1;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}function wt(t,n,e){var r;if("function"==typeof n&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(yt(0));if("function"==typeof n&&void 0===e&&(e=n,n=void 0),void 0!==e){if("function"!=typeof e)throw new Error(yt(1));return e(wt)(t,n)}if("function"!=typeof t)throw new Error(yt(2));var o=t,i=n,u=[],c=u,a=!1;function f(){c===u&&(c=u.slice());}function l(){if(a)throw new Error(yt(3));return i}function s(t){if("function"!=typeof t)throw new Error(yt(4));if(a)throw new Error(yt(5));var n=!0;return f(),c.push(t),function(){if(n){if(a)throw new Error(yt(6));n=!1,f();var e=c.indexOf(t);c.splice(e,1),u=null;}}}function d(t){if(!mt(t))throw new Error(yt(7));if(void 0===t.type)throw new Error(yt(8));if(a)throw new Error(yt(9));try{a=!0,i=o(i,t);}finally{a=!1;}for(var n=u=c,e=0;e<n.length;e++)(0, n[e])();return t}function p(t){if("function"!=typeof t)throw new Error(yt(10));o=t,d({type:gt.REPLACE});}function v(){var t,n=s;return (t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(yt(11));function e(){t.next&&t.next(l());}return e(),{unsubscribe:n(e)}}})[ht]=function(){return this},t}return d({type:gt.INIT}),(r={dispatch:d,subscribe:s,getState:l,replaceReducer:p})[ht]=v,r}var Ot=wt;function jt(t){for(var n=Object.keys(t),e={},r=0;r<n.length;r++){var o=n[r];"function"==typeof t[o]&&(e[o]=t[o]);}var i,u=Object.keys(e);try{!function(t){Object.keys(t).forEach((function(n){var e=t[n];if(void 0===e(void 0,{type:gt.INIT}))throw new Error(yt(12));if(void 0===e(void 0,{type:gt.PROBE_UNKNOWN_ACTION()}))throw new Error(yt(13))}));}(e);}catch(t){i=t;}return function(t,n){if(void 0===t&&(t={}),i)throw i;for(var r=!1,o={},c=0;c<u.length;c++){var a=u[c],f=t[a],l=(0, e[a])(f,n);if(void 0===l)throw new Error(yt(14));o[a]=l,r=r||l!==f;}return (r=r||u.length!==Object.keys(t).length)?o:t}}function Pt(t,n){return function(){return n(t.apply(this,arguments))}}function Et(t,n){if("function"==typeof t)return Pt(t,n);if("object"!=typeof t||null===t)throw new Error(yt(16));var e={};for(var r in t){var o=t[r];"function"==typeof o&&(e[r]=Pt(o,n));}return e}function At(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return 0===n.length?function(t){return t}:1===n.length?n[0]:n.reduce((function(t,n){return function(){return t(n.apply(void 0,arguments))}}))}function St(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return function(t){return function(){var e=t.apply(void 0,arguments),r=function(){throw new Error(yt(15))},o={getState:e.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=n.map((function(t){return t(o)}));return r=At.apply(void 0,i)(e.dispatch),vt(vt({},e),{},{dispatch:r})}}}var _t=function(t,n){return t===n};function kt(t,n){var e,r,o,i="object"==typeof n?n:{equalityCheck:n},u=i.equalityCheck,c=i.maxSize,a=void 0===c?1:c,f=i.resultEqualityCheck,l=(o=void 0===u?_t:u,function(t,n){if(null===t||null===n||t.length!==n.length)return !1;for(var e=t.length,r=0;r<e;r++)if(!o(t[r],n[r]))return !1;return !0}),s=1===a?(e=l,{get:function(t){return r&&e(r.key,t)?r.value:"NOT_FOUND"},put:function(t,n){r={key:t,value:n};},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0;}}):function(t,n){var e=[];function r(t){var r=e.findIndex((function(e){return n(t,e.key)}));if(r>-1){var o=e[r];return r>0&&(e.splice(r,1),e.unshift(o)),o.value}return "NOT_FOUND"}return {get:r,put:function(n,o){"NOT_FOUND"===r(n)&&(e.unshift({key:n,value:o}),e.length>t&&e.pop());},getEntries:function(){return e},clear:function(){e=[];}}}(a,l);function d(){var n=s.get(arguments);if("NOT_FOUND"===n){if(n=t.apply(null,arguments),f){var e=s.getEntries(),r=e.find((function(t){return f(t.value,n)}));r&&(n=r.value);}s.put(arguments,n);}return n}return d.clearCache=function(){return s.clear()},d}function xt(t){var n=Array.isArray(t[0])?t[0]:t;if(!n.every((function(t){return "function"==typeof t}))){var e=n.map((function(t){return "function"==typeof t?"function "+(t.name||"unnamed")+"()":typeof t})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+e+"]")}return n}function It(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++)e[r-1]=arguments[r];var o=function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i,u=0,c={memoizeOptions:void 0},a=r.pop();if("object"==typeof a&&(c=a,a=r.pop()),"function"!=typeof a)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof a+"]");var f=c,l=f.memoizeOptions,s=void 0===l?e:l,d=Array.isArray(s)?s:[s],p=xt(r),v=t.apply(void 0,[function(){return u++,a.apply(null,arguments)}].concat(d)),y=t((function(){for(var t=[],n=p.length,e=0;e<n;e++)t.push(p[e].apply(null,arguments));return i=v.apply(null,t)}));return Object.assign(y,{resultFunc:a,memoizedResultFunc:v,dependencies:p,lastResult:function(){return i},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),y};return o}var Nt=It(kt),Rt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=Nt.apply(void 0,t),r=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.apply(void 0,i([b(t)?J(t):t],n))};return r},Tt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return "object"==typeof arguments[0]?At:At.apply(null,arguments)};function Ct(t){if("object"!=typeof t||null===t)return !1;var n=Object.getPrototypeOf(t);if(null===n)return !0;for(var e=n;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return n===e}function Dt(t){return function(n){var e=n.dispatch,r=n.getState;return function(n){return function(o){return "function"==typeof o?o(e,r,t):n(o)}}}}var Mt=Dt();Mt.withExtraArgument=Dt;var qt=Mt,Ft=function(t){return t&&"function"==typeof t.match};function zt(t,n){function e(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(n){var o=n.apply(void 0,e);if(!o)throw new Error("prepareAction did not return an object");return p(p({type:t,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return {type:t,payload:e[0]}}return e.toString=function(){return ""+t},e.type=t,e.match=function(n){return n.type===t},e}function Lt(t){return Ct(t)&&"type"in t}function Ut(t){return "function"==typeof t&&"type"in t&&Ft(t)}function Kt(t){return Lt(t)&&"string"==typeof t.type&&Object.keys(t).every(Wt)}function Wt(t){return ["type","payload","error","meta"].indexOf(t)>-1}function Bt(t){return ""+t}function Vt(t){return function(){return function(t){return function(n){return t(n)}}}}var Xt=function(t){function n(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.apply(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return r(n,t),Object.defineProperty(n,Symbol.species,{get:function(){return n},enumerable:!1,configurable:!0}),n.prototype.concat=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.prototype.concat.apply(this,n)},n.prototype.prepend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&Array.isArray(t[0])?new(n.bind.apply(n,i([void 0],t[0].concat(this)))):new(n.bind.apply(n,i([void 0],t.concat(this))))},n}(Array),Gt=function(t){function n(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.apply(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return r(n,t),Object.defineProperty(n,Symbol.species,{get:function(){return n},enumerable:!1,configurable:!0}),n.prototype.concat=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.prototype.concat.apply(this,n)},n.prototype.prepend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&Array.isArray(t[0])?new(n.bind.apply(n,i([void 0],t[0].concat(this)))):new(n.bind.apply(n,i([void 0],t.concat(this))))},n}(Array);function Jt(t){return g(t)?st(t,(function(){})):t}function $t(t){var n=typeof t;return null==t||"string"===n||"boolean"===n||"number"===n||Array.isArray(t)||Ct(t)}function Ht(t,n,e,r,o,i){var u;if(void 0===n&&(n=""),void 0===e&&(e=$t),void 0===o&&(o=[]),!e(t))return {keyPath:n||"<root>",value:t};if("object"!=typeof t||null===t)return !1;if(null==i?void 0:i.has(t))return !1;for(var c=null!=r?r(t):Object.entries(t),a=o.length>0,f=function(t,c){var f=n?n+"."+t:t;return a&&o.some((function(t){return t instanceof RegExp?t.test(f):f===t}))?"continue":e(c)?"object"==typeof c&&(u=Ht(c,f,e,r,o,i))?{value:u}:void 0:{value:{keyPath:f,value:c}}},l=0,s=c;l<s.length;l++){var d=s[l],p=f(d[0],d[1]);if("object"==typeof p)return p.value}return i&&Qt(t)&&i.add(t),!1}function Qt(t){if(!Object.isFrozen(t))return !1;for(var n=0,e=Object.values(t);n<e.length;n++){var r=e[n];if("object"==typeof r&&null!==r&&!Qt(r))return !1}return !0}function Yt(t){return function(){return function(t){return function(n){return t(n)}}}}function Zt(t){void 0===t&&(t={});var n=t.thunk,e=void 0===n||n,r=new Xt;return e&&r.push("boolean"==typeof e?qt:qt.withExtraArgument(e.extraArgument)),r}function tn(t){var n,e=function(t){return Zt(t)},r=t||{},o=r.reducer,u=void 0===o?void 0:o,c=r.middleware,a=void 0===c?e():c,f=r.devTools,l=void 0===f||f,s=r.preloadedState,d=void 0===s?void 0:s,v=r.enhancers,y=void 0===v?void 0:v;if("function"==typeof u)n=u;else {if(!Ct(u))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');n=jt(u);}var h=a;"function"==typeof h&&(h=h(e));var b=St.apply(void 0,h),g=At;l&&(g=Tt(p({trace:!1},"object"==typeof l&&l)));var m=new Gt(b),w=m;return Array.isArray(y)?w=i([b],y):"function"==typeof y&&(w=y(m)),wt(n,d,g.apply(void 0,w))}function nn(t){var n,e={},r=[],o={addCase:function(t,n){var r="string"==typeof t?t:t.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in e)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return e[r]=n,o},addMatcher:function(t,n){return r.push({matcher:t,reducer:n}),o},addDefaultCase:function(t){return n=t,o}};return t(o),[e,r,n]}function en(t,n,e,r){void 0===e&&(e=[]);var o,u="function"==typeof n?nn(n):[n,e,r],c=u[0],a=u[1],f=u[2];if("function"==typeof t)o=function(){return Jt(t())};else {var l=Jt(t);o=function(){return l};}function s(t,n){void 0===t&&(t=o());var e=i([c[n.type]],a.filter((function(t){return (0, t.matcher)(n)})).map((function(t){return t.reducer})));return 0===e.filter((function(t){return !!t})).length&&(e=[f]),e.reduce((function(t,e){if(e){var r;if(b(t))return void 0===(r=e(t,n))?t:r;if(g(t))return st(t,(function(t){return e(t,n)}));if(void 0===(r=e(t,n))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return t}),t)}return s.getInitialState=o,s}function rn(t){var n=t.name;if(!n)throw new Error("`name` is a required option for createSlice");var e,r="function"==typeof t.initialState?t.initialState:Jt(t.initialState),o=t.reducers||{},i=Object.keys(o),u={},c={},a={};function f(){var n="function"==typeof t.extraReducers?nn(t.extraReducers):[t.extraReducers],e=n[0],o=n[1],i=void 0===o?[]:o,u=n[2],a=void 0===u?void 0:u,f=p(p({},void 0===e?{}:e),c);return en(r,(function(t){for(var n in f)t.addCase(n,f[n]);for(var e=0,r=i;e<r.length;e++){var o=r[e];t.addMatcher(o.matcher,o.reducer);}a&&t.addDefaultCase(a);}))}return i.forEach((function(t){var e,r,i=o[t],f=n+"/"+t;"reducer"in i?(e=i.reducer,r=i.prepare):e=i,u[t]=e,c[f]=e,a[t]=r?zt(f,r):zt(f);})),{name:n,reducer:function(t,n){return e||(e=f()),e(t,n)},actions:a,caseReducers:u,getInitialState:function(){return e||(e=f()),e.getInitialState()}}}function on(t){return "object"!=typeof t||null==t||Object.isFrozen(t)}function un(t){return function(){return function(t){return function(n){return t(n)}}}}function cn(t){return function(n,e){var r=function(n){Kt(e)?t(e.payload,n):t(e,n);};return b(n)?(r(n),n):st(n,r)}}function an(t,n){return n(t)}function fn(t){return Array.isArray(t)||(t=Object.values(t)),t}function ln(t,n,e){for(var r=[],o=[],i=0,u=t=fn(t);i<u.length;i++){var c=u[i],a=an(c,n);a in e.entities?o.push({id:a,changes:c}):r.push(c);}return [r,o]}function sn(t){function n(n,e){var r=an(n,t);r in e.entities||(e.ids.push(r),e.entities[r]=n);}function e(t,e){for(var r=0,o=t=fn(t);r<o.length;r++)n(o[r],e);}function r(n,e){var r=an(n,t);r in e.entities||e.ids.push(r),e.entities[r]=n;}function o(t,n){var e=!1;t.forEach((function(t){t in n.entities&&(delete n.entities[t],e=!0);})),e&&(n.ids=n.ids.filter((function(t){return t in n.entities})));}function i(n,e){var r={},o={};if(n.forEach((function(t){t.id in e.entities&&(o[t.id]={id:t.id,changes:p(p({},o[t.id]?o[t.id].changes:null),t.changes)});})),(n=Object.values(o)).length>0){var i=n.filter((function(n){return function(n,e,r){var o=Object.assign({},r.entities[e.id],e.changes),i=an(o,t),u=i!==e.id;return u&&(n[e.id]=i,delete r.entities[e.id]),r.entities[i]=o,u}(r,n,e)})).length>0;i&&(e.ids=Object.keys(e.entities));}}function u(n,r){var o=ln(n,t,r),u=o[0];i(o[1],r),e(u,r);}return {removeAll:(c=function(t){Object.assign(t,{ids:[],entities:{}});},a=cn((function(t,n){return c(n)})),function(t){return a(t,void 0)}),addOne:cn(n),addMany:cn(e),setOne:cn(r),setMany:cn((function(t,n){for(var e=0,o=t=fn(t);e<o.length;e++)r(o[e],n);})),setAll:cn((function(t,n){t=fn(t),n.ids=[],n.entities={},e(t,n);})),updateOne:cn((function(t,n){return i([t],n)})),updateMany:cn(i),upsertOne:cn((function(t,n){return u([t],n)})),upsertMany:cn(u),removeOne:cn((function(t,n){return o([t],n)})),removeMany:cn(o)};var c,a;}function dn(t){void 0===t&&(t={});var n=p({sortComparer:!1,selectId:function(t){return t.id}},t),e=n.selectId,r=n.sortComparer,o={getInitialState:function(t){return void 0===t&&(t={}),Object.assign({ids:[],entities:{}},t)}},i={getSelectors:function(t){var n=function(t){return t.ids},e=function(t){return t.entities},r=Rt(n,e,(function(t,n){return t.map((function(t){return n[t]}))})),o=function(t,n){return n},i=function(t,n){return t[n]},u=Rt(n,(function(t){return t.length}));if(!t)return {selectIds:n,selectEntities:e,selectAll:r,selectTotal:u,selectById:Rt(e,o,i)};var c=Rt(t,e);return {selectIds:Rt(t,n),selectEntities:c,selectAll:Rt(t,r),selectTotal:Rt(t,u),selectById:Rt(c,o,i)}}},u=r?function(t,n){var e=sn(t);function r(n,e){var r=(n=fn(n)).filter((function(n){return !(an(n,t)in e.entities)}));0!==r.length&&c(r,e);}function o(t,n){0!==(t=fn(t)).length&&c(t,n);}function i(n,e){for(var r=!1,o=0,i=n;o<i.length;o++){var u=i[o],c=e.entities[u.id];if(c){r=!0,Object.assign(c,u.changes);var f=t(c);u.id!==f&&(delete e.entities[u.id],e.entities[f]=c);}}r&&a(e);}function u(n,e){var o=ln(n,t,e),u=o[0];i(o[1],e),r(u,e);}function c(n,e){n.forEach((function(n){e.entities[t(n)]=n;})),a(e);}function a(e){var r=Object.values(e.entities);r.sort(n);var o=r.map(t);(function(t,n){if(t.length!==n.length)return !1;for(var e=0;e<t.length&&e<n.length;e++)if(t[e]!==n[e])return !1;return !0})(e.ids,o)||(e.ids=o);}return {removeOne:e.removeOne,removeMany:e.removeMany,removeAll:e.removeAll,addOne:cn((function(t,n){return r([t],n)})),updateOne:cn((function(t,n){return i([t],n)})),upsertOne:cn((function(t,n){return u([t],n)})),setOne:cn((function(t,n){return o([t],n)})),setMany:cn(o),setAll:cn((function(t,n){t=fn(t),n.entities={},n.ids=[],r(t,n);})),addMany:cn(r),updateMany:cn(i),upsertMany:cn(u)}}(e,r):sn(e);return p(p(p({selectId:e,sortComparer:r},o),i),u)}var pn=function(t){void 0===t&&(t=21);for(var n="",e=t;e--;)n+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return n},vn=["name","message","stack","code"],yn=function(t,n){this.payload=t,this.meta=n;},hn=function(t,n){this.payload=t,this.meta=n;},bn=function(t){if("object"==typeof t&&null!==t){for(var n={},e=0,r=vn;e<r.length;e++){var o=r[e];"string"==typeof t[o]&&(n[o]=t[o]);}return n}return {message:String(t)}},gn=function(){function t(t,n,e){var r=zt(t+"/fulfilled",(function(t,n,e,r){return {payload:t,meta:v(p({},r||{}),{arg:e,requestId:n,requestStatus:"fulfilled"})}})),i=zt(t+"/pending",(function(t,n,e){return {payload:void 0,meta:v(p({},e||{}),{arg:n,requestId:t,requestStatus:"pending"})}})),u=zt(t+"/rejected",(function(t,n,r,o,i){return {payload:o,error:(e&&e.serializeError||bn)(t||"Rejected"),meta:v(p({},i||{}),{arg:r,requestId:n,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),c="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return !1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}};}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(a,f,l){var s,d=(null==e?void 0:e.idGenerator)?e.idGenerator(t):pn(),p=new c;function v(t){s=t,p.abort();}var h=function(){return y(this,null,(function(){var c,y,h,b,g,m;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),null===(w=b=null==(c=null==e?void 0:e.condition)?void 0:c.call(e,t,{getState:f,extra:l}))||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,b];case 1:b=o.sent(),o.label=2;case 2:if(!1===b||p.signal.aborted)throw {name:"ConditionError",message:"Aborted due to condition callback returning false."};return g=new Promise((function(t,n){return p.signal.addEventListener("abort",(function(){return n({name:"AbortError",message:s||"Aborted"})}))})),a(i(d,t,null==(y=null==e?void 0:e.getPendingMeta)?void 0:y.call(e,{requestId:d,arg:t},{getState:f,extra:l}))),[4,Promise.race([g,Promise.resolve(n(t,{dispatch:a,getState:f,extra:l,requestId:d,signal:p.signal,abort:v,rejectWithValue:function(t,n){return new yn(t,n)},fulfillWithValue:function(t,n){return new hn(t,n)}})).then((function(n){if(n instanceof yn)throw n;return n instanceof hn?r(n.payload,d,t,n.meta):r(n,d,t)}))])];case 3:return h=o.sent(),[3,5];case 4:return m=o.sent(),h=m instanceof yn?u(null,d,t,m.payload,m.meta):u(m,d,t),[3,5];case 5:return e&&!e.dispatchConditionRejection&&u.match(h)&&h.meta.condition||a(h),[2,h]}var w;}))}))}();return Object.assign(h,{abort:v,requestId:d,arg:t,unwrap:function(){return h.then(mn)}})}}),{pending:i,rejected:u,fulfilled:r,typePrefix:t})}return t.withTypes=function(){return t},t}();function mn(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}var wn=function(t,n){return Ft(t)?t.match(n):t(n)};function On(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return t.some((function(t){return wn(t,n)}))}}function jn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return t.every((function(t){return wn(t,n)}))}}function Pn(t,n){if(!t||!t.meta)return !1;var e="string"==typeof t.meta.requestId,r=n.indexOf(t.meta.requestStatus)>-1;return e&&r}function En(t){return "function"==typeof t[0]&&"pending"in t[0]&&"fulfilled"in t[0]&&"rejected"in t[0]}function An(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 0===t.length?function(t){return Pn(t,["pending"])}:En(t)?function(n){var e=t.map((function(t){return t.pending}));return On.apply(void 0,e)(n)}:An()(t[0])}function Sn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 0===t.length?function(t){return Pn(t,["rejected"])}:En(t)?function(n){var e=t.map((function(t){return t.rejected}));return On.apply(void 0,e)(n)}:Sn()(t[0])}function _n(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=function(t){return t&&t.meta&&t.meta.rejectedWithValue};return 0===t.length||En(t)?function(n){return jn(Sn.apply(void 0,t),e)(n)}:_n()(t[0])}function kn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 0===t.length?function(t){return Pn(t,["fulfilled"])}:En(t)?function(n){var e=t.map((function(t){return t.fulfilled}));return On.apply(void 0,e)(n)}:kn()(t[0])}function xn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 0===t.length?function(t){return Pn(t,["pending","fulfilled","rejected"])}:En(t)?function(n){for(var e=[],r=0,o=t;r<o.length;r++){var i=o[r];e.push(i.pending,i.rejected,i.fulfilled);}return On.apply(void 0,e)(n)}:xn()(t[0])}var In=function(t,n){if("function"!=typeof t)throw new TypeError(n+" is not a function")},Nn=function(){},Rn=function(t,n){return void 0===n&&(n=Nn),t.catch(n),t},Tn=function(t,n){return t.addEventListener("abort",n,{once:!0}),function(){return t.removeEventListener("abort",n)}},Cn=function(t,n){var e=t.signal;e.aborted||("reason"in e||Object.defineProperty(e,"reason",{enumerable:!0,value:n,configurable:!0,writable:!0}),t.abort(n));},Dn=function(t){this.code=t,this.name="TaskAbortError",this.message="task cancelled (reason: "+t+")";},Mn=function(t){if(t.aborted)throw new Dn(t.reason)};function qn(t,n){var e=Nn;return new Promise((function(r,o){var i=function(){return o(new Dn(t.reason))};t.aborted?i():(e=Tn(t,i),n.finally((function(){return e()})).then(r,o));})).finally((function(){e=Nn;}))}var Fn=function(t){return function(n){return Rn(qn(t,n).then((function(n){return Mn(t),n})))}},zn=function(t){var n=Fn(t);return function(t){return n(new Promise((function(n){return setTimeout(n,t)})))}},Ln=Object.assign,Un={},Kn="listenerMiddleware",Wn=function(t){var n=t.type,e=t.actionCreator,r=t.matcher,o=t.predicate,i=t.effect;if(n)o=zt(n).match;else if(e)n=e.type,o=e.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return In(i,"options.listener"),{predicate:o,type:n,effect:i}},Bn=function(t){t.pending.forEach((function(t){Cn(t,"listener-cancelled");}));},Vn=function(t,n,e){try{t(n,e);}catch(t){setTimeout((function(){throw t}),0);}},Xn=zt(Kn+"/add"),Gn=zt(Kn+"/removeAll"),Jn=zt(Kn+"/remove"),$n=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];console.error.apply(console,i([Kn+"/error"],t));};function Hn(t){var n=this;void 0===t&&(t={});var e=new Map,r=t.extra,i=t.onError,u=void 0===i?$n:i;In(u,"onError");var c=function(t){for(var n=0,r=Array.from(e.values());n<r.length;n++){var o=r[n];if(t(o))return o}},a=function(t){var n=c((function(n){return n.effect===t.effect}));return n||(n=function(t){var n=Wn(t),e=n.type,r=n.predicate,o=n.effect;return {id:pn(),effect:o,type:e,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}}(t)),function(t){return t.unsubscribe=function(){return e.delete(t.id)},e.set(t.id,t),function(n){t.unsubscribe(),(null==n?void 0:n.cancelActive)&&Bn(t);}}(n)},f=function(t){var n=Wn(t),e=n.type,r=n.effect,o=n.predicate,i=c((function(t){return ("string"==typeof e?t.type===e:t.predicate===o)&&t.effect===r}));return i&&(i.unsubscribe(),t.cancelActive&&Bn(i)),!!i},l=function(t,i,c,f){return y(n,null,(function(){var n,l,s,d;return o(this,(function(p){switch(p.label){case 0:n=new AbortController,l=function(t,n){return function(e,r){return Rn(function(e,r){return y(void 0,null,(function(){var i,u,c,a;return o(this,(function(o){switch(o.label){case 0:Mn(n),i=function(){},u=new Promise((function(n,r){var o=t({predicate:e,effect:function(t,e){e.unsubscribe(),n([t,e.getState(),e.getOriginalState()]);}});i=function(){o(),r();};})),c=[u],null!=r&&c.push(new Promise((function(t){return setTimeout(t,r,null)}))),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,qn(n,Promise.race(c))];case 2:return a=o.sent(),Mn(n),[2,a];case 3:return i(),[7];case 4:return [2]}}))}))}(e,r))}}(a,n.signal),s=[],p.label=1;case 1:return p.trys.push([1,3,4,6]),t.pending.add(n),[4,Promise.resolve(t.effect(i,Ln({},c,{getOriginalState:f,condition:function(t,n){return l(t,n).then(Boolean)},take:l,delay:zn(n.signal),pause:Fn(n.signal),extra:r,signal:n.signal,fork:(v=n.signal,h=s,function(t,n){In(t,"taskExecutor");var e,r=new AbortController;e=r,Tn(v,(function(){return Cn(e,v.reason)}));var i,u,c=(i=function(){return y(void 0,null,(function(){var n;return o(this,(function(e){switch(e.label){case 0:return Mn(v),Mn(r.signal),[4,t({pause:Fn(r.signal),delay:zn(r.signal),signal:r.signal})];case 1:return n=e.sent(),Mn(r.signal),[2,n]}}))}))},u=function(){return Cn(r,"task-completed")},y(void 0,null,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return n.sent(),[4,i()];case 2:return [2,{status:"ok",value:n.sent()}];case 3:return [2,{status:(t=n.sent())instanceof Dn?"cancelled":"rejected",error:t}];case 4:return null==u||u(),[7];case 5:return [2]}}))})));return (null==n?void 0:n.autoJoin)&&h.push(c),{result:Fn(v)(c),cancel:function(){Cn(r,"task-cancelled");}}}),unsubscribe:t.unsubscribe,subscribe:function(){e.set(t.id,t);},cancelActiveListeners:function(){t.pending.forEach((function(t,e,r){t!==n&&(Cn(t,"listener-cancelled"),r.delete(t));}));}})))];case 2:return p.sent(),[3,6];case 3:return (d=p.sent())instanceof Dn||Vn(u,d,{raisedBy:"effect"}),[3,6];case 4:return [4,Promise.allSettled(s)];case 5:return p.sent(),Cn(n,"listener-completed"),t.pending.delete(n),[7];case 6:return [2]}var v,h;}))}))},s=function(t){return function(){t.forEach(Bn),t.clear();}}(e);return {middleware:function(t){return function(n){return function(r){if(!Lt(r))return n(r);if(Xn.match(r))return a(r.payload);if(!Gn.match(r)){if(Jn.match(r))return f(r.payload);var o,i=t.getState(),c=function(){if(i===Un)throw new Error(Kn+": getOriginalState can only be called synchronously");return i};try{if(o=n(r),e.size>0)for(var d=t.getState(),p=Array.from(e.values()),v=0,y=p;v<y.length;v++){var h=y[v],b=!1;try{b=h.predicate(r,d,i);}catch(t){b=!1,Vn(u,t,{raisedBy:"predicate"});}b&&l(h,r,t,c);}}finally{i=Un;}return o}s();}}},startListening:a,stopListening:f,clearListeners:s}}var Qn,Yn="RTK_autoBatch",Zn=function(){return function(t){var n;return {payload:t,meta:(n={},n.RTK_autoBatch=!0,n)}}},te="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis):function(t){return (Qn||(Qn=Promise.resolve())).then(t).catch((function(t){return setTimeout((function(){throw t}),0)}))},ne=function(t){return function(n){setTimeout(n,t);}},ee="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:ne(10),re=function(t){return void 0===t&&(t={type:"raf"}),function(n){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=n.apply(void 0,e),i=!0,u=!1,c=!1,a=new Set,f="tick"===t.type?te:"raf"===t.type?ee:"callback"===t.type?t.queueNotification:ne(t.timeout),l=function(){c=!1,u&&(u=!1,a.forEach((function(t){return t()})));};return Object.assign({},o,{subscribe:function(t){var n=o.subscribe((function(){return i&&t()}));return a.add(t),function(){n(),a.delete(t);}},dispatch:function(t){var n;try{return i=!(null==(n=null==t?void 0:t.meta)?void 0:n.RTK_autoBatch),(u=!i)&&(c||(c=!0,f(l))),o.dispatch(t)}finally{i=!0;}}})}}};!function(){function t(t,n){var e=o[t];return e?e.enumerable=n:o[t]=e={configurable:!0,enumerable:n,get:function(){return ct.get(this[et],t)},set:function(n){ct.set(this[et],t,n);}},e}function n(t){for(var n=t.length-1;n>=0;n--){var o=t[n][et];if(!o.P)switch(o.i){case 5:r(o)&&V(o);break;case 4:e(o)&&V(o);}}}function e(t){for(var n=t.t,e=t.k,r=ot(e),o=r.length-1;o>=0;o--){var i=r[o];if(i!==et){var u=n[i];if(void 0===u&&!j(n,i))return !0;var c=e[i],a=c&&c[et];if(a?a.t!==u:!E(c,u))return !0}}var f=!!n[et];return r.length!==ot(n).length+(f?0:1)}function r(t){var n=t.k;if(n.length!==t.t.length)return !0;var e=Object.getOwnPropertyDescriptor(n,n.length-1);if(e&&!e.get)return !0;for(var r=0;r<n.length;r++)if(!n.hasOwnProperty(r))return !0;return !1}var o={};ut.ES5||(ut.ES5={J:function(n,e){var r=Array.isArray(n),o=function(n,e){if(n){for(var r=Array(e.length),o=0;o<e.length;o++)Object.defineProperty(r,""+o,t(o,!0));return r}var i=it(e);delete i[et];for(var u=ot(i),c=0;c<u.length;c++){var a=u[c];i[a]=t(a,n||!!i[a].enumerable);}return Object.create(Object.getPrototypeOf(e),i)}(r,n),i={i:r?5:4,A:e?e.A:T(),P:!1,I:!1,R:{},l:e,t:n,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,et,{value:i,writable:!0}),o},S:function(t,e,o){o?b(e)&&e[et].A===t&&n(t.p):(t.u&&function t(n){if(n&&"object"==typeof n){var e=n[et];if(e){var o=e.t,i=e.k,u=e.R,c=e.i;if(4===c)w(i,(function(n){n!==et&&(void 0!==o[n]||j(o,n)?u[n]||t(i[n]):(u[n]=!0,V(e)));})),w(o,(function(t){void 0!==i[t]||j(i,t)||(u[t]=!1,V(e));}));else if(5===c){if(r(e)&&(V(e),u.length=!0),i.length<o.length)for(var a=i.length;a<o.length;a++)u[a]=!1;else for(var f=o.length;f<i.length;f++)u[f]=!0;for(var l=Math.min(i.length,o.length),s=0;s<l;s++)i.hasOwnProperty(s)||(u[s]=!0),void 0===u[s]&&t(i[s]);}}}}(t.p[0]),n(t.p));},K:function(t){return 4===t.i?e(t):r(t)}});}(); | ||
exports.MiddlewareArray = qt; | ||
exports.SHOULD_AUTOBATCH = Ve; | ||
exports.TaskAbortError = ke; | ||
exports.__DO_NOT_USE__ActionTypes = bt; | ||
exports.addListener = ze; | ||
exports.EnhancerArray = Gt; | ||
exports.MiddlewareArray = Xt; | ||
exports.SHOULD_AUTOBATCH = Yn; | ||
exports.TaskAbortError = Dn; | ||
exports.__DO_NOT_USE__ActionTypes = gt; | ||
exports.addListener = Xn; | ||
exports.applyMiddleware = St; | ||
exports.autoBatchEnhancer = He; | ||
exports.autoBatchEnhancer = re; | ||
exports.bindActionCreators = Et; | ||
exports.clearAllListeners = Le; | ||
exports.clearAllListeners = Gn; | ||
exports.combineReducers = jt; | ||
exports.compose = At; | ||
exports.configureStore = Vt; | ||
exports.createAction = Xt; | ||
exports.createAsyncThunk = se; | ||
exports.createDraftSafeSelector = Tt; | ||
exports.createEntityAdapter = ie; | ||
exports.createImmutableStateInvariantMiddleware = Zt; | ||
exports.createListenerMiddleware = We; | ||
exports.configureStore = tn; | ||
exports.createAction = zt; | ||
exports.createActionCreatorInvariantMiddleware = Vt; | ||
exports.createAsyncThunk = gn; | ||
exports.createDraftSafeSelector = Rt; | ||
exports.createEntityAdapter = dn; | ||
exports.createImmutableStateInvariantMiddleware = un; | ||
exports.createListenerMiddleware = Hn; | ||
exports.createNextState = st; | ||
exports.createReducer = Ht; | ||
exports.createSelector = Dt; | ||
exports.createSerializableStateInvariantMiddleware = Wt; | ||
exports.createSlice = Qt; | ||
exports.createReducer = en; | ||
exports.createSelector = Nt; | ||
exports.createSerializableStateInvariantMiddleware = Yt; | ||
exports.createSlice = rn; | ||
exports.createStore = wt; | ||
exports.current = J; | ||
exports.findNonSerializableValue = Ut; | ||
exports.findNonSerializableValue = Ht; | ||
exports.freeze = x; | ||
exports.getDefaultMiddleware = Bt; | ||
exports.getType = Jt; | ||
exports.isAllOf = ye; | ||
exports.isAnyOf = ve; | ||
exports.isAsyncThunkAction = je; | ||
exports.isDraft = g; | ||
exports.isFulfilled = Oe; | ||
exports.isImmutableDefault = Yt; | ||
exports.isPending = be; | ||
exports.isPlain = Lt; | ||
exports.getDefaultMiddleware = Zt; | ||
exports.getType = Bt; | ||
exports.isAction = Lt; | ||
exports.isActionCreator = Ut; | ||
exports.isAllOf = jn; | ||
exports.isAnyOf = On; | ||
exports.isAsyncThunkAction = xn; | ||
exports.isDraft = b; | ||
exports.isFluxStandardAction = Kt; | ||
exports.isFulfilled = kn; | ||
exports.isImmutableDefault = on; | ||
exports.isPending = An; | ||
exports.isPlain = $t; | ||
exports.isPlainObject = Ct; | ||
exports.isRejected = me; | ||
exports.isRejectedWithValue = we; | ||
exports.isRejected = Sn; | ||
exports.isRejectedWithValue = _n; | ||
exports.legacy_createStore = Ot; | ||
exports.miniSerializeError = le; | ||
exports.nanoid = ue; | ||
exports.miniSerializeError = bn; | ||
exports.nanoid = pn; | ||
exports.original = m; | ||
exports.prepareAutoBatched = Xe; | ||
exports.removeListener = Ue; | ||
exports.unwrapResult = de; | ||
exports.prepareAutoBatched = Zn; | ||
exports.removeListener = Jn; | ||
exports.unwrapResult = mn; | ||
@@ -58,0 +63,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
import type { Middleware, StoreEnhancer } from 'redux'; | ||
import type { MiddlewareArray } from './utils'; | ||
import type { EnhancerArray, MiddlewareArray } from './utils'; | ||
/** | ||
@@ -53,3 +53,6 @@ * return True if T is `any`, otherwise return False | ||
export declare type ExtractDispatchExtensions<M> = M extends MiddlewareArray<infer MiddlewareTuple> ? ExtractDispatchFromMiddlewareTuple<MiddlewareTuple, {}> : M extends ReadonlyArray<Middleware> ? ExtractDispatchFromMiddlewareTuple<[...M], {}> : never; | ||
export declare type ExtractStoreExtensions<E> = E extends any[] ? UnionToIntersection<E[number] extends StoreEnhancer<infer Ext> ? Ext extends {} ? Ext : {} : {}> : {}; | ||
declare type ExtractStoreExtensionsFromEnhancerTuple<EnhancerTuple extends any[], Acc extends {}> = EnhancerTuple extends [infer Head, ...infer Tail] ? ExtractStoreExtensionsFromEnhancerTuple<Tail, Acc & (Head extends StoreEnhancer<infer Ext> ? IsAny<Ext, {}, Ext> : {})> : Acc; | ||
export declare type ExtractStoreExtensions<E> = E extends EnhancerArray<infer EnhancerTuple> ? ExtractStoreExtensionsFromEnhancerTuple<EnhancerTuple, {}> : E extends ReadonlyArray<StoreEnhancer> ? UnionToIntersection<E[number] extends StoreEnhancer<infer Ext> ? Ext extends {} ? IsAny<Ext, {}, Ext> : {} : {}> : never; | ||
declare type ExtractStateExtensionsFromEnhancerTuple<EnhancerTuple extends any[], Acc extends {}> = EnhancerTuple extends [infer Head, ...infer Tail] ? ExtractStateExtensionsFromEnhancerTuple<Tail, Acc & (Head extends StoreEnhancer<any, infer StateExt> ? IsAny<StateExt, {}, StateExt> : {})> : Acc; | ||
export declare type ExtractStateExtensions<E> = E extends EnhancerArray<infer EnhancerTuple> ? ExtractStateExtensionsFromEnhancerTuple<EnhancerTuple, {}> : E extends ReadonlyArray<StoreEnhancer> ? UnionToIntersection<E[number] extends StoreEnhancer<any, infer StateExt> ? StateExt extends {} ? IsAny<StateExt, {}, StateExt> : {} : {}> : never; | ||
/** | ||
@@ -56,0 +59,0 @@ * Helper type. Passes T out again, but boxes it in a way that it cannot |
@@ -1,2 +0,2 @@ | ||
import type { Middleware } from 'redux'; | ||
import type { Middleware, StoreEnhancer } from 'redux'; | ||
export declare function getTimeMeasureUtils(maxDelay: number, fnName: string): { | ||
@@ -18,2 +18,13 @@ measureTime<T>(fn: () => T): T; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export declare class EnhancerArray<Enhancers extends StoreEnhancer<any, any>[]> extends Array<Enhancers[number]> { | ||
constructor(...items: Enhancers); | ||
static get [Symbol.species](): any; | ||
concat<AdditionalEnhancers extends ReadonlyArray<StoreEnhancer<any, any>>>(items: AdditionalEnhancers): EnhancerArray<[...Enhancers, ...AdditionalEnhancers]>; | ||
concat<AdditionalEnhancers extends ReadonlyArray<StoreEnhancer<any, any>>>(...items: AdditionalEnhancers): EnhancerArray<[...Enhancers, ...AdditionalEnhancers]>; | ||
prepend<AdditionalEnhancers extends ReadonlyArray<StoreEnhancer<any, any>>>(items: AdditionalEnhancers): EnhancerArray<[...AdditionalEnhancers, ...Enhancers]>; | ||
prepend<AdditionalEnhancers extends ReadonlyArray<StoreEnhancer<any, any>>>(...items: AdditionalEnhancers): EnhancerArray<[...AdditionalEnhancers, ...Enhancers]>; | ||
} | ||
export declare function freezeDraftable<T>(val: T): T; |
{ | ||
"name": "@reduxjs/toolkit", | ||
"version": "1.9.2", | ||
"version": "1.9.7", | ||
"description": "The official, opinionated, batteries-included toolset for efficient Redux development", | ||
@@ -31,2 +31,3 @@ "author": "Mark Erikson <mark@isquaredsoftware.com>", | ||
"@microsoft/api-extractor": "^7.13.2", | ||
"@phryneas/ts-version": "^1.0.2", | ||
"@size-limit/preset-small-lib": "^4.11.0", | ||
@@ -101,6 +102,6 @@ "@testing-library/react": "^13.3.0", | ||
"dependencies": { | ||
"immer": "^9.0.16", | ||
"redux": "^4.2.0", | ||
"immer": "^9.0.21", | ||
"redux": "^4.2.1", | ||
"redux-thunk": "^2.4.2", | ||
"reselect": "^4.1.7" | ||
"reselect": "^4.1.8" | ||
}, | ||
@@ -107,0 +108,0 @@ "peerDependencies": { |
# Redux Toolkit | ||
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/reduxjs/redux-toolkit/CI?style=flat-square) | ||
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/reduxjs/redux-toolkit/tests.yml?style=flat-square) | ||
[![npm version](https://img.shields.io/npm/v/@reduxjs/toolkit.svg?style=flat-square)](https://www.npmjs.com/package/@reduxjs/toolkit) | ||
@@ -5,0 +5,0 @@ [![npm downloads](https://img.shields.io/npm/dm/@reduxjs/toolkit.svg?style=flat-square&label=RTK+downloads)](https://www.npmjs.com/package/@reduxjs/toolkit) |
@@ -27,3 +27,5 @@ import type { | ||
ExtractStoreExtensions, | ||
ExtractStateExtensions, | ||
} from './tsHelpers' | ||
import { EnhancerArray } from './utils' | ||
@@ -38,4 +40,4 @@ const IS_PRODUCTION = process.env.NODE_ENV === 'production' | ||
export type ConfigureEnhancersCallback<E extends Enhancers = Enhancers> = ( | ||
defaultEnhancers: readonly StoreEnhancer[] | ||
) => [...E] | ||
defaultEnhancers: EnhancerArray<[StoreEnhancer<{}, {}>]> | ||
) => E | ||
@@ -112,3 +114,3 @@ /** | ||
A extends Action = AnyAction, | ||
M extends Middlewares<S> = Middlewares<S>, | ||
M extends Middlewares<S> = Middlewares<S> | ||
> extends Store<S, A> { | ||
@@ -134,3 +136,4 @@ /** | ||
E extends Enhancers = Enhancers | ||
> = ToolkitStore<S, A, M> & ExtractStoreExtensions<E> | ||
> = ToolkitStore<S & ExtractStateExtensions<E>, A, M> & | ||
ExtractStoreExtensions<E> | ||
@@ -204,3 +207,4 @@ /** | ||
let storeEnhancers: Enhancers = [middlewareEnhancer] | ||
const defaultEnhancers = new EnhancerArray(middlewareEnhancer) | ||
let storeEnhancers: Enhancers = defaultEnhancers | ||
@@ -210,3 +214,3 @@ if (Array.isArray(enhancers)) { | ||
} else if (typeof enhancers === 'function') { | ||
storeEnhancers = enhancers(storeEnhancers) | ||
storeEnhancers = enhancers(defaultEnhancers) | ||
} | ||
@@ -213,0 +217,0 @@ |
@@ -8,2 +8,3 @@ import type { Action } from 'redux' | ||
} from './tsHelpers' | ||
import { hasMatchFunction } from './tsHelpers' | ||
import isPlainObject from './isPlainObject' | ||
@@ -228,3 +229,3 @@ | ||
* in the action object as a field called payload. The action creator function | ||
* will also have its toString() overriden so that it returns the action type, | ||
* will also have its toString() overridden so that it returns the action type, | ||
* allowing it to be used in reducer logic that is looking for that action type. | ||
@@ -246,3 +247,3 @@ * | ||
* in the action object as a field called payload. The action creator function | ||
* will also have its toString() overriden so that it returns the action type, | ||
* will also have its toString() overridden so that it returns the action type, | ||
* allowing it to be used in reducer logic that is looking for that action type. | ||
@@ -292,2 +293,26 @@ * | ||
/** | ||
* Returns true if value is a plain object with a `type` property. | ||
*/ | ||
export function isAction(action: unknown): action is Action<unknown> { | ||
return isPlainObject(action) && 'type' in action | ||
} | ||
/** | ||
* Returns true if value is an RTK-like action creator, with a static type property and match method. | ||
*/ | ||
export function isActionCreator( | ||
action: unknown | ||
): action is BaseActionCreator<unknown, string> & Function { | ||
return ( | ||
typeof action === 'function' && | ||
'type' in action && | ||
// hasMatchFunction only wants Matchers but I don't see the point in rewriting it | ||
hasMatchFunction(action as any) | ||
) | ||
} | ||
/** | ||
* Returns true if value is an action with a string type and valid Flux Standard Action keys. | ||
*/ | ||
export function isFSA(action: unknown): action is { | ||
@@ -300,4 +325,4 @@ type: string | ||
return ( | ||
isPlainObject(action) && | ||
typeof (action as any).type === 'string' && | ||
isAction(action) && | ||
typeof action.type === 'string' && | ||
Object.keys(action).every(isValidKey) | ||
@@ -304,0 +329,0 @@ ) |
@@ -18,3 +18,3 @@ import type { Dispatch, AnyAction } from 'redux' | ||
D extends Dispatch = Dispatch, | ||
RejectedValue = undefined, | ||
RejectedValue = unknown, | ||
RejectedMeta = unknown, | ||
@@ -141,3 +141,3 @@ FulfilledMeta = unknown | ||
type GetThunkAPI<ThunkApiConfig> = BaseThunkAPI< | ||
export type GetThunkAPI<ThunkApiConfig> = BaseThunkAPI< | ||
GetState<ThunkApiConfig>, | ||
@@ -144,0 +144,0 @@ GetExtra<ThunkApiConfig>, |
import type { Middleware, AnyAction } from 'redux' | ||
import type { ThunkMiddleware } from 'redux-thunk' | ||
import thunkMiddleware from 'redux-thunk' | ||
import type { ActionCreatorInvariantMiddlewareOptions } from './actionCreatorInvariantMiddleware' | ||
import { createActionCreatorInvariantMiddleware } from './actionCreatorInvariantMiddleware' | ||
import type { ImmutableStateInvariantMiddlewareOptions } from './immutableStateInvariantMiddleware' | ||
@@ -26,2 +28,3 @@ /* PROD_START_REMOVE_UMD */ | ||
serializableCheck?: boolean | SerializableStateInvariantMiddlewareOptions | ||
actionCreatorCheck?: boolean | ActionCreatorInvariantMiddlewareOptions | ||
} | ||
@@ -45,2 +48,3 @@ | ||
serializableCheck: true | ||
actionCreatorCheck: true | ||
} | ||
@@ -77,2 +81,3 @@ >( | ||
serializableCheck: true | ||
actionCreatorCheck: true | ||
} | ||
@@ -86,2 +91,3 @@ >( | ||
serializableCheck = true, | ||
actionCreatorCheck = true, | ||
} = options | ||
@@ -127,2 +133,13 @@ | ||
} | ||
if (actionCreatorCheck) { | ||
let actionCreatorOptions: ActionCreatorInvariantMiddlewareOptions = {} | ||
if (!isBoolean(actionCreatorCheck)) { | ||
actionCreatorOptions = actionCreatorCheck | ||
} | ||
middlewareArray.unshift( | ||
createActionCreatorInvariantMiddleware(actionCreatorOptions) | ||
) | ||
} | ||
} | ||
@@ -129,0 +146,0 @@ |
@@ -95,7 +95,9 @@ import type { Middleware } from 'redux' | ||
obj: Record<string, any>, | ||
path: string = '' | ||
path: string = '', | ||
checkedObjects: Set<Record<string, any>> = new Set() | ||
) { | ||
const tracked: Partial<TrackedProperty> = { value: obj } | ||
if (!isImmutable(obj)) { | ||
if (!isImmutable(obj) && !checkedObjects.has(obj)) { | ||
checkedObjects.add(obj); | ||
tracked.children = {} | ||
@@ -102,0 +104,0 @@ |
@@ -42,2 +42,5 @@ import { enableES5 } from 'immer' | ||
getType, | ||
isAction, | ||
isActionCreator, | ||
isFSA as isFluxStandardAction, | ||
} from './createAction' | ||
@@ -80,2 +83,4 @@ export type { | ||
} from './createSlice' | ||
export type { ActionCreatorInvariantMiddlewareOptions } from './actionCreatorInvariantMiddleware' | ||
export { createActionCreatorInvariantMiddleware } from './actionCreatorInvariantMiddleware' | ||
export { | ||
@@ -108,3 +113,3 @@ // js | ||
} from './mapBuilders' | ||
export { MiddlewareArray } from './utils' | ||
export { MiddlewareArray, EnhancerArray } from './utils' | ||
@@ -197,1 +202,3 @@ export { createEntityAdapter } from './entities/create_adapter' | ||
export type { AutoBatchOptions } from './autoBatchEnhancer' | ||
export type { ExtractDispatchExtensions as TSHelpersExtractDispatchExtensions } from './tsHelpers' |
import type { Dispatch, AnyAction, MiddlewareAPI } from 'redux' | ||
import type { ThunkDispatch } from 'redux-thunk' | ||
import { createAction } from '../createAction' | ||
import { createAction, isAction } from '../createAction' | ||
import { nanoid } from '../nanoid' | ||
@@ -26,2 +26,3 @@ | ||
UnsubscribeListenerOptions, | ||
ForkOptions, | ||
} from './types' | ||
@@ -82,3 +83,6 @@ import { | ||
const createFork = (parentAbortSignal: AbortSignalWithReason<unknown>) => { | ||
const createFork = ( | ||
parentAbortSignal: AbortSignalWithReason<unknown>, | ||
parentBlockingPromises: Promise<any>[] | ||
) => { | ||
const linkControllers = (controller: AbortController) => | ||
@@ -89,3 +93,6 @@ addAbortSignalListener(parentAbortSignal, () => | ||
return <T>(taskExecutor: ForkedTaskExecutor<T>): ForkedTask<T> => { | ||
return <T>( | ||
taskExecutor: ForkedTaskExecutor<T>, | ||
opts?: ForkOptions | ||
): ForkedTask<T> => { | ||
assertFunction(taskExecutor, 'taskExecutor') | ||
@@ -111,2 +118,6 @@ const childAbortController = new AbortController() | ||
if (opts?.autoJoin) { | ||
parentBlockingPromises.push(result) | ||
} | ||
return { | ||
@@ -383,2 +394,3 @@ result: createPause<TaskResult<T>>(parentAbortSignal)(result), | ||
) | ||
const autoJoinPromises: Promise<any>[] = [] | ||
@@ -402,3 +414,3 @@ try { | ||
signal: internalTaskController.signal, | ||
fork: createFork(internalTaskController.signal), | ||
fork: createFork(internalTaskController.signal, autoJoinPromises), | ||
unsubscribe: entry.unsubscribe, | ||
@@ -426,2 +438,4 @@ subscribe: () => { | ||
} finally { | ||
await Promise.allSettled(autoJoinPromises) | ||
abortControllerWithReason(internalTaskController, listenerCompleted) // Notify that the task has completed | ||
@@ -436,2 +450,7 @@ entry.pending.delete(internalTaskController) | ||
(api) => (next) => (action) => { | ||
if (!isAction(action)) { | ||
// we only want to notify listeners for action objects | ||
return next(action) | ||
} | ||
if (addListener.match(action)) { | ||
@@ -438,0 +457,0 @@ return startListening(action.payload) |
@@ -197,3 +197,3 @@ import { | ||
// Pretend we're doing expensive work | ||
await listenerApi.delay(15) | ||
await listenerApi.delay(25) | ||
@@ -225,3 +225,3 @@ workPerformed++ | ||
await delay(20) | ||
await delay(50) | ||
@@ -237,3 +237,3 @@ // Work finished, should have resubscribed | ||
await delay(20) | ||
await delay(50) | ||
@@ -240,0 +240,0 @@ expect(workPerformed).toBe(2) |
@@ -15,2 +15,3 @@ import type { EnhancedStore } from '@reduxjs/toolkit' | ||
taskCancelled, | ||
taskCompleted, | ||
} from '../exceptions' | ||
@@ -353,25 +354,57 @@ | ||
test('forkApi.signal listener is invoked as soon as the parent listener is cancelled or completed', async () => { | ||
let deferredResult = deferred() | ||
it.each([ | ||
{ | ||
autoJoin: true, | ||
expectedAbortReason: taskCompleted, | ||
cancelListener: false, | ||
}, | ||
{ | ||
autoJoin: false, | ||
expectedAbortReason: listenerCompleted, | ||
cancelListener: false, | ||
}, | ||
{ | ||
autoJoin: true, | ||
expectedAbortReason: listenerCancelled, | ||
cancelListener: true, | ||
}, | ||
{ | ||
autoJoin: false, | ||
expectedAbortReason: listenerCancelled, | ||
cancelListener: true, | ||
}, | ||
])( | ||
'signal is $expectedAbortReason when autoJoin: $autoJoin, cancelListener: $cancelListener', | ||
async ({ autoJoin, cancelListener, expectedAbortReason }) => { | ||
let deferredResult = deferred() | ||
startListening({ | ||
actionCreator: increment, | ||
async effect(_, listenerApi) { | ||
const wronglyDoNotAwaitResultOfTask = listenerApi.fork( | ||
async (forkApi) => { | ||
forkApi.signal.addEventListener('abort', () => { | ||
deferredResult.resolve( | ||
(forkApi.signal as AbortSignalWithReason<unknown>).reason | ||
) | ||
}) | ||
} | ||
) | ||
}, | ||
}) | ||
const unsubscribe = startListening({ | ||
actionCreator: increment, | ||
async effect(_, listenerApi) { | ||
listenerApi.fork( | ||
async (forkApi) => { | ||
forkApi.signal.addEventListener('abort', () => { | ||
deferredResult.resolve( | ||
(forkApi.signal as AbortSignalWithReason<unknown>).reason | ||
) | ||
}) | ||
store.dispatch(increment) | ||
await forkApi.delay(10) | ||
}, | ||
{ autoJoin } | ||
) | ||
}, | ||
}) | ||
expect(await deferredResult).toBe(listenerCompleted) | ||
}) | ||
store.dispatch(increment()) | ||
// let task start | ||
await Promise.resolve() | ||
if (cancelListener) unsubscribe({ cancelActive: true }) | ||
expect(await deferredResult).toBe(expectedAbortReason) | ||
} | ||
) | ||
test('fork.delay does not trigger unhandledRejections for completed or cancelled tasks', async () => { | ||
@@ -378,0 +411,0 @@ let deferredCompletedEvt = deferred() |
@@ -135,2 +135,11 @@ import type { PayloadAction, BaseActionCreator } from '../createAction' | ||
/** @public */ | ||
export interface ForkOptions { | ||
/** | ||
* If true, causes the parent task to not be marked as complete until | ||
* all autoJoined forks have completed or failed. | ||
*/ | ||
autoJoin: boolean; | ||
} | ||
/** @public */ | ||
export interface ListenerEffectAPI< | ||
@@ -242,4 +251,5 @@ State, | ||
* @param executor | ||
* @param options | ||
*/ | ||
fork<T>(executor: ForkedTaskExecutor<T>): ForkedTask<T> | ||
fork<T>(executor: ForkedTaskExecutor<T>, options?: ForkOptions): ForkedTask<T> | ||
/** | ||
@@ -246,0 +256,0 @@ * Returns a promise that resolves when `waitFor` resolves or |
@@ -49,3 +49,3 @@ import type { Action, AnyAction } from 'redux' | ||
* All calls to `builder.addMatcher` must come after any calls to `builder.addCase` and before any calls to `builder.addDefaultCase`. | ||
* @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/advanced-types.html#using-type-predicates) | ||
* @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) | ||
* function | ||
@@ -144,3 +144,3 @@ * @param reducer - The actual case reducer function. | ||
/* | ||
to keep the definition by the user in line with actual behavior, | ||
to keep the definition by the user in line with actual behavior, | ||
we enforce `addCase` to always be called before calling `addMatcher` | ||
@@ -164,5 +164,10 @@ as matching cases take precedence over matchers | ||
: typeOrActionCreator.type | ||
if (!type) { | ||
throw new Error( | ||
'`builder.addCase` cannot be called with an empty action type' | ||
) | ||
} | ||
if (type in actionsMap) { | ||
throw new Error( | ||
'addCase cannot be called with two reducers for the same action type' | ||
'`builder.addCase` cannot be called with two reducers for the same action type' | ||
) | ||
@@ -169,0 +174,0 @@ } |
@@ -5,3 +5,3 @@ import type { | ||
EndpointDefinition, | ||
ReplaceTagTypes, | ||
UpdateDefinitions, | ||
} from './endpointDefinitions' | ||
@@ -97,7 +97,11 @@ import type { | ||
*/ | ||
enhanceEndpoints<NewTagTypes extends string = never>(_: { | ||
enhanceEndpoints< | ||
NewTagTypes extends string = never, | ||
NewDefinitions extends EndpointDefinitions = never | ||
>(_: { | ||
addTagTypes?: readonly NewTagTypes[] | ||
endpoints?: ReplaceTagTypes< | ||
endpoints?: UpdateDefinitions< | ||
Definitions, | ||
TagTypes | NoInfer<NewTagTypes> | ||
TagTypes | NoInfer<NewTagTypes>, | ||
NewDefinitions | ||
> extends infer NewDefinitions | ||
@@ -112,3 +116,3 @@ ? { | ||
BaseQuery, | ||
ReplaceTagTypes<Definitions, TagTypes | NewTagTypes>, | ||
UpdateDefinitions<Definitions, TagTypes | NewTagTypes, NewDefinitions>, | ||
ReducerPath, | ||
@@ -115,0 +119,0 @@ TagTypes | NewTagTypes, |
@@ -105,2 +105,7 @@ import type { QueryThunk, RejectedAction } from '../buildThunks' | ||
if (api.util.resetApiState.match(action)) { | ||
previousSubscriptions = internalState.currentSubscriptions = {} | ||
return [true, false] | ||
} | ||
// Intercept requests by hooks to see if they're subscribed | ||
@@ -107,0 +112,0 @@ // Necessary because we delay updating store state to the end of the tick |
@@ -32,6 +32,8 @@ import type { AnyAction, PayloadAction } from '@reduxjs/toolkit' | ||
EndpointDefinitions, | ||
FullTagDescription, | ||
QueryDefinition, | ||
} from '../endpointDefinitions' | ||
import type { Patch } from 'immer' | ||
import { applyPatches } from 'immer' | ||
import { isDraft } from 'immer' | ||
import { applyPatches, original } from 'immer' | ||
import { onFocus, onFocusLost, onOffline, onOnline } from './setupListeners' | ||
@@ -128,13 +130,18 @@ import { | ||
}, | ||
queryResultPatched( | ||
draft, | ||
{ | ||
payload: { queryCacheKey, patches }, | ||
}: PayloadAction< | ||
queryResultPatched: { | ||
reducer( | ||
draft, | ||
{ | ||
payload: { queryCacheKey, patches }, | ||
}: PayloadAction< | ||
QuerySubstateIdentifier & { patches: readonly Patch[] } | ||
> | ||
) { | ||
updateQuerySubstateIfExists(draft, queryCacheKey, (substate) => { | ||
substate.data = applyPatches(substate.data as any, patches.concat()) | ||
}) | ||
}, | ||
prepare: prepareAutoBatched< | ||
QuerySubstateIdentifier & { patches: readonly Patch[] } | ||
> | ||
) { | ||
updateQuerySubstateIfExists(draft, queryCacheKey, (substate) => { | ||
substate.data = applyPatches(substate.data as any, patches.concat()) | ||
}) | ||
>(), | ||
}, | ||
@@ -213,3 +220,8 @@ }, | ||
definitions[meta.arg.endpointName].structuralSharing ?? true | ||
? copyWithStructuralSharing(substate.data, payload) | ||
? copyWithStructuralSharing( | ||
isDraft(substate.data) | ||
? original(substate.data) | ||
: substate.data, | ||
payload | ||
) | ||
: payload | ||
@@ -325,3 +337,38 @@ } | ||
initialState: initialState as InvalidationState<string>, | ||
reducers: {}, | ||
reducers: { | ||
updateProvidedBy: { | ||
reducer( | ||
draft, | ||
action: PayloadAction<{ | ||
queryCacheKey: QueryCacheKey | ||
providedTags: readonly FullTagDescription<string>[] | ||
}> | ||
) { | ||
const { queryCacheKey, providedTags } = action.payload | ||
for (const tagTypeSubscriptions of Object.values(draft)) { | ||
for (const idSubscriptions of Object.values(tagTypeSubscriptions)) { | ||
const foundAt = idSubscriptions.indexOf(queryCacheKey) | ||
if (foundAt !== -1) { | ||
idSubscriptions.splice(foundAt, 1) | ||
} | ||
} | ||
} | ||
for (const { type, id } of providedTags) { | ||
const subscribedQueries = ((draft[type] ??= {})[ | ||
id || '__internal_without_id' | ||
] ??= []) | ||
const alreadySubscribed = subscribedQueries.includes(queryCacheKey) | ||
if (!alreadySubscribed) { | ||
subscribedQueries.push(queryCacheKey) | ||
} | ||
} | ||
}, | ||
prepare: prepareAutoBatched<{ | ||
queryCacheKey: QueryCacheKey | ||
providedTags: readonly FullTagDescription<string>[] | ||
}>(), | ||
}, | ||
}, | ||
extraReducers(builder) { | ||
@@ -372,23 +419,9 @@ builder | ||
for (const tagTypeSubscriptions of Object.values(draft)) { | ||
for (const idSubscriptions of Object.values( | ||
tagTypeSubscriptions | ||
)) { | ||
const foundAt = idSubscriptions.indexOf(queryCacheKey) | ||
if (foundAt !== -1) { | ||
idSubscriptions.splice(foundAt, 1) | ||
} | ||
} | ||
} | ||
for (const { type, id } of providedTags) { | ||
const subscribedQueries = ((draft[type] ??= {})[ | ||
id || '__internal_without_id' | ||
] ??= []) | ||
const alreadySubscribed = | ||
subscribedQueries.includes(queryCacheKey) | ||
if (!alreadySubscribed) { | ||
subscribedQueries.push(queryCacheKey) | ||
} | ||
} | ||
invalidationSlice.caseReducers.updateProvidedBy( | ||
draft, | ||
invalidationSlice.actions.updateProvidedBy({ | ||
queryCacheKey, | ||
providedTags, | ||
}) | ||
) | ||
} | ||
@@ -435,4 +468,7 @@ ) | ||
reducers: { | ||
subscriptionsUpdated(state, action: PayloadAction<Patch[]>) { | ||
return applyPatches(state, action.payload) | ||
subscriptionsUpdated: { | ||
reducer(state, action: PayloadAction<Patch[]>) { | ||
return applyPatches(state, action.payload) | ||
}, | ||
prepare: prepareAutoBatched<Patch[]>(), | ||
}, | ||
@@ -497,2 +533,3 @@ }, | ||
...mutationSlice.actions, | ||
...invalidationSlice.actions, | ||
/** @deprecated has been renamed to `removeMutationResult` */ | ||
@@ -499,0 +536,0 @@ unsubscribeMutationResult: mutationSlice.actions.removeMutationResult, |
@@ -23,2 +23,3 @@ import type { InternalSerializeQueryArgs } from '../defaultSerializeQueryArgs' | ||
ResultTypeFrom, | ||
FullTagDescription, | ||
} from '../endpointDefinitions' | ||
@@ -168,3 +169,4 @@ import { isQueryDefinition } from '../endpointDefinitions' | ||
args: QueryArgFrom<Definitions[EndpointName]>, | ||
patches: readonly Patch[] | ||
patches: readonly Patch[], | ||
updateProvided?: boolean | ||
) => ThunkAction<void, PartialState, any, AnyAction> | ||
@@ -178,3 +180,4 @@ | ||
args: QueryArgFrom<Definitions[EndpointName]>, | ||
updateRecipe: Recipe<ResultTypeFrom<Definitions[EndpointName]>> | ||
updateRecipe: Recipe<ResultTypeFrom<Definitions[EndpointName]>>, | ||
updateProvided?: boolean | ||
) => ThunkAction<PatchCollection, PartialState, any, AnyAction> | ||
@@ -228,2 +231,3 @@ | ||
api, | ||
assertTagType, | ||
}: { | ||
@@ -235,2 +239,3 @@ baseQuery: BaseQuery | ||
api: Api<BaseQuery, Definitions, ReducerPath, any> | ||
assertTagType: AssertTagTypes | ||
}) { | ||
@@ -240,21 +245,48 @@ type State = RootState<any, string, ReducerPath> | ||
const patchQueryData: PatchQueryDataThunk<EndpointDefinitions, State> = | ||
(endpointName, args, patches) => (dispatch) => { | ||
(endpointName, args, patches, updateProvided) => (dispatch, getState) => { | ||
const endpointDefinition = endpointDefinitions[endpointName] | ||
const queryCacheKey = serializeQueryArgs({ | ||
queryArgs: args, | ||
endpointDefinition, | ||
endpointName, | ||
}) | ||
dispatch( | ||
api.internalActions.queryResultPatched({ | ||
queryCacheKey: serializeQueryArgs({ | ||
queryArgs: args, | ||
endpointDefinition, | ||
endpointName, | ||
}), | ||
patches, | ||
}) | ||
api.internalActions.queryResultPatched({ queryCacheKey, patches }) | ||
) | ||
if (!updateProvided) { | ||
return | ||
} | ||
const newValue = api.endpoints[endpointName].select(args)( | ||
// Work around TS 4.1 mismatch | ||
getState() as RootState<any, any, any> | ||
) | ||
const providedTags = calculateProvidedBy( | ||
endpointDefinition.providesTags, | ||
newValue.data, | ||
undefined, | ||
args, | ||
{}, | ||
assertTagType | ||
) | ||
dispatch( | ||
api.internalActions.updateProvidedBy({ queryCacheKey, providedTags }) | ||
) | ||
} | ||
const updateQueryData: UpdateQueryDataThunk<EndpointDefinitions, State> = | ||
(endpointName, args, updateRecipe) => (dispatch, getState) => { | ||
const currentState = ( | ||
api.endpoints[endpointName] as ApiEndpointQuery<any, any> | ||
).select(args)(getState()) | ||
(endpointName, args, updateRecipe, updateProvided = true) => | ||
(dispatch, getState) => { | ||
const endpointDefinition = api.endpoints[endpointName] | ||
const currentState = endpointDefinition.select(args)( | ||
// Work around TS 4.1 mismatch | ||
getState() as RootState<any, any, any> | ||
) | ||
let ret: PatchCollection = { | ||
@@ -265,3 +297,8 @@ patches: [], | ||
dispatch( | ||
api.util.patchQueryData(endpointName, args, ret.inversePatches) | ||
api.util.patchQueryData( | ||
endpointName, | ||
args, | ||
ret.inversePatches, | ||
updateProvided | ||
) | ||
), | ||
@@ -272,5 +309,6 @@ } | ||
} | ||
let newValue | ||
if ('data' in currentState) { | ||
if (isDraftable(currentState.data)) { | ||
const [, patches, inversePatches] = produceWithPatches( | ||
const [value, patches, inversePatches] = produceWithPatches( | ||
currentState.data, | ||
@@ -281,5 +319,6 @@ updateRecipe | ||
ret.inversePatches.push(...inversePatches) | ||
newValue = value | ||
} else { | ||
const value = updateRecipe(currentState.data) | ||
ret.patches.push({ op: 'replace', path: [], value }) | ||
newValue = updateRecipe(currentState.data) | ||
ret.patches.push({ op: 'replace', path: [], value: newValue }) | ||
ret.inversePatches.push({ | ||
@@ -293,3 +332,5 @@ op: 'replace', | ||
dispatch(api.util.patchQueryData(endpointName, args, ret.patches)) | ||
dispatch( | ||
api.util.patchQueryData(endpointName, args, ret.patches, updateProvided) | ||
) | ||
@@ -296,0 +337,0 @@ return ret |
@@ -6,2 +6,2 @@ import { buildCreateApi, CreateApi } from '../createApi' | ||
export { createApi, coreModule } | ||
export { createApi, coreModule, coreModuleName } |
@@ -521,2 +521,3 @@ /** | ||
serializeQueryArgs, | ||
assertTagType, | ||
}) | ||
@@ -523,0 +524,0 @@ |
@@ -5,2 +5,6 @@ import type { QueryCacheKey } from './core/apiState' | ||
const cache: WeakMap<any, string> | undefined = WeakMap | ||
? new WeakMap() | ||
: undefined | ||
export const defaultSerializeQueryArgs: SerializeQueryArgs<any> = ({ | ||
@@ -10,13 +14,26 @@ endpointName, | ||
}) => { | ||
let serialized = '' | ||
const cached = cache?.get(queryArgs) | ||
if (typeof cached === 'string') { | ||
serialized = cached | ||
} else { | ||
const stringified = JSON.stringify(queryArgs, (key, value) => | ||
isPlainObject(value) | ||
? Object.keys(value) | ||
.sort() | ||
.reduce<any>((acc, key) => { | ||
acc[key] = (value as any)[key] | ||
return acc | ||
}, {}) | ||
: value | ||
) | ||
if (isPlainObject(queryArgs)) { | ||
cache?.set(queryArgs, stringified) | ||
} | ||
serialized = stringified | ||
} | ||
// Sort the object keys before stringifying, to prevent useQuery({ a: 1, b: 2 }) having a different cache key than useQuery({ b: 2, a: 1 }) | ||
return `${endpointName}(${JSON.stringify(queryArgs, (key, value) => | ||
isPlainObject(value) | ||
? Object.keys(value) | ||
.sort() | ||
.reduce<any>((acc, key) => { | ||
acc[key] = (value as any)[key] | ||
return acc | ||
}, {}) | ||
: value | ||
)})` | ||
return `${endpointName}(${serialized})` | ||
} | ||
@@ -23,0 +40,0 @@ |
@@ -19,4 +19,7 @@ import type { AnyAction, ThunkDispatch } from '@reduxjs/toolkit' | ||
CastAny, | ||
NonUndefined, | ||
UnwrapPromise, | ||
} from './tsHelpers' | ||
import type { NEVER } from './fakeBaseQuery' | ||
import type { Api } from '@reduxjs/toolkit/query' | ||
@@ -403,3 +406,3 @@ const resultType = /* @__PURE__ */ Symbol() | ||
* | ||
* Since this is wrapped with Immer, you , you may either mutate the `currentCacheValue` directly, | ||
* Since this is wrapped with Immer, you may either mutate the `currentCacheValue` directly, | ||
* or return a new value, but _not_ both at once. | ||
@@ -780,5 +783,56 @@ * | ||
export type ReplaceTagTypes< | ||
export type TagTypesFromApi<T> = T extends Api<any, any, any, infer TagTypes> | ||
? TagTypes | ||
: never | ||
export type DefinitionsFromApi<T> = T extends Api< | ||
any, | ||
infer Definitions, | ||
any, | ||
any | ||
> | ||
? Definitions | ||
: never | ||
export type TransformedResponse< | ||
NewDefinitions extends EndpointDefinitions, | ||
K, | ||
ResultType | ||
> = K extends keyof NewDefinitions | ||
? NewDefinitions[K]['transformResponse'] extends undefined | ||
? ResultType | ||
: UnwrapPromise< | ||
ReturnType<NonUndefined<NewDefinitions[K]['transformResponse']>> | ||
> | ||
: ResultType | ||
export type OverrideResultType<Definition, NewResultType> = | ||
Definition extends QueryDefinition< | ||
infer QueryArg, | ||
infer BaseQuery, | ||
infer TagTypes, | ||
any, | ||
infer ReducerPath | ||
> | ||
? QueryDefinition<QueryArg, BaseQuery, TagTypes, NewResultType, ReducerPath> | ||
: Definition extends MutationDefinition< | ||
infer QueryArg, | ||
infer BaseQuery, | ||
infer TagTypes, | ||
any, | ||
infer ReducerPath | ||
> | ||
? MutationDefinition< | ||
QueryArg, | ||
BaseQuery, | ||
TagTypes, | ||
NewResultType, | ||
ReducerPath | ||
> | ||
: never | ||
export type UpdateDefinitions< | ||
Definitions extends EndpointDefinitions, | ||
NewTagTypes extends string | ||
NewTagTypes extends string, | ||
NewDefinitions extends EndpointDefinitions | ||
> = { | ||
@@ -792,3 +846,9 @@ [K in keyof Definitions]: Definitions[K] extends QueryDefinition< | ||
> | ||
? QueryDefinition<QueryArg, BaseQuery, NewTagTypes, ResultType, ReducerPath> | ||
? QueryDefinition< | ||
QueryArg, | ||
BaseQuery, | ||
NewTagTypes, | ||
TransformedResponse<NewDefinitions, K, ResultType>, | ||
ReducerPath | ||
> | ||
: Definitions[K] extends MutationDefinition< | ||
@@ -805,3 +865,3 @@ infer QueryArg, | ||
NewTagTypes, | ||
ResultType, | ||
TransformedResponse<NewDefinitions, K, ResultType>, | ||
ReducerPath | ||
@@ -808,0 +868,0 @@ > |
@@ -200,2 +200,3 @@ import { joinUrls } from './utils' | ||
timeout: defaultTimeout, | ||
responseHandler: globalResponseHandler, | ||
validateStatus: globalValidateStatus, | ||
@@ -222,3 +223,3 @@ ...baseFetchOptions | ||
params = undefined, | ||
responseHandler = 'json' as const, | ||
responseHandler = globalResponseHandler ?? ('json' as const), | ||
validateStatus = globalValidateStatus ?? defaultValidateStatus, | ||
@@ -270,3 +271,3 @@ timeout = defaultTimeout, | ||
const request = new Request(url, config) | ||
const requestClone = request.clone() | ||
const requestClone = new Request(url, config) | ||
meta = { request: requestClone } | ||
@@ -273,0 +274,0 @@ |
@@ -0,3 +1,11 @@ | ||
export type { | ||
CombinedState, | ||
QueryCacheKey, | ||
QueryKeys, | ||
QuerySubState, | ||
RootState, | ||
SubscriptionOptions, | ||
} from './core/apiState' | ||
export { QueryStatus } from './core/apiState' | ||
export type { Api, Module, ApiModules } from './apiTypes' | ||
export type { Api, ApiContext, ApiModules, Module } from './apiTypes' | ||
export type { | ||
@@ -14,2 +22,5 @@ BaseQueryApi, | ||
TagDescription, | ||
QueryArgFrom, | ||
ResultTypeFrom, | ||
DefinitionType, | ||
} from './endpointDefinitions' | ||
@@ -25,3 +36,11 @@ export { fetchBaseQuery } from './fetchBaseQuery' | ||
export { skipSelector, skipToken } from './core/buildSelectors' | ||
export type { SkipToken } from './core/buildSelectors' | ||
export type { | ||
QueryResultSelectorResult, | ||
MutationResultSelectorResult, | ||
SkipToken, | ||
} from './core/buildSelectors' | ||
export type { | ||
QueryActionCreatorResult, | ||
MutationActionCreatorResult, | ||
} from './core/buildInitiate' | ||
export type { CreateApi, CreateApiOptions } from './createApi' | ||
@@ -31,3 +50,16 @@ export { buildCreateApi } from './createApi' | ||
export { copyWithStructuralSharing } from './utils/copyWithStructuralSharing' | ||
export { createApi, coreModule } from './core' | ||
export { createApi, coreModule, coreModuleName } from './core' | ||
export type { | ||
ApiEndpointMutation, | ||
ApiEndpointQuery, | ||
CoreModule, | ||
PrefetchOptions, | ||
} from './core/module' | ||
export { defaultSerializeQueryArgs } from './defaultSerializeQueryArgs' | ||
export type { SerializeQueryArgs } from './defaultSerializeQueryArgs' | ||
export type { | ||
Id as TSHelpersId, | ||
NoInfer as TSHelpersNoInfer, | ||
Override as TSHelpersOverride, | ||
} from './tsHelpers' |
@@ -20,3 +20,3 @@ import type { AnyAction, ThunkAction, ThunkDispatch } from '@reduxjs/toolkit' | ||
RootState, | ||
} from '@reduxjs/toolkit/dist/query/core/apiState' | ||
} from '@reduxjs/toolkit/query' | ||
import type { | ||
@@ -28,3 +28,3 @@ EndpointDefinitions, | ||
ResultTypeFrom, | ||
} from '@reduxjs/toolkit/dist/query/endpointDefinitions' | ||
} from '@reduxjs/toolkit/query' | ||
import type { | ||
@@ -34,15 +34,15 @@ QueryResultSelectorResult, | ||
SkipToken, | ||
} from '@reduxjs/toolkit/dist/query/core/buildSelectors' | ||
} from '@reduxjs/toolkit/query' | ||
import type { | ||
QueryActionCreatorResult, | ||
MutationActionCreatorResult, | ||
} from '@reduxjs/toolkit/dist/query/core/buildInitiate' | ||
import type { SerializeQueryArgs } from '@reduxjs/toolkit/dist/query/defaultSerializeQueryArgs' | ||
} from '@reduxjs/toolkit/query' | ||
import type { SerializeQueryArgs } from '@reduxjs/toolkit/query' | ||
import { shallowEqual } from 'react-redux' | ||
import type { Api, ApiContext } from '@reduxjs/toolkit/dist/query/apiTypes' | ||
import type { Api, ApiContext } from '@reduxjs/toolkit/query' | ||
import type { | ||
Id, | ||
NoInfer, | ||
Override, | ||
} from '@reduxjs/toolkit/dist/query/tsHelpers' | ||
TSHelpersId, | ||
TSHelpersNoInfer, | ||
TSHelpersOverride, | ||
} from '@reduxjs/toolkit/query' | ||
import type { | ||
@@ -53,3 +53,3 @@ ApiEndpointMutation, | ||
PrefetchOptions, | ||
} from '@reduxjs/toolkit/dist/query/core/module' | ||
} from '@reduxjs/toolkit/query' | ||
import type { ReactHooksModuleOptions } from './module' | ||
@@ -147,3 +147,3 @@ import { useStableQueryArgs } from './useSerializedStableValue' | ||
* ```tsx | ||
* // codeblock-meta title="Skip example" | ||
* // codeblock-meta no-transpile title="Skip example" | ||
* const Pokemon = ({ name, skip }: { name: string; skip: boolean }) => { | ||
@@ -382,3 +382,3 @@ * const { data, error, status } = useGetPokemonByNameQuery(name, { | ||
R | ||
> = NoInfer<R> | ||
> = TSHelpersNoInfer<R> | ||
@@ -396,3 +396,3 @@ /** | ||
> | ||
> = NoInfer<R> | ||
> = TSHelpersNoInfer<R> | ||
@@ -430,4 +430,4 @@ type UseQueryStateBaseResult<D extends QueryDefinition<any, any, any, any>> = | ||
type UseQueryStateDefaultResult<D extends QueryDefinition<any, any, any, any>> = | ||
Id< | ||
| Override< | ||
TSHelpersId< | ||
| TSHelpersOverride< | ||
Extract< | ||
@@ -439,3 +439,3 @@ UseQueryStateBaseResult<D>, | ||
> | ||
| Override< | ||
| TSHelpersOverride< | ||
UseQueryStateBaseResult<D>, | ||
@@ -489,3 +489,3 @@ | { isLoading: true; isFetching: boolean; data: undefined } | ||
R | ||
> = NoInfer<R> & { | ||
> = TSHelpersNoInfer<R> & { | ||
originalArgs?: QueryArgFrom<D> | ||
@@ -639,5 +639,3 @@ /** | ||
} | ||
if (queryArgs === skipToken) { | ||
lastResult = undefined | ||
} | ||
// data is the last known good request result we have tracked - or if none has been tracked yet the last good result for the current args | ||
@@ -756,3 +754,5 @@ let data = currentState.isSuccess ? currentState.data : lastResult?.data | ||
usePossiblyImmediateEffect((): void | undefined => { | ||
promiseRef.current = undefined | ||
if (subscriptionRemoved) { | ||
promiseRef.current = undefined | ||
} | ||
}, [subscriptionRemoved]) | ||
@@ -759,0 +759,0 @@ |
@@ -1,16 +0,4 @@ | ||
import { coreModule, buildCreateApi, CreateApi } from '@reduxjs/toolkit/query' | ||
import { coreModule, buildCreateApi } from '@reduxjs/toolkit/query' | ||
import { reactHooksModule, reactHooksModuleName } from './module' | ||
import type { MutationHooks, QueryHooks } from './buildHooks' | ||
import type { | ||
EndpointDefinitions, | ||
QueryDefinition, | ||
MutationDefinition, | ||
QueryArgFrom, | ||
} from '@reduxjs/toolkit/dist/query/endpointDefinitions' | ||
import type { BaseQueryFn } from '@reduxjs/toolkit/dist/query/baseQueryTypes' | ||
import type { QueryKeys } from '@reduxjs/toolkit/dist/query/core/apiState' | ||
import type { PrefetchOptions } from '@reduxjs/toolkit/dist/query/core/module' | ||
export * from '@reduxjs/toolkit/query' | ||
@@ -30,2 +18,2 @@ export { ApiProvider } from './ApiProvider' | ||
} from './buildHooks' | ||
export { createApi, reactHooksModule } | ||
export { createApi, reactHooksModule, reactHooksModuleName } |
@@ -9,7 +9,7 @@ import type { MutationHooks, QueryHooks } from './buildHooks' | ||
QueryArgFrom, | ||
} from '@reduxjs/toolkit/dist/query/endpointDefinitions' | ||
} from '@reduxjs/toolkit/query' | ||
import type { Api, Module } from '../apiTypes' | ||
import { capitalize } from '../utils' | ||
import { safeAssign } from '../tsHelpers' | ||
import type { BaseQueryFn } from '@reduxjs/toolkit/dist/query/baseQueryTypes' | ||
import type { BaseQueryFn } from '@reduxjs/toolkit/query' | ||
@@ -30,3 +30,3 @@ import type { HooksWithUniqueNames } from './namedHooks' | ||
declare module '@reduxjs/toolkit/dist/query/apiTypes' { | ||
declare module '@reduxjs/toolkit/query' { | ||
export interface ApiModules< | ||
@@ -33,0 +33,0 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars |
@@ -7,26 +7,37 @@ import type { UseMutation, UseLazyQuery, UseQuery } from './buildHooks' | ||
QueryDefinition, | ||
} from '@reduxjs/toolkit/dist/query/endpointDefinitions' | ||
} from '@reduxjs/toolkit/query' | ||
type QueryHookNames<Definitions extends EndpointDefinitions> = { | ||
[K in keyof Definitions as Definitions[K] extends { | ||
type: DefinitionType.query | ||
} | ||
? `use${Capitalize<K & string>}Query` | ||
: never]: UseQuery< | ||
Extract<Definitions[K], QueryDefinition<any, any, any, any>> | ||
> | ||
} | ||
type LazyQueryHookNames<Definitions extends EndpointDefinitions> = { | ||
[K in keyof Definitions as Definitions[K] extends { | ||
type: DefinitionType.query | ||
} | ||
? `useLazy${Capitalize<K & string>}Query` | ||
: never]: UseLazyQuery< | ||
Extract<Definitions[K], QueryDefinition<any, any, any, any>> | ||
> | ||
} | ||
type MutationHookNames<Definitions extends EndpointDefinitions> = { | ||
[K in keyof Definitions as Definitions[K] extends { | ||
type: DefinitionType.mutation | ||
} | ||
? `use${Capitalize<K & string>}Mutation` | ||
: never]: UseMutation< | ||
Extract<Definitions[K], MutationDefinition<any, any, any, any>> | ||
> | ||
} | ||
export type HooksWithUniqueNames<Definitions extends EndpointDefinitions> = | ||
keyof Definitions extends infer Keys | ||
? Keys extends string | ||
? Definitions[Keys] extends { type: DefinitionType.query } | ||
? { | ||
[K in Keys as `use${Capitalize<K>}Query`]: UseQuery< | ||
Extract<Definitions[K], QueryDefinition<any, any, any, any>> | ||
> | ||
} & | ||
{ | ||
[K in Keys as `useLazy${Capitalize<K>}Query`]: UseLazyQuery< | ||
Extract<Definitions[K], QueryDefinition<any, any, any, any>> | ||
> | ||
} | ||
: Definitions[Keys] extends { type: DefinitionType.mutation } | ||
? { | ||
[K in Keys as `use${Capitalize<K>}Mutation`]: UseMutation< | ||
Extract<Definitions[K], MutationDefinition<any, any, any, any>> | ||
> | ||
} | ||
: never | ||
: never | ||
: never | ||
QueryHookNames<Definitions> & | ||
LazyQueryHookNames<Definitions> & | ||
MutationHookNames<Definitions> |
import { useEffect, useRef, useMemo } from 'react' | ||
import type { SerializeQueryArgs } from '@reduxjs/toolkit/dist/query/defaultSerializeQueryArgs' | ||
import type { EndpointDefinition } from '@reduxjs/toolkit/dist/query/endpointDefinitions' | ||
import type { SerializeQueryArgs } from '@reduxjs/toolkit/query' | ||
import type { EndpointDefinition } from '@reduxjs/toolkit/query' | ||
@@ -5,0 +5,0 @@ export function useStableQueryArgs<T>( |
import { configureStore, createAction, createReducer } from '@reduxjs/toolkit' | ||
import type { SerializedError } from '@reduxjs/toolkit' | ||
import type { | ||
@@ -8,3 +9,6 @@ Api, | ||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query' | ||
import type { FetchBaseQueryMeta } from '@reduxjs/toolkit/dist/query/fetchBaseQuery' | ||
import type { | ||
FetchBaseQueryError, | ||
FetchBaseQueryMeta, | ||
} from '@reduxjs/toolkit/dist/query/fetchBaseQuery' | ||
@@ -23,2 +27,7 @@ import { | ||
import { string } from 'yargs' | ||
import type { | ||
DefinitionsFromApi, | ||
OverrideResultType, | ||
TagTypesFromApi, | ||
} from '@reduxjs/toolkit/dist/query/endpointDefinitions' | ||
@@ -527,2 +536,64 @@ const originalEnv = process.env.NODE_ENV | ||
}) | ||
test('updated transform response types', async () => { | ||
const baseApi = createApi({ | ||
baseQuery: fetchBaseQuery({ baseUrl: 'https://example.com' }), | ||
tagTypes: ['old'], | ||
endpoints: (build) => ({ | ||
query1: build.query<'out1', void>({ query: () => 'success' }), | ||
mutation1: build.mutation<'out1', void>({ query: () => 'success' }), | ||
}), | ||
}) | ||
type Transformed = { value: string } | ||
type Definitions = DefinitionsFromApi<typeof api> | ||
type TagTypes = TagTypesFromApi<typeof api> | ||
type Q1Definition = OverrideResultType<Definitions['query1'], Transformed> | ||
type M1Definition = OverrideResultType< | ||
Definitions['mutation1'], | ||
Transformed | ||
> | ||
type UpdatedDefitions = Omit<Definitions, 'query1' | 'mutation1'> & { | ||
query1: Q1Definition | ||
mutation1: M1Definition | ||
} | ||
const enhancedApi = baseApi.enhanceEndpoints<TagTypes, UpdatedDefitions>({ | ||
endpoints: { | ||
query1: { | ||
transformResponse: (a, b, c) => ({ | ||
value: 'transformed', | ||
}), | ||
}, | ||
mutation1: { | ||
transformResponse: (a, b, c) => ({ | ||
value: 'transformed', | ||
}), | ||
}, | ||
}, | ||
}) | ||
const storeRef = setupApiStore(enhancedApi, undefined, { | ||
withoutTestLifecycles: true, | ||
}) | ||
const queryResponse = await storeRef.store.dispatch( | ||
enhancedApi.endpoints.query1.initiate() | ||
) | ||
expect(queryResponse.data).toEqual({ value: 'transformed' }) | ||
expectType<Transformed | undefined>(queryResponse.data) | ||
const mutationResponse = await storeRef.store.dispatch( | ||
enhancedApi.endpoints.mutation1.initiate() | ||
) | ||
expectType< | ||
{ data: Transformed } | { error: FetchBaseQueryError | SerializedError } | ||
>(mutationResponse) | ||
expect('data' in mutationResponse && mutationResponse.data).toEqual({ | ||
value: 'transformed', | ||
}) | ||
}) | ||
}) | ||
@@ -529,0 +600,0 @@ }) |
@@ -47,1 +47,67 @@ import { defaultSerializeQueryArgs } from '@internal/query/defaultSerializeQueryArgs' | ||
}) | ||
test('Fully serializes a deeply nested object', () => { | ||
const nestedObj = { | ||
a: { | ||
a1: { | ||
a11: { | ||
a111: 1, | ||
}, | ||
}, | ||
}, | ||
b: { | ||
b2: { | ||
b21: 3, | ||
}, | ||
b1: { | ||
b11: 2, | ||
}, | ||
}, | ||
} | ||
const res = defaultSerializeQueryArgs({ | ||
endpointDefinition, | ||
endpointName, | ||
queryArgs: nestedObj, | ||
}) | ||
expect(res).toMatchInlineSnapshot( | ||
`"test({\\"a\\":{\\"a1\\":{\\"a11\\":{\\"a111\\":1}}},\\"b\\":{\\"b1\\":{\\"b11\\":2},\\"b2\\":{\\"b21\\":3}}})"` | ||
) | ||
}) | ||
test('Caches results for plain objects', () => { | ||
const testData = Array.from({ length: 10000 }).map((_, i) => { | ||
return { | ||
albumId: i, | ||
id: i, | ||
title: 'accusamus beatae ad facilis cum similique qui sunt', | ||
url: 'https://via.placeholder.com/600/92c952', | ||
thumbnailUrl: 'https://via.placeholder.com/150/92c952', | ||
} | ||
}) | ||
const data = { | ||
testData, | ||
} | ||
const runWithTimer = (data: any) => { | ||
const start = Date.now() | ||
const res = defaultSerializeQueryArgs({ | ||
endpointDefinition, | ||
endpointName, | ||
queryArgs: data, | ||
}) | ||
const end = Date.now() | ||
const duration = end - start | ||
return [res, duration] as const | ||
} | ||
const [res1, time1] = runWithTimer(data) | ||
const [res2, time2] = runWithTimer(data) | ||
expect(res1).toBe(res2) | ||
expect(time2).toBeLessThanOrEqual(time1) | ||
// Locally, stringifying 10K items takes 25-30ms. | ||
// Assuming the WeakMap cache hit, this _should_ be 0 | ||
expect(time2).toBeLessThan(2) | ||
}) |
@@ -35,2 +35,4 @@ export type Id<T> = { [K in keyof T]: T[K] } & {} | ||
export type NonUndefined<T> = T extends undefined ? never : T | ||
export type UnwrapPromise<T> = T extends PromiseLike<infer V> ? V : T | ||
@@ -37,0 +39,0 @@ |
@@ -78,5 +78,6 @@ import type { StoreEnhancer, StoreEnhancerStoreCreator } from '@reduxjs/toolkit' | ||
expect(redux.applyMiddleware).toHaveBeenCalledWith( | ||
expect.any(Function), // immutableCheck | ||
expect.any(Function), // thunk | ||
expect.any(Function), // immutableCheck | ||
expect.any(Function) // serializableCheck | ||
expect.any(Function), // serializableCheck | ||
expect.any(Function) // actionCreatorCheck | ||
) | ||
@@ -235,5 +236,3 @@ expect(devtools.composeWithDevTools).toHaveBeenCalled() // @remap-prod-remove-line-line | ||
reducer, | ||
enhancers: (defaultEnhancers) => { | ||
return [...defaultEnhancers, dummyEnhancer] | ||
}, | ||
enhancers: (defaultEnhancers) => defaultEnhancers.concat(dummyEnhancer), | ||
}) | ||
@@ -240,0 +239,0 @@ |
@@ -197,3 +197,83 @@ /* eslint-disable no-lone-blocks */ | ||
expectType<number>(store.anotherProperty) | ||
const storeWithCallback = configureStore({ | ||
reducer: () => 0, | ||
enhancers: (defaultEnhancers) => | ||
defaultEnhancers | ||
.prepend(anotherPropertyStoreEnhancer) | ||
.concat(somePropertyStoreEnhancer), | ||
}) | ||
expectType<Dispatch & ThunkDispatch<number, undefined, AnyAction>>( | ||
store.dispatch | ||
) | ||
expectType<string>(storeWithCallback.someProperty) | ||
expectType<number>(storeWithCallback.anotherProperty) | ||
} | ||
{ | ||
type StateExtendingEnhancer = StoreEnhancer<{}, { someProperty: string }> | ||
const someStateExtendingEnhancer: StateExtendingEnhancer = | ||
(next) => | ||
// @ts-expect-error how do you properly return an enhancer that extends state? | ||
(...args) => { | ||
const store = next(...args) | ||
const getState = () => ({ | ||
...store.getState(), | ||
someProperty: 'some value', | ||
}) | ||
return { | ||
...store, | ||
getState, | ||
} | ||
} | ||
type AnotherStateExtendingEnhancer = StoreEnhancer< | ||
{}, | ||
{ anotherProperty: number } | ||
> | ||
const anotherStateExtendingEnhancer: AnotherStateExtendingEnhancer = | ||
(next) => | ||
// @ts-expect-error any input on this would be great | ||
(...args) => { | ||
const store = next(...args) | ||
const getState = () => ({ | ||
...store.getState(), | ||
anotherProperty: 123, | ||
}) | ||
return { | ||
...store, | ||
getState, | ||
} | ||
} | ||
const store = configureStore({ | ||
reducer: () => ({ aProperty: 0 }), | ||
enhancers: [ | ||
someStateExtendingEnhancer, | ||
anotherStateExtendingEnhancer, | ||
// this doesn't work without the as const | ||
] as const, | ||
}) | ||
const state = store.getState() | ||
expectType<number>(state.aProperty) | ||
expectType<string>(state.someProperty) | ||
expectType<number>(state.anotherProperty) | ||
const storeWithCallback = configureStore({ | ||
reducer: () => ({ aProperty: 0 }), | ||
enhancers: (dE) => | ||
dE.concat(someStateExtendingEnhancer, anotherStateExtendingEnhancer), | ||
}) | ||
const stateWithCallback = storeWithCallback.getState() | ||
expectType<number>(stateWithCallback.aProperty) | ||
expectType<string>(stateWithCallback.someProperty) | ||
expectType<number>(stateWithCallback.anotherProperty) | ||
} | ||
} | ||
@@ -200,0 +280,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { createAction, getType } from '@reduxjs/toolkit' | ||
import { createAction, getType, isAction } from '@reduxjs/toolkit' | ||
@@ -125,2 +125,23 @@ describe('createAction', () => { | ||
describe('isAction', () => { | ||
it('should only return true for plain objects with a type property', () => { | ||
const actionCreator = createAction('anAction') | ||
class Action { | ||
type = 'totally an action' | ||
} | ||
const testCases: [action: unknown, expected: boolean][] = [ | ||
[{ type: 'an action' }, true], | ||
[{ type: 'more props', extra: true }, true], | ||
[actionCreator(), true], | ||
[actionCreator, false], | ||
[Promise.resolve({ type: 'an action' }), false], | ||
[new Action(), false], | ||
['a string', false], | ||
] | ||
for (const [action, expected] of testCases) { | ||
expect(isAction(action)).toBe(expected) | ||
} | ||
}) | ||
}) | ||
describe('getType', () => { | ||
@@ -127,0 +148,0 @@ it('should return the action type', () => { |
@@ -20,2 +20,3 @@ /* eslint-disable no-lone-blocks */ | ||
} from '@internal/createAsyncThunk' | ||
import type { TSVersion } from '@phryneas/ts-version' | ||
@@ -291,4 +292,18 @@ const ANY = {} as any | ||
const asyncThunk = createAsyncThunk('test', (arg?: number) => 0) | ||
expectType<(arg?: number) => any>(asyncThunk) | ||
asyncThunk() | ||
// Per https://github.com/reduxjs/redux-toolkit/issues/3758#issuecomment-1742152774 , this is a bug in | ||
// TS 5.1 and 5.2, that is fixed in 5.3. Conditionally run the TS assertion here. | ||
type IsTS51Or52 = TSVersion.Major extends 5 | ||
? TSVersion.Minor extends 1 | 2 | ||
? true | ||
: false | ||
: false | ||
type expectedType = IsTS51Or52 extends true | ||
? (arg: number) => any | ||
: (arg?: number) => any | ||
expectType<expectedType>(asyncThunk) | ||
// We _should_ be able to call this with no arguments, but we run into that error in 5.1 and 5.2. | ||
// Disabling this for now. | ||
// asyncThunk() | ||
asyncThunk(5) | ||
@@ -295,0 +310,0 @@ // @ts-expect-error |
@@ -463,3 +463,3 @@ import type { | ||
).toThrowErrorMatchingInlineSnapshot( | ||
`"addCase cannot be called with two reducers for the same action type"` | ||
'"`builder.addCase` cannot be called with two reducers for the same action type"' | ||
) | ||
@@ -474,5 +474,23 @@ expect(() => | ||
).toThrowErrorMatchingInlineSnapshot( | ||
`"addCase cannot be called with two reducers for the same action type"` | ||
'"`builder.addCase` cannot be called with two reducers for the same action type"' | ||
) | ||
}) | ||
test('will throw if an empty type is used', () => { | ||
const customActionCreator = (payload: number) => ({ | ||
type: 'custom_action', | ||
payload, | ||
}) | ||
customActionCreator.type = "" | ||
expect(() => | ||
createReducer(0, (builder) => | ||
builder.addCase( | ||
customActionCreator, | ||
(state, action) => state + action.payload | ||
) | ||
) | ||
).toThrowErrorMatchingInlineSnapshot( | ||
'"`builder.addCase` cannot be called with an empty action type"' | ||
) | ||
}) | ||
}) | ||
@@ -479,0 +497,0 @@ |
@@ -18,2 +18,3 @@ import type { | ||
import { expectType } from './helpers' | ||
import { BaseActionCreator } from '@internal/createAction' | ||
@@ -39,2 +40,4 @@ describe('getDefaultMiddleware', () => { | ||
const defaultMiddleware = getDefaultMiddleware() | ||
it('removes the thunk middleware if disabled', () => { | ||
@@ -44,7 +47,6 @@ const middleware = getDefaultMiddleware({ thunk: false }) | ||
expect(middleware.includes(thunk)).toBe(false) | ||
expect(middleware.length).toBe(2) | ||
expect(middleware.length).toBe(defaultMiddleware.length - 1) | ||
}) | ||
it('removes the immutable middleware if disabled', () => { | ||
const defaultMiddleware = getDefaultMiddleware() | ||
const middleware = getDefaultMiddleware({ immutableCheck: false }) | ||
@@ -55,3 +57,2 @@ expect(middleware.length).toBe(defaultMiddleware.length - 1) | ||
it('removes the serializable middleware if disabled', () => { | ||
const defaultMiddleware = getDefaultMiddleware() | ||
const middleware = getDefaultMiddleware({ serializableCheck: false }) | ||
@@ -61,2 +62,7 @@ expect(middleware.length).toBe(defaultMiddleware.length - 1) | ||
it('removes the action creator middleware if disabled', () => { | ||
const middleware = getDefaultMiddleware({ actionCreatorCheck: false }) | ||
expect(middleware.length).toBe(defaultMiddleware.length - 1) | ||
}) | ||
it('allows passing options to thunk', () => { | ||
@@ -68,2 +74,3 @@ const extraArgument = 42 as const | ||
serializableCheck: false, | ||
actionCreatorCheck: false, | ||
}) | ||
@@ -138,2 +145,3 @@ | ||
serializableCheck: false, | ||
actionCreatorCheck: false, | ||
}) | ||
@@ -163,2 +171,3 @@ | ||
}, | ||
actionCreatorCheck: false, | ||
}) | ||
@@ -179,2 +188,29 @@ | ||
it('allows passing options to actionCreatorCheck', () => { | ||
let actionCreatorCheckWasCalled = false | ||
const middleware = getDefaultMiddleware({ | ||
thunk: false, | ||
immutableCheck: false, | ||
serializableCheck: false, | ||
actionCreatorCheck: { | ||
isActionCreator: (action: unknown): action is Function => { | ||
actionCreatorCheckWasCalled = true | ||
return false | ||
}, | ||
}, | ||
}) | ||
const reducer = () => ({}) | ||
const store = configureStore({ | ||
reducer, | ||
middleware, | ||
}) | ||
store.dispatch({ type: 'TEST_ACTION' }) | ||
expect(actionCreatorCheckWasCalled).toBe(true) | ||
}) | ||
describe('MiddlewareArray functionality', () => { | ||
@@ -181,0 +217,0 @@ const middleware1: Middleware = () => (next) => (action) => next(action) |
import type { Middleware, StoreEnhancer } from 'redux' | ||
import type { MiddlewareArray } from './utils' | ||
import type { EnhancerArray, MiddlewareArray } from './utils' | ||
@@ -104,6 +104,53 @@ /** | ||
export type ExtractStoreExtensions<E> = E extends any[] | ||
? UnionToIntersection<E[number] extends StoreEnhancer<infer Ext> ? Ext extends {} ? Ext : {} : {}> | ||
: {} | ||
type ExtractStoreExtensionsFromEnhancerTuple< | ||
EnhancerTuple extends any[], | ||
Acc extends {} | ||
> = EnhancerTuple extends [infer Head, ...infer Tail] | ||
? ExtractStoreExtensionsFromEnhancerTuple< | ||
Tail, | ||
Acc & (Head extends StoreEnhancer<infer Ext> ? IsAny<Ext, {}, Ext> : {}) | ||
> | ||
: Acc | ||
export type ExtractStoreExtensions<E> = E extends EnhancerArray< | ||
infer EnhancerTuple | ||
> | ||
? ExtractStoreExtensionsFromEnhancerTuple<EnhancerTuple, {}> | ||
: E extends ReadonlyArray<StoreEnhancer> | ||
? UnionToIntersection< | ||
E[number] extends StoreEnhancer<infer Ext> | ||
? Ext extends {} | ||
? IsAny<Ext, {}, Ext> | ||
: {} | ||
: {} | ||
> | ||
: never | ||
type ExtractStateExtensionsFromEnhancerTuple< | ||
EnhancerTuple extends any[], | ||
Acc extends {} | ||
> = EnhancerTuple extends [infer Head, ...infer Tail] | ||
? ExtractStateExtensionsFromEnhancerTuple< | ||
Tail, | ||
Acc & | ||
(Head extends StoreEnhancer<any, infer StateExt> | ||
? IsAny<StateExt, {}, StateExt> | ||
: {}) | ||
> | ||
: Acc | ||
export type ExtractStateExtensions<E> = E extends EnhancerArray< | ||
infer EnhancerTuple | ||
> | ||
? ExtractStateExtensionsFromEnhancerTuple<EnhancerTuple, {}> | ||
: E extends ReadonlyArray<StoreEnhancer> | ||
? UnionToIntersection< | ||
E[number] extends StoreEnhancer<any, infer StateExt> | ||
? StateExt extends {} | ||
? IsAny<StateExt, {}, StateExt> | ||
: {} | ||
: {} | ||
> | ||
: never | ||
/** | ||
@@ -110,0 +157,0 @@ * Helper type. Passes T out again, but boxes it in a way that it cannot |
import createNextState, { isDraftable } from 'immer' | ||
import type { Middleware } from 'redux' | ||
import type { Middleware, StoreEnhancer } from 'redux' | ||
@@ -73,4 +73,47 @@ export function getTimeMeasureUtils(maxDelay: number, fnName: string) { | ||
/** | ||
* @public | ||
*/ | ||
export class EnhancerArray< | ||
Enhancers extends StoreEnhancer<any, any>[] | ||
> extends Array<Enhancers[number]> { | ||
constructor(...items: Enhancers) | ||
constructor(...args: any[]) { | ||
super(...args) | ||
Object.setPrototypeOf(this, EnhancerArray.prototype) | ||
} | ||
static get [Symbol.species]() { | ||
return EnhancerArray as any | ||
} | ||
concat<AdditionalEnhancers extends ReadonlyArray<StoreEnhancer<any, any>>>( | ||
items: AdditionalEnhancers | ||
): EnhancerArray<[...Enhancers, ...AdditionalEnhancers]> | ||
concat<AdditionalEnhancers extends ReadonlyArray<StoreEnhancer<any, any>>>( | ||
...items: AdditionalEnhancers | ||
): EnhancerArray<[...Enhancers, ...AdditionalEnhancers]> | ||
concat(...arr: any[]) { | ||
return super.concat.apply(this, arr) | ||
} | ||
prepend<AdditionalEnhancers extends ReadonlyArray<StoreEnhancer<any, any>>>( | ||
items: AdditionalEnhancers | ||
): EnhancerArray<[...AdditionalEnhancers, ...Enhancers]> | ||
prepend<AdditionalEnhancers extends ReadonlyArray<StoreEnhancer<any, any>>>( | ||
...items: AdditionalEnhancers | ||
): EnhancerArray<[...AdditionalEnhancers, ...Enhancers]> | ||
prepend(...arr: any[]) { | ||
if (arr.length === 1 && Array.isArray(arr[0])) { | ||
return new EnhancerArray(...arr[0].concat(this)) | ||
} | ||
return new EnhancerArray(...arr.concat(this)) | ||
} | ||
} | ||
export function freezeDraftable<T>(val: T) { | ||
return isDraftable(val) ? createNextState(val, () => {}) : val | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13022973
291
97333
95
1
3
1
20
49
51
Updatedimmer@^9.0.21
Updatedredux@^4.2.1
Updatedreselect@^4.1.8