UNPKG

55.3 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3 typeof define === 'function' && define.amd ? define(['exports'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.RTKQ = {}));
5}(this, (function (exports) { 'use strict';
6
7 exports.QueryStatus = void 0;var t,n=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])}}},r=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},i=Object.defineProperty,u=Object.defineProperties,a=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,f=function(e,t,n){return t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},l=function(e,t){for(var n in t||(t={}))c.call(t,n)&&f(e,n,t[n]);if(o)for(var r=0,i=o(t);r<i.length;r++)s.call(t,n=i[r])&&f(e,n,t[n]);return e},d=function(e,t){return u(e,a(t))},p=function(e,t){var n={};for(var r in e)c.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&o)for(var i=0,u=o(e);i<u.length;i++)t.indexOf(r=u[i])<0&&s.call(e,r)&&(n[r]=e[r]);return n},v=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());}))};(t=exports.QueryStatus||(exports.QueryStatus={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var h,y,m=function(e){return [].concat.apply([],e)};function g(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 b(e){return !!e&&!!e[ie]}function O(e){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)===ue}(e)||Array.isArray(e)||!!e[re]||!!e.constructor[re]||R(e)||x(e))}function w(e,t,n){void 0===n&&(n=!1),0===j(e)?(n?Object.keys:ae)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e);})):e.forEach((function(n,r){return t(r,n,e)}));}function j(e){var t=e[ie];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:R(e)?2:x(e)?3:0}function q(e,t){return 2===j(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function A(e,t){return 2===j(e)?e.get(t):e[t]}function P(e,t,n){var r=j(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n;}function S(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function R(e){return Z&&e instanceof Map}function x(e){return ee&&e instanceof Set}function I(e){return e.o||e.t}function T(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=oe(e);delete t[ie];for(var n=ae(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 C(e,t){return void 0===t&&(t=!1),E(e)||b(e)||!O(e)||(j(e)>1&&(e.set=e.add=e.clear=e.delete=k),Object.freeze(e),t&&w(e,(function(e,t){return C(t,!0)}),!0)),e}function k(){g(2);}function E(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function D(e){var t=ce[e];return t||g(18,e),t}function N(e,t){ce[e]||(ce[e]=t);}function Q(){return y}function M(e,t){t&&(D("Patches"),e.u=[],e.s=[],e.v=t);}function K(e){_(e),e.p.forEach(z),e.p=null;}function _(e){e===y&&(y=e.l);}function F(e){return y={p:[],l:y,h:e,m:!0,_:0}}function z(e){var t=e[ie];0===t.i||1===t.i?t.j():t.O=!0;}function U(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||D("ES5").S(t,e,r),r?(n[ie].P&&(K(t),g(4)),O(e)&&(e=L(t,e),t.l||B(t,e)),t.u&&D("Patches").M(n[ie],e,t.u,t.s)):e=L(t,n,[]),K(t),t.u&&t.v(t.u,t.s),e!==ne?e:void 0}function L(e,t,n){if(E(t))return t;var r=t[ie];if(!r)return w(t,(function(i,u){return W(e,r,t,i,u,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return B(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=T(r.k):r.o;w(3===r.i?new Set(i):i,(function(t,u){return W(e,r,i,t,u,n)})),B(e,i,!1),n&&e.u&&D("Patches").R(r,n,e.u,e.s);}return r.o}function W(e,t,n,r,i,u){if(b(i)){var a=L(e,i,u&&t&&3!==t.i&&!q(t.D,r)?u.concat(r):void 0);if(P(n,r,a),!b(a))return;e.m=!1;}if(O(i)&&!E(i)){if(!e.h.F&&e._<1)return;L(e,i),t&&t.A.l||B(e,i);}}function B(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&C(t,n);}function V(e,t){var n=e[ie];return (n?I(n):e)[t]}function H(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 J(e){e.P||(e.P=!0,e.l&&J(e.l));}function G(e){e.o||(e.o=T(e.t));}function $(e,t,n){var r=R(t)?D("MapSet").N(t,n):x(t)?D("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Q(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,u=se;n&&(i=[r],u=fe);var a=Proxy.revocable(i,u),o=a.revoke,c=a.proxy;return r.k=c,r.j=o,c}(t,n):D("ES5").J(t,n);return (n?n.A:Q()).p.push(r),r}function X(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return T(e)}var Y="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Z="undefined"!=typeof Map,ee="undefined"!=typeof Set,te="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,ne=Y?Symbol.for("immer-nothing"):((h={})["immer-nothing"]=!0,h),re=Y?Symbol.for("immer-draftable"):"__$immer_draftable",ie=Y?Symbol.for("immer-state"):"__$immer_state",ue=(""+Object.prototype.constructor),ae="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,oe=Object.getOwnPropertyDescriptors||function(e){var t={};return ae(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n);})),t},ce={},se={get:function(e,t){if(t===ie)return e;var n,r,i,u=I(e);if(!q(u,t))return n=e,(i=H(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||!O(a)?a:a===V(e.t,t)?(G(e),e.o[t]=$(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=H(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),u=null==i?void 0:i[ie];if(u&&u.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(S(n,i)&&(void 0!==n||q(e.t,t)))return !0;G(e),J(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!==V(e.t,t)||t in e.t?(e.D[t]=!1,G(e),J(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(){g(11);},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){g(12);}},fe={};w(se,(function(e,t){fe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};})),fe.deleteProperty=function(e,t){return se.deleteProperty.call(this,e[0],t)},fe.set=function(e,t,n){return se.set.call(this,e[0],t,n,e[0])};var le=new(function(){function e(e){var t=this;this.g=te,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&&g(6),void 0!==r&&"function"!=typeof r&&g(7),O(e)){var o=F(t),c=$(t,e,void 0),s=!0;try{a=n(c),s=!1;}finally{s?K(o):_(o);}return "undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return M(o,r),U(e,o)}),(function(e){throw K(o),e})):(M(o,r),U(a,o))}if(!e||"object"!=typeof e){if((a=n(e))===ne)return;return void 0===a&&(a=e),t.F&&C(a,!0),a}g(21,e);},this.produceWithPatches=function(e,n){return "function"==typeof e?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))}))}:[t.produce(e,n,(function(e,t){r=e,i=t;})),r,i];var 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){O(e)||g(8),b(e)&&(e=function(e){return b(e)||g(22,e),function e(t){if(!O(t))return t;var n,r=t[ie],i=j(t);if(r){if(!r.P&&(r.i<4||!D("ES5").K(r)))return r.t;r.I=!0,n=X(t,i),r.I=!1;}else n=X(t,i);return w(n,(function(t,i){r&&A(r.t,t)===i||P(n,t,e(i));})),3===i?new Set(n):n}(e)}(e));var t=F(this),n=$(this,e,void 0);return n[ie].C=!0,_(t),n},t.finishDraft=function(e,t){var n=(e&&e[ie]).A;return M(n,t),U(void 0,n)},t.setAutoFreeze=function(e){this.F=e;},t.setUseProxies=function(e){e&&!te&&g(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=D("Patches").$;return b(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}()),de=le.produce,pe=le.produceWithPatches.bind(le),ve=(le.setAutoFreeze.bind(le),le.setUseProxies.bind(le),le.applyPatches.bind(le)),he=(le.createDraft.bind(le),le.finishDraft.bind(le),de);function ye(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 me=function(){return Math.random().toString(36).substring(7).split("").join(".")},ge={INIT:"@@redux/INIT"+me(),REPLACE:"@@redux/REPLACE"+me(),PROBE_UNKNOWN_ACTION:function(){return "@@redux/PROBE_UNKNOWN_ACTION"+me()}};function be(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var Oe=function(e,t){return e===t};function we(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?Oe: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(we);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 Se(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 l(l({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 Re(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,i="function"==typeof e.initialState?e.initialState:he(e.initialState,(function(){})),u=e.reducers||{},a=Object.keys(u),o={},c={},s={};function f(){var t="function"==typeof e.extraReducers?Re(e.extraReducers):[e.extraReducers],n=t[0],u=t[1],a=void 0===u?[]:u,o=t[2],s=void 0===o?void 0:o,f=l(l({},void 0===n?{}:n),c);return function(e,t,n,i){void 0===n&&(n=[]);var u,a="function"==typeof t?Re(t):[t,n,i],o=a[0],c=a[1],s=a[2];if("function"==typeof e)u=function(){return he(e(),(function(){}))};else {var f=he(e,(function(){}));u=function(){return f};}function l(e,t){void 0===e&&(e=u());var n=r([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(b(e))return void 0===(r=n(e,t))?e:r;if(O(e))return he(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=u,l}(i,f,a,s)}return a.forEach((function(e){var n,r,i=u[e],a=t+"/"+e;"reducer"in i?(n=i.reducer,r=i.prepare):n=i,o[e]=n,c[a]=n,s[e]=r?Se(a,r):Se(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()}}}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},Te=["name","message","stack","code"],Ce=function(e,t){this.payload=e,this.meta=t;},ke=function(e,t){this.payload=e,this.meta=t;},Ee=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Te;n<r.length;n++){var i=r[n];"string"==typeof e[i]&&(t[i]=e[i]);}return t}return {message:String(e)}};function De(e,t,r){var i=Se(e+"/fulfilled",(function(e,t,n,r){return {payload:e,meta:d(l({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),u=Se(e+"/pending",(function(e,t,n){return {payload:void 0,meta:d(l({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),a=Se(e+"/rejected",(function(e,t,n,i,u){return {payload:i,error:(r&&r.serializeError||Ee)(e||"Rejected"),meta:d(l({},u||{}),{arg:n,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(){}};}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(c,s,f){var l,d=(null==r?void 0:r.idGenerator)?r.idGenerator(e):Ie(),p=new o,h=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:l||"Aborted"})}))})),y=!1,m=function(){return v(this,null,(function(){var o,l,v,m,g;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),null===(b=m=null==(o=null==r?void 0:r.condition)?void 0:o.call(r,e,{getState:s,extra:f}))||"object"!=typeof b||"function"!=typeof b.then?[3,2]:[4,m];case 1:m=n.sent(),n.label=2;case 2:if(!1===m)throw {name:"ConditionError",message:"Aborted due to condition callback returning false."};return y=!0,c(u(d,e,null==(l=null==r?void 0:r.getPendingMeta)?void 0:l.call(r,{requestId:d,arg:e},{getState:s,extra:f}))),[4,Promise.race([h,Promise.resolve(t(e,{dispatch:c,getState:s,extra:f,requestId:d,signal:p.signal,rejectWithValue:function(e,t){return new Ce(e,t)},fulfillWithValue:function(e,t){return new ke(e,t)}})).then((function(t){if(t instanceof Ce)throw t;return t instanceof ke?i(t.payload,d,e,t.meta):i(t,d,e)}))])];case 3:return v=n.sent(),[3,5];case 4:return g=n.sent(),v=g instanceof Ce?a(null,d,e,g.payload,g.meta):a(g,d,e),[3,5];case 5:return r&&!r.dispatchConditionRejection&&a.match(v)&&v.meta.condition||c(v),[2,v]}var b;}))}))}();return Object.assign(m,{abort:function(e){y&&(l=e,p.abort());},requestId:d,arg:e,unwrap:function(){return m.then(Ne)}})}}),{pending:u,rejected:a,fulfilled:i,typePrefix:e})}function Ne(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Qe=function(e,t){return (n=e)&&"function"==typeof n.match?e.match(t):e(t);var n;};function Me(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return Qe(e,t)}))}}function Ke(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.every((function(e){return Qe(e,t)}))}}function _e(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 Fe(e){return "function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ze(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return _e(e,["pending"])}:Fe(e)?function(t){var n=e.map((function(e){return e.pending}));return Me.apply(void 0,n)(t)}:ze()(e[0])}function Ue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return _e(e,["rejected"])}:Fe(e)?function(t){var n=e.map((function(e){return e.rejected}));return Me.apply(void 0,n)(t)}:Ue()(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||Fe(e)?function(t){return Ke(Ue.apply(void 0,e),n)(t)}:Le()(e[0])}function We(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return _e(e,["fulfilled"])}:Fe(e)?function(t){var n=e.map((function(e){return e.fulfilled}));return Me.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 _e(e,["pending","fulfilled","rejected"])}:Fe(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 Me.apply(void 0,n)(t)}:Be()(e[0])}!function(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){return se.get(this[ie],e)},set:function(t){se.set(this[ie],e,t);}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][ie];if(!i.P)switch(i.i){case 5:r(i)&&J(i);break;case 4:n(i)&&J(i);}}}function n(e){for(var t=e.t,n=e.k,r=ae(n),i=r.length-1;i>=0;i--){var u=r[i];if(u!==ie){var a=t[u];if(void 0===a&&!q(t,u))return !0;var o=n[u],c=o&&o[ie];if(c?c.t!==a:!S(o,a))return !0}}var s=!!t[ie];return r.length!==ae(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);return !(!n||n.get)}var i={};N("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=oe(n);delete u[ie];for(var a=ae(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:Q(),P:!1,I:!1,D:{},l:n,t:t,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,ie,{value:u,writable:!0}),i},S:function(e,n,i){i?b(n)&&n[ie].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[ie];if(n){var i=n.t,u=n.k,a=n.D,o=n.i;if(4===o)w(u,(function(t){t!==ie&&(void 0!==i[t]||q(i,t)?a[t]||e(u[t]):(a[t]=!0,J(n)));})),w(i,(function(e){void 0!==u[e]||q(u,e)||(a[e]=!1,J(n));}));else if(5===o){if(r(n)&&(J(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++)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 Ve=Pe;function He(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,u=Array.isArray(t)?[]:{},a=0,o=n;a<o.length;a++){var c=o[a];u[c]=He(e[c],t[c]),i&&(i=e[c]===u[c]);}return i?e:u}var Je=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},Ge=function(e){return e.status>=200&&e.status<=299},$e=function(e,t){return v(void 0,null,(function(){var r;return n(this,(function(n){switch(n.label){case 0:return "function"==typeof t?[2,t(e)]:"text"===t?[2,e.text()]:"json"!==t?[3,2]:[4,e.text()];case 1:return [2,(r=n.sent()).length?JSON.parse(r):null];case 2:return [2]}}))}))};function Xe(e){if(!Pe(e))return e;for(var t=l({},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 Ye(e){var t=this;void 0===e&&(e={});var r=e.baseUrl,i=e.prepareHeaders,u=void 0===i?function(e){return e}:i,a=e.fetchFn,o=void 0===a?Je:a,c=e.paramsSerializer,s=p(e,["baseUrl","prepareHeaders","fetchFn","paramsSerializer"]);return "undefined"==typeof fetch&&o===Je&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(e,i){return v(t,null,(function(){var t,a,f,v,h,y,m,g,b,O,w,j,q,A,P,S,R,x,I,T,C,k,E,D,N,Q,M,K,_,F,z,U,L,W,B,V;return n(this,(function(n){switch(n.label){case 0:return t=i.signal,a=i.getState,f=i.extra,v=i.endpoint,h=i.forced,y=i.type,b=(g="string"==typeof e?{url:e}:e).url,w=void 0===(O=g.method)?"GET":O,q=void 0===(j=g.headers)?new Headers({}):j,P=void 0===(A=g.body)?void 0:A,R=void 0===(S=g.params)?void 0:S,I=void 0===(x=g.responseHandler)?"json":x,C=void 0===(T=g.validateStatus)?Ge:T,k=p(g,["url","method","headers","body","params","responseHandler","validateStatus"]),E=l(d(l({},s),{method:w,signal:t,body:P}),k),D=E,[4,u(new Headers(Xe(q)),{getState:a,extra:f,endpoint:v,forced:h,type:y})];case 1:D.headers=n.sent(),N=function(e){return "object"==typeof e&&(Pe(e)||Array.isArray(e)||"function"==typeof e.toJSON)},!E.headers.has("content-type")&&N(P)&&E.headers.set("content-type","application/json"),P&&function(e){var t,n;return null==(n=null==(t=e.get("content-type"))?void 0:t.trim())?void 0:n.startsWith("application/json")}(E.headers)&&(E.body=JSON.stringify(P)),R&&(Q=~b.indexOf("?")?"&":"?",M=c?c(R):new URLSearchParams(Xe(R)),b+=Q+M),b=function(e,t){return e?t?function(e){return new RegExp("(^|:)//").test(e)}(t)?t:(e=function(e){return e.replace(/\/$/,"")}(e),e+"/"+(t=function(e){return e.replace(/^\//,"")}(t))):e:t}(r,b),K=new Request(b,E),_=K.clone(),m={request:_},n.label=2;case 2:return n.trys.push([2,4,,5]),[4,o(K)];case 3:return F=n.sent(),[3,5];case 4:return z=n.sent(),[2,{error:{status:"FETCH_ERROR",error:String(z)},meta:m}];case 5:U=F.clone(),m.response=U,W="",n.label=6;case 6:return n.trys.push([6,8,,9]),[4,Promise.all([$e(F,I).then((function(e){return L=e}),(function(e){return B=e})),U.text().then((function(e){return W=e}),(function(){}))])];case 7:if(n.sent(),B)throw B;return [3,9];case 8:return V=n.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:F.status,data:W,error:String(V)},meta:m}];case 9:return [2,C(F,L)?{data:L,meta:m}:{error:{status:F.status,data:L},meta:m}]}}))}))}}var Ze=function(e,t){void 0===t&&(t=void 0),this.value=e,this.meta=t;};function et(e,t){return void 0===e&&(e=0),void 0===t&&(t=5),v(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 tt,nt,rt=Object.assign((function(e,t){return function(r,i,u){return v(void 0,null,(function(){var a,o,c,s;return n(this,(function(n){switch(n.label){case 0:a=l(l({maxRetries:5,backoff:et},t),u),o=0,n.label=1;case 1:n.label=2;case 2:return n.trys.push([2,4,,6]),[4,e(r,i,u)];case 3:if((c=n.sent()).error)throw new Ze(c);return [2,c];case 4:if(s=n.sent(),o++,s.throwImmediately||o>a.maxRetries){if(s instanceof Ze)return [2,s.value];throw s}return [4,a.backoff(o,a.maxRetries)];case 5:return n.sent(),[3,6];case 6:return [3,1];case 7:return [2]}}))}))}}),{fail:function(e){throw Object.assign(new Ze({error:e}),{throwImmediately:!0})}}),it=Se("__rtkq/focused"),ut=Se("__rtkq/unfocused"),at=Se("__rtkq/online"),ot=Se("__rtkq/offline"),ct=!1;function st(e,t){return t?t(e,{onFocus:it,onFocusLost:ut,onOffline:ot,onOnline:at}):(n=function(){return e(it())},r=function(){return e(at())},i=function(){return e(ot())},u=function(){"visible"===window.document.visibilityState?n():e(ut());},ct||"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),ct=!0),function(){window.removeEventListener("focus",n),window.removeEventListener("visibilitychange",u),window.removeEventListener("online",r),window.removeEventListener("offline",i),ct=!1;});var n,r,i,u;}function ft(e,t,n,r,i,u){return "function"==typeof e?e(t,n,r,i).map(lt).map(u):Array.isArray(e)?e.map(lt).map(u):[]}function lt(e){return "string"==typeof e?{type:e}:e}function dt(e){return e}function pt(e,t,n,r){return ft(n[e.meta.arg.endpointName][t],We(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 vt(e,t,n){var r=e[t];r&&n(r);}function ht(e){var t;return null!=(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)?t:e.requestId}function yt(e,t,n){var r=e[ht(t)];r&&n(r);}(nt=tt||(tt={})).query="query",nt.mutation="mutation";var mt={},gt=Symbol.for("RTKQ/skipToken"),bt=gt,Ot={status:exports.QueryStatus.uninitialized},wt=he(Ot,(function(){})),jt=he(Ot,(function(){})),qt=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 At(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n=we((function(e){var n,r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:null!=(n=t.reducerPath)?n:"api"})})),i=d(l({reducerPath:"api",serializeQueryArgs:qt,keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{extractRehydrationInfo:n,tagTypes:r([],t.tagTypes||[])}),u={endpointDefinitions:{},batch:function(e){e();},apiUid:Ie(),extractRehydrationInfo:n,hasRehydrationInfo:we((function(e){return null!=n(e)}))},a={injectEndpoints:function(e){for(var t=e.endpoints({query:function(e){return d(l({},e),{type:tt.query})},mutation:function(e){return d(l({},e),{type:tt.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 u.endpointDefinitions)){u.endpointDefinitions[c]=s;for(var f=0,p=o;f<p.length;f++)p[f].injectEndpoint(c,s);}}return a},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,f=Object.entries(n);s<f.length;s++){var l=f[s],d=l[0],p=l[1];"function"==typeof p&&p(u.endpointDefinitions[d]),Object.assign(u.endpointDefinitions[d]||{},p);}return a}},o=e.map((function(e){return e.init(a,i,u)}));return a.injectEndpoints({endpoints:t.endpoints})}}function Pt(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var St=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=n.internalActions,u=i.removeQueryResult,a=i.unsubscribeQueryResult;return function(e){var i={};return function(u){return function(c){var s,f=u(c);if(a.match(c)){var l=e.getState()[t];o(O=c.payload.queryCacheKey,null==(s=l.queries[O])?void 0:s.endpointName,e,l.config);}if(n.util.resetApiState.match(c))for(var d=0,p=Object.entries(i);d<p.length;d++){var v=p[d],h=v[0],y=v[1];y&&clearTimeout(y),delete i[h];}if(r.hasRehydrationInfo(c)){l=e.getState()[t];for(var m=r.extractRehydrationInfo(c).queries,g=0,b=Object.entries(m);g<b.length;g++){var O,w=b[g],j=w[1];o(O=w[0],null==j?void 0:j.endpointName,e,l.config);}}return f}};function o(e,n,a,o){var c,s=r.endpointDefinitions[n],f=null!=(c=null==s?void 0:s.keepUnusedDataFor)?c:o.keepUnusedDataFor,l=i[e];l&&clearTimeout(l),i[e]=setTimeout((function(){var n=a.getState()[t].subscriptions[e];n&&0!==Object.keys(n).length||a.dispatch(u({queryCacheKey:e})),delete i[e];}),1e3*f);}}},Rt=function(t){var n=t.reducerPath,r=t.context,i=t.context.endpointDefinitions,u=t.mutationThunk,a=t.api,o=t.assertTagType,c=t.refetchQuery,s=a.internalActions.removeQueryResult;return function(e){return function(t){return function(n){var r=t(n);return Me(We(u),Le(u))(n)&&f(pt(n,"invalidatesTags",i,o),e),a.util.invalidateTags.match(n)&&f(ft(n.payload,void 0,void 0,void 0,void 0,o),e),r}}};function f(t,i){var u=i.getState(),o=u[n],f=a.util.selectInvalidatedBy(u,t);r.batch((function(){for(var t=0,n=Array.from(f.values());t<n.length;t++){var r=n[t].queryCacheKey,u=o.queries[r],a=o.subscriptions[r];u&&a&&(0===Object.keys(a).length?i.dispatch(s({queryCacheKey:r})):u.status!==exports.QueryStatus.uninitialized&&i.dispatch(c(u,r)));}}));}},xt=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.api,u=t.refetchQuery;return function(t){var o={};return function(e){return function(n){var u=e(n);return (i.internalActions.updateSubscriptionOptions.match(n)||i.internalActions.unsubscribeQueryResult.match(n))&&s(n.payload,t),(r.pending.match(n)||r.rejected.match(n)&&n.meta.condition)&&s(n.meta.arg,t),(r.fulfilled.match(n)||r.rejected.match(n)&&!n.meta.condition)&&c(n.meta.arg,t),i.util.resetApiState.match(n)&&function(){for(var e=0,t=Object.keys(o);e<t.length;e++)f(t[e]);}(),u}};function c(t,r){var i=t.queryCacheKey,c=r.getState()[n],s=c.queries[i];if(s&&s.status!==exports.QueryStatus.uninitialized){var f=a(c.subscriptions[i]);if(Number.isFinite(f)){var l=o[i];(null==l?void 0:l.timeout)&&(clearTimeout(l.timeout),l.timeout=void 0);var d=Date.now()+f,p=o[i]={nextPollTimestamp:d,pollingInterval:f,timeout:setTimeout((function(){p.timeout=void 0,r.dispatch(u(s,i));}),f)};}}}function s(t,r){var i=t.queryCacheKey,u=r.getState()[n],s=u.queries[i];if(s&&s.status!==exports.QueryStatus.uninitialized){var l=a(u.subscriptions[i]);if(Number.isFinite(l)){var d=o[i],p=Date.now()+l;(!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 a(e){void 0===e&&(e={});for(var t=Number.POSITIVE_INFINITY,n=0,r=Object.values(e);n<r.length;n++){var i=r[n];i.pollingInterval&&(t=Math.min(i.pollingInterval,t));}return t}},It=function(t){var n=t.reducerPath,r=t.context,i=t.refetchQuery,u=t.api.internalActions.removeQueryResult;return function(e){return function(t){return function(n){var r=t(n);return it.match(n)&&a(e,"refetchOnFocus"),at.match(n)&&a(e,"refetchOnReconnect"),r}}};function a(t,a){var o=t.getState()[n],c=o.queries,s=o.subscriptions;r.batch((function(){for(var n=0,r=Object.keys(s);n<r.length;n++){var f=r[n],l=c[f],d=s[f];d&&l&&(Object.values(d).some((function(e){return !0===e[a]}))||Object.values(d).every((function(e){return void 0===e[a]}))&&o.config[a])&&(0===Object.keys(d).length?t.dispatch(u({queryCacheKey:f})):l.status!==exports.QueryStatus.uninitialized&&t.dispatch(i(l,f)));}}));}},Tt=new Error("Promise never resolved before cacheEntryRemoved."),Ct=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,u=e.mutationThunk,a=Be(i),o=Be(u),c=We(i,u);return function(e){var s={};return function(r){return function(l){var d=e.getState(),p=r(l),v=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)?ht(e.payload):""}(l);if(i.pending.match(l)){var h=d[n].queries[v],y=e.getState()[n].queries[v];!h&&y&&f(l.meta.arg.endpointName,l.meta.arg.originalArgs,v,e,l.meta.requestId);}else if(u.pending.match(l))(y=e.getState()[n].mutations[v])&&f(l.meta.arg.endpointName,l.meta.arg.originalArgs,v,e,l.meta.requestId);else if(c(l))(null==(O=s[v])?void 0:O.valueResolved)&&(O.valueResolved({data:l.payload,meta:l.meta.baseQueryMeta}),delete O.valueResolved);else if(t.internalActions.removeQueryResult.match(l)||t.internalActions.removeMutationResult.match(l))(O=s[v])&&(delete s[v],O.cacheEntryRemoved());else if(t.util.resetApiState.match(l))for(var m=0,g=Object.entries(s);m<g.length;m++){var b=g[m],O=b[1];delete s[b[0]],O.cacheEntryRemoved();}return p}};function f(e,n,i,u,a){var o=r.endpointDefinitions[e],c=null==o?void 0:o.onCacheEntryAdded;if(c){var f={},p=new Promise((function(e){f.cacheEntryRemoved=e;})),v=Promise.race([new Promise((function(e){f.valueResolved=e;})),p.then((function(){throw Tt}))]);v.catch((function(){})),s[i]=f;var h=t.endpoints[e].select(o.type===tt.query?n:i),y=u.dispatch((function(e,t,n){return n})),m=d(l({},u),{getCacheEntry:function(){return h(u.getState())},requestId:a,extra:y,updateCachedData:o.type===tt.query?function(r){return u.dispatch(t.util.updateQueryData(e,n,r))}:void 0,cacheDataLoaded:v,cacheEntryRemoved:p}),g=c(n,m);Promise.resolve(g).catch((function(e){if(e!==Tt)throw e}));}}}},kt=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,u=ze(r,i),a=Ue(r,i),o=We(r,i);return function(e){var r={};return function(i){return function(c){var s,f,p,v=i(c);if(u(c)){var h=c.meta,y=h.requestId,m=h.arg,g=m.endpointName,b=m.originalArgs,O=n.endpointDefinitions[g],w=null==O?void 0:O.onQueryStarted;if(w){var j={},q=new Promise((function(e,t){j.resolve=e,j.reject=t;}));q.catch((function(){})),r[y]=j;var A=t.endpoints[g].select(O.type===tt.query?b:y),P=e.dispatch((function(e,t,n){return n})),S=d(l({},e),{getCacheEntry:function(){return A(e.getState())},requestId:y,extra:P,updateCachedData:O.type===tt.query?function(n){return e.dispatch(t.util.updateQueryData(g,b,n))}:void 0,queryFulfilled:q});w(b,S);}}else if(o(c)){var R=c.meta,x=R.baseQueryMeta;null==(s=r[y=R.requestId])||s.resolve({data:c.payload,meta:x}),delete r[y];}else if(a(c)){var I=c.meta;x=I.baseQueryMeta,null==(p=r[y=I.requestId])||p.reject({error:null!=(f=c.payload)?f:c.error,isUnhandledError:!I.rejectedWithValue,meta:x}),delete r[y];}return v}}}},Et=function(e){var t=e.api,n=e.context.apiUid;return function(e){var r=!1;return function(i){return function(u){r||(r=!0,e.dispatch(t.internalActions.middlewareRegistered(n)));var a=i(u);return t.util.resetApiState.match(u)&&e.dispatch(t.internalActions.middlewareRegistered(n)),a}}}};function Dt(e){var t=e.reducerPath,n=e.queryThunk,r={invalidateTags:Se(t+"/invalidateTags")},i=[Et,St,Rt,xt,It,Ct,kt].map((function(t){return t(d(l({},e),{refetchQuery:u}))}));return {middleware:function(e){return function(n){var r=be.apply(void 0,i.map((function(t){return t(e)})))(n);return function(i){return e.getState()[t]?r(i):n(i)}}},actions:r};function u(e,t,r){return void 0===r&&(r={}),n(l({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},r))}}function Nt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,r([e],t));}var Qt=Symbol(),Mt=function(){return {name:Qt,init:function(t,i,u){var a=i.baseQuery,o=i.reducerPath,c=i.serializeQueryArgs,s=i.keepUnusedDataFor,f=i.refetchOnMountOrArgChange,p=i.refetchOnFocus,h=i.refetchOnReconnect;!function(){function e(t){if(!O(t))return t;if(Array.isArray(t))return t.map(e);if(R(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 q(t,re)&&(n[re]=t[re]),n}function t(t){return b(t)?e(t):t}var n="add";N("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=j(a),s=""+i[o];0!==c&&1!==c||"__proto__"!==s&&"constructor"!==s||g(24),"function"==typeof a&&"prototype"===s&&g(24),"object"!=typeof(a=A(a,s))&&g(15,i.join("/"));}var f=j(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:g(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:g(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 w(a.D,(function(e,r){var i=A(f,e),u=A(l,e),a=r?q(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===ne?void 0:t}),r.push({op:"replace",path:[],value:e.t});}});}();var y=function(e){return e};Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:at,onOffline:ot,onFocus:it,onFocusLost:ut},util:{}});var P=function(t){var r=this,i=t.reducerPath,u=t.baseQuery,a=t.context.endpointDefinitions,o=t.serializeQueryArgs,c=t.api,s=function(e,t){return v(r,[e,t],(function(e,t){var r,i,o,c,s,l,d=t.signal,p=t.rejectWithValue,v=t.fulfillWithValue,h=t.dispatch,y=t.getState,m=t.extra;return n(this,(function(t){switch(t.label){case 0:r=a[e.endpointName],t.label=1;case 1:return t.trys.push([1,7,,8]),i=dt,o=void 0,c={signal:d,dispatch:h,getState:y,extra:m,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?f(e,y()):void 0},r.query?[4,u(r.query(e.originalArgs),c,r.extraOptions)]:[3,3];case 2:return o=t.sent(),r.transformResponse&&(i=r.transformResponse),[3,5];case 3:return [4,r.queryFn(e.originalArgs,c,r.extraOptions,(function(e){return u(e,c,r.extraOptions)}))];case 4:o=t.sent(),t.label=5;case 5:if(o.error)throw new Ze(o.error,o.meta);return s=v,[4,i(o.data,o.meta,e.originalArgs)];case 6:return [2,s.apply(void 0,[t.sent(),{fulfilledTimeStamp:Date.now(),baseQueryMeta:o.meta}])];case 7:if((l=t.sent())instanceof Ze)return [2,p(l.value,{baseQueryMeta:l.meta})];throw console.error(l),l;case 8:return [2]}}))}))};function f(e,t){var n,r,u,a,o=null==(r=null==(n=t[i])?void 0:n.queries)?void 0:r[e.queryCacheKey],c=null==(u=t[i])?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=De(i+"/executeQuery",s,{getPendingMeta:function(){return {startedTimeStamp:Date.now()}},condition:function(e,t){var n,r,u=(0, t.getState)(),a=null==(r=null==(n=u[i])?void 0:n.queries)?void 0:r[e.queryCacheKey],o=null==a?void 0:a.fulfilledTimeStamp;return !("pending"===(null==a?void 0:a.status)||!f(e,u)&&o)},dispatchConditionRejection:!0});function d(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:De(i+"/executeMutation",s,{getPendingMeta:function(){return {startedTimeStamp:Date.now()}}}),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(t,n,r){return function(i,u){var a,o,s=c.endpoints[t].select(n)(u()),f={patches:[],inversePatches:[],undo:function(){return i(c.util.patchQueryData(t,n,f.inversePatches))}};if(s.status===exports.QueryStatus.uninitialized)return f;if("data"in s)if(O(s.data)){var l=pe(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(t,n,f.patches)),f}},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:Ke(ze(e),d(t)),matchFulfilled:Ke(We(e),d(t)),matchRejected:Ke(Ue(e),d(t))}}}}({baseQuery:a,reducerPath:o,context:u,api:t,serializeQueryArgs:c}),S=P.queryThunk,I=P.mutationThunk,T=P.patchQueryData,C=P.updateQueryData,k=P.prefetch,E=P.buildMatchThunkActions,D=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.mutationThunk,u=t.context,a=u.endpointDefinitions,o=u.apiUid,c=u.extractRehydrationInfo,s=u.hasRehydrationInfo,f=t.assertTagType,p=t.config,v=Se(n+"/resetApiState"),h=xe({name:n+"/queries",initialState:mt,reducers:{removeQueryResult:function(e,t){delete e[t.payload.queryCacheKey];},queryResultPatched:function(e,t){var n=t.payload,r=n.patches;vt(e,n.queryCacheKey,(function(e){e.data=ve(e.data,r.concat());}));}},extraReducers:function(t){t.addCase(r.pending,(function(t,n){var r,i=n.meta,u=n.meta.arg;u.subscribe&&(null!=t[r=u.queryCacheKey]||(t[r]={status:exports.QueryStatus.uninitialized,endpointName:u.endpointName})),vt(t,u.queryCacheKey,(function(t){t.status=exports.QueryStatus.pending,t.requestId=i.requestId,void 0!==u.originalArgs&&(t.originalArgs=u.originalArgs),t.startedTimeStamp=i.startedTimeStamp;}));})).addCase(r.fulfilled,(function(t,n){var r=n.meta,i=n.payload;vt(t,r.arg.queryCacheKey,(function(t){var n;t.requestId===r.requestId&&(t.status=exports.QueryStatus.fulfilled,t.data=null==(n=a[r.arg.endpointName].structuralSharing)||n?He(t.data,i):i,delete t.error,t.fulfilledTimeStamp=r.fulfilledTimeStamp);}));})).addCase(r.rejected,(function(t,n){var r=n.meta,i=r.condition,u=r.requestId,a=n.error,o=n.payload;vt(t,r.arg.queryCacheKey,(function(t){if(i);else {if(t.requestId!==u)return;t.status=exports.QueryStatus.rejected,t.error=null!=o?o:a;}}));})).addMatcher(s,(function(t,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||(t[a[0]]=o);}}));}}),y=xe({name:n+"/mutations",initialState:mt,reducers:{removeMutationResult:function(e,t){var n=ht(t.payload);n in e&&delete e[n];}},extraReducers:function(t){t.addCase(i.pending,(function(t,n){var r=n.meta,i=r.requestId,u=r.arg,a=r.startedTimeStamp;u.track&&(t[ht(n.meta)]={requestId:i,status:exports.QueryStatus.pending,endpointName:u.endpointName,startedTimeStamp:a});})).addCase(i.fulfilled,(function(t,n){var r=n.payload,i=n.meta;i.arg.track&&yt(t,i,(function(t){t.requestId===i.requestId&&(t.status=exports.QueryStatus.fulfilled,t.data=r,t.fulfilledTimeStamp=i.fulfilledTimeStamp);}));})).addCase(i.rejected,(function(t,n){var r=n.payload,i=n.error,u=n.meta;u.arg.track&&yt(t,u,(function(t){t.requestId===u.requestId&&(t.status=exports.QueryStatus.rejected,t.error=null!=r?r:i);}));})).addMatcher(s,(function(t,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)||(t[o]=s);}}));}}),m=xe({name:n+"/invalidation",initialState:mt,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],m=null!=(u=(r=null!=(n=e[l])?n:e[l]={})[i=h||"__internal_without_id"])?u:r[i]=[],g=0,b=y;g<b.length;g++){var O=b[g];m.includes(O)||m.push(O);}})).addMatcher(Me(We(r),Le(r)),(function(e,t){for(var n,r,i,u,o=pt(t,"providesTags",a,f),c=t.meta.arg.queryCacheKey,s=0,l=o;s<l.length;s++){var d=l[s],p=d.type,v=d.id,h=null!=(u=(r=null!=(n=e[p])?n:e[p]={})[i=v||"__internal_without_id"])?u:r[i]=[];h.includes(c)||h.push(c);}}));}}),g=xe({name:n+"/subscriptions",initialState:mt,reducers:{updateSubscriptionOptions:function(e,t){var n,r=t.payload,i=r.queryCacheKey,u=r.requestId;(null==(n=null==e?void 0:e[i])?void 0:n[u])&&(e[i][u]=r.options);},unsubscribeQueryResult:function(e,t){var n=t.payload,r=n.queryCacheKey;e[r]&&delete e[r][n.requestId];}},extraReducers:function(e){e.addCase(h.actions.removeQueryResult,(function(e,t){delete e[t.payload.queryCacheKey];})).addCase(r.pending,(function(e,t){var n,r,i,u,a=t.meta,o=a.arg,c=a.requestId;if(o.subscribe){var s=null!=(r=e[n=o.queryCacheKey])?r:e[n]={};s[c]=null!=(u=null!=(i=o.subscriptionOptions)?i:s[c])?u:{};}})).addCase(r.rejected,(function(e,t){var n,r,i,u,a=t.meta,o=a.arg,c=a.requestId;if(a.condition&&o.subscribe){var s=null!=(r=e[n=o.queryCacheKey])?r:e[n]={};s[c]=null!=(u=null!=(i=o.subscriptionOptions)?i:s[c])?u:{};}})).addMatcher(s,(function(e){return l({},e)}));}}),b=xe({name:n+"/config",initialState:l({online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1},p),reducers:{middlewareRegistered:function(e,t){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&o===t.payload||"conflict";}},extraReducers:function(e){e.addCase(at,(function(e){e.online=!0;})).addCase(ot,(function(e){e.online=!1;})).addCase(it,(function(e){e.focused=!0;})).addCase(ut,(function(e){e.focused=!1;})).addMatcher(s,(function(e){return l({},e)}));}}),O=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:ge.INIT}))throw new Error(ye(12));if(void 0===n(void 0,{type:ge.PROBE_UNKNOWN_ACTION()}))throw new Error(ye(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(ye(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:m.reducer,subscriptions:g.reducer,config:b.reducer});return {reducer:function(e,t){return O(v.match(t)?void 0:e,t)},actions:d(l(l(l(l({},b.actions),h.actions),g.actions),y.actions),{unsubscribeMutationResult:y.actions.removeMutationResult,resetApiState:v})}}({context:u,queryThunk:S,mutationThunk:I,reducerPath:o,assertTagType:y,config:{refetchOnFocus:p,refetchOnReconnect:h,refetchOnMountOrArgChange:f,keepUnusedDataFor:s,reducerPath:o}}),Q=D.reducer,M=D.actions;Nt(t.util,{patchQueryData:T,updateQueryData:C,prefetch:k,resetApiState:M.resetApiState}),Nt(t.internalActions,M),Object.defineProperty(t.util,"updateQueryResult",{get:function(){return t.util.updateQueryData}}),Object.defineProperty(t.util,"patchQueryResult",{get:function(){return t.util.patchQueryData}});var K=Dt({reducerPath:o,context:u,queryThunk:S,mutationThunk:I,api:t,assertTagType:y}),_=K.middleware;Nt(t.util,K.actions),Nt(t,{reducer:Q,middleware:_});var F=function(t){var n=t.serializeQueryArgs,r=t.reducerPath;return {buildQuerySelector:function(e,t){return function(r){var a=Ae(u,(function(i){var u,a;return null!=(a=r===gt||null==(u=null==i?void 0:i.queries)?void 0:u[n({queryArgs:r,endpointDefinition:t,endpointName:e})])?a:wt}));return Ae(a,i)}},buildMutationSelector:function(){return function(e){var t,n;n="object"==typeof e?null!=(t=ht(e))?t:gt:e;var r=Ae(u,(function(e){var t,r;return null!=(r=n===gt||null==(t=null==e?void 0:e.mutations)?void 0:t[n])?r:jt}));return Ae(r,i)}},selectInvalidatedBy:function(e,t){for(var n,i=e[r],u=new Set,a=0,o=t.map(lt);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]:m(Object.values(s)))?n:[];f<l.length;f++)u.add(l[f]);}return m(Array.from(u.values()).map((function(e){var t=i.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))}};function i(t){return l(l({},t),{status:n=t.status,isUninitialized:n===exports.QueryStatus.uninitialized,isLoading:n===exports.QueryStatus.pending,isSuccess:n===exports.QueryStatus.fulfilled,isError:n===exports.QueryStatus.rejected});var n;}function u(e){return e[r]}}({serializeQueryArgs:c,reducerPath:o}),z=F.buildQuerySelector,U=F.buildMutationSelector;Nt(t.util,{selectInvalidatedBy:F.selectInvalidatedBy});var L=function(e){var t=e.serializeQueryArgs,i=e.queryThunk,u=e.mutationThunk,a=e.api,o=e.context,c={},s={},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,h=void 0===d||d,y=f.forceRefetch,m=f.subscriptionOptions;return function(s,f){var d=t({queryArgs:o,endpointDefinition:r,endpointName:e}),g=i({type:"query",subscribe:h,forceRefetch:y,subscriptionOptions:m,endpointName:e,originalArgs:o,queryCacheKey:d}),b=s(g),O=b.requestId,w=b.abort,j=Object.assign(Promise.all([c[d],b]).then((function(){return a.endpoints[e].select(o)(f())})),{arg:o,requestId:O,subscriptionOptions:m,queryCacheKey:d,abort:w,unwrap:function(){return v(this,null,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return [4,j];case 1:if((e=t.sent()).isError)throw e.error;return [2,e.data]}}))}))},refetch:function(){s(u(o,{subscribe:!1,forceRefetch:!0}));},unsubscribe:function(){h&&s(l({queryCacheKey:d,requestId:O}));},updateSubscriptionOptions:function(t){j.subscriptionOptions=t,s(p({endpointName:e,requestId:O,queryCacheKey:d,options:t}));}});return c[d]||(c[d]=j,j.then((function(){delete c[d];}))),j}};return u},buildInitiateMutation:function(e){return function(t,n){var r=void 0===n?{}:n,i=r.track,a=void 0===i||i,o=r.fixedCacheKey;return function(n,r){var i=u({type:"mutation",endpointName:e,originalArgs:t,track:a,fixedCacheKey:o}),c=n(i),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});return s[f]=y,y.then((function(){delete s[f];})),o&&(s[o]=y,y.then((function(){s[o]===y&&delete s[o];}))),y}}},getRunningOperationPromises:function(){return r(r([],Object.values(c)),Object.values(s)).filter((function(e){return !!e}))},getRunningOperationPromise:function(e,n){var r=o.endpointDefinitions[e];if(r.type===tt.query){var i=t({queryArgs:n,endpointDefinition:r,endpointName:e});return c[i]}return s[n]}}}({queryThunk:S,mutationThunk:I,api:t,serializeQueryArgs:c,context:u}),W=L.buildInitiateQuery,B=L.buildInitiateMutation;return Nt(t.util,{getRunningOperationPromises:L.getRunningOperationPromises,getRunningOperationPromise:L.getRunningOperationPromise}),{name:Qt,injectEndpoint:function(e,n){var r,i=t;null!=(r=i.endpoints)[e]||(r[e]={}),n.type===tt.query?Nt(i.endpoints[e],{select:z(e,n),initiate:W(e,n)},E(S,e)):n.type===tt.mutation&&Nt(i.endpoints[e],{select:U(),initiate:B(e)},E(I,e));}}}}},Kt=At(Mt());
8
9 exports.buildCreateApi = At;
10 exports.copyWithStructuralSharing = He;
11 exports.coreModule = Mt;
12 exports.createApi = Kt;
13 exports.fakeBaseQuery = Pt;
14 exports.fetchBaseQuery = Ye;
15 exports.retry = rt;
16 exports.setupListeners = st;
17 exports.skipSelector = bt;
18 exports.skipToken = gt;
19
20 Object.defineProperty(exports, '__esModule', { value: true });
21
22})));
23//# sourceMappingURL=rtk-query.umd.min.js.map