forked from sindresorhus/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
6409-6018ad96302cef0c.js.download
33 lines (31 loc) · 20.2 KB
/
6409-6018ad96302cef0c.js.download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6409],{52527:function(e,t,n){"use strict";var r=n(63782);function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{noSSR:function(){return _noSSR},default:function(){return dynamic}});var o=n(43219),i=(n(2784),o._(n(63050)));function convertModule(e){return{default:(null==e?void 0:e.default)||e}}function _noSSR(e,t){return delete t.webpack,delete t.modules,e(t)}function dynamic(e,t){var n=i.default,r={loading:function(e){return e.error,e.isLoading,e.pastDelay,null}};e instanceof Promise?r.loader=function(){return e}:"function"==typeof e?r.loader=e:"object"==typeof e&&(r=_objectSpread(_objectSpread({},r),e));var o=(r=_objectSpread(_objectSpread({},r),t)).loader;return(r.loadableGenerated&&(r=_objectSpread(_objectSpread({},r),r.loadableGenerated),delete r.loadableGenerated),"boolean"!=typeof r.ssr||r.ssr)?n(_objectSpread(_objectSpread({},r),{},{loader:function(){return null!=o?o().then(convertModule):Promise.resolve(convertModule(function(){return null}))}})):(delete r.webpack,delete r.modules,_noSSR(n,r))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38694:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return r}});var r=n(43219)._(n(2784)).default.createContext(null)},63050:function(e,t,n){"use strict";/**
@copyright (c) 2017-present James Kyle <[email protected]>
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
*/var r=n(63782),o=n(22624),i=n(85458);function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return d}});var a=n(43219)._(n(2784)),u=n(38694),c=[],s=[],l=!1;function load(e){var t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then(function(e){return n.loading=!1,n.loaded=e,e}).catch(function(e){throw n.loading=!1,n.error=e,e}),n}var f=function(){function LoadableSubscription(e,t){o(this,LoadableSubscription),this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}return i(LoadableSubscription,[{key:"promise",value:function(){return this._res.promise}},{key:"retry",value:function(){var e=this;this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};var t=this._res,n=this._opts;t.loading&&("number"==typeof n.delay&&(0===n.delay?this._state.pastDelay=!0:this._delay=setTimeout(function(){e._update({pastDelay:!0})},n.delay)),"number"==typeof n.timeout&&(this._timeout=setTimeout(function(){e._update({timedOut:!0})},n.timeout))),this._res.promise.then(function(){e._update({}),e._clearTimeouts()}).catch(function(t){e._update({}),e._clearTimeouts()}),this._update({})}},{key:"_update",value:function(e){this._state=_objectSpread(_objectSpread({},this._state),{},{error:this._res.error,loaded:this._res.loaded,loading:this._res.loading},e),this._callbacks.forEach(function(e){return e()})}},{key:"_clearTimeouts",value:function(){clearTimeout(this._delay),clearTimeout(this._timeout)}},{key:"getCurrentValue",value:function(){return this._state}},{key:"subscribe",value:function(e){var t=this;return this._callbacks.add(e),function(){t._callbacks.delete(e)}}}]),LoadableSubscription}();function Loadable(e){return function(e,t){var n=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),r=null;function init(){if(!r){var t=new f(e,n);r={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return r.promise()}if(!l){var o=n.webpack?n.webpack():n.modules;o&&s.push(function(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(e,t)}}(e))){n&&(e=n);var r=0,F=function(){};return{s:F,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(o);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e.includes(r))return init()}}catch(e){n.e(e)}finally{n.f()}})}function LoadableComponent(e,t){init(),(o=a.default.useContext(u.LoadableContext))&&Array.isArray(n.modules)&&n.modules.forEach(function(e){o(e)});var o,i=a.default.useSyncExternalStore(r.subscribe,r.getCurrentValue,r.getCurrentValue);return a.default.useImperativeHandle(t,function(){return{retry:r.retry}},[]),a.default.useMemo(function(){var t;return i.loading||i.error?a.default.createElement(n.loading,{isLoading:i.loading,pastDelay:i.pastDelay,timedOut:i.timedOut,error:i.error,retry:r.retry}):i.loaded?a.default.createElement((t=i.loaded)&&t.default?t.default:t,e):null},[e,i])}return LoadableComponent.preload=function(){return init()},LoadableComponent.displayName="LoadableComponent",a.default.forwardRef(LoadableComponent)}(load,e)}function flushInitializers(e,t){for(var n=[];e.length;){var r=e.pop();n.push(r(t))}return Promise.all(n).then(function(){if(e.length)return flushInitializers(e,t)})}Loadable.preloadAll=function(){return new Promise(function(e,t){flushInitializers(c).then(e,t)})},Loadable.preloadReady=function(e){return void 0===e&&(e=[]),new Promise(function(t){var res=function(){return l=!0,t()};flushInitializers(s,e).then(res,res)})},window.__NEXT_PRELOADREADY=Loadable.preloadReady;var d=Loadable},25237:function(e,t,n){e.exports=n(52527)},20406:function(e,t,n){"use strict";function asyncGeneratorStep(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function _next(e){asyncGeneratorStep(i,r,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,r,o,_next,_throw,"throw",e)}_next(void 0)})}}n.d(t,{Z:function(){return _asyncToGenerator}})},49857:function(e,t,n){"use strict";n.d(t,{ZP:function(){return R}});var r,o=n(2784);/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function __awaiter(e,t,n,r){return new(n||(n=Promise))(function(o,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})}function __generator(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function verb(i){return function(u){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var noop=function(){},i=noop(),a=Object,isUndefined=function(e){return e===i},isFunction=function(e){return"function"==typeof e},mergeObjects=function(e,t){return a.assign({},e,t)},u="undefined",hasWindow=function(){return typeof window!=u},c=new WeakMap,s=0,stableHash=function(e){var t,n,r=typeof e,o=e&&e.constructor,i=o==Date;if(a(e)!==e||i||o==RegExp)t=i?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=c.get(e))return t;if(t=++s+"~",c.set(e,t),o==Array){for(n=0,t="@";n<e.length;n++)t+=stableHash(e[n])+",";c.set(e,t)}if(o==a){t="#";for(var u=a.keys(e).sort();!isUndefined(n=u.pop());)isUndefined(e[n])||(t+=n+":"+stableHash(e[n])+",");c.set(e,t)}}return t},l=!0,f=hasWindow(),d=typeof document!=u,p=f&&window.addEventListener?window.addEventListener.bind(window):noop,b=d?document.addEventListener.bind(document):noop,h=f&&window.removeEventListener?window.removeEventListener.bind(window):noop,v=d?document.removeEventListener.bind(document):noop,g={initFocus:function(e){return b("visibilitychange",e),p("focus",e),function(){v("visibilitychange",e),h("focus",e)}},initReconnect:function(e){var onOnline=function(){l=!0,e()},onOffline=function(){l=!1};return p("online",onOnline),p("offline",onOffline),function(){h("online",onOnline),h("offline",onOffline)}}},y=!hasWindow()||"Deno"in window,m=y?o.useEffect:o.useLayoutEffect,_="undefined"!=typeof navigator&&navigator.connection,w=!y&&_&&(["slow-2g","2g"].includes(_.effectiveType)||_.saveData),serialize=function(e){if(isFunction(e))try{e=e()}catch(t){e=""}var t=[].concat(e),n=(e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?stableHash(e):"")?"$swr$"+e:"";return[e,t,n]},O=new WeakMap,broadcastState=function(e,t,n,r,o,i,a){void 0===a&&(a=!0);var u=O.get(e),c=u[0],s=u[1],l=u[3],f=c[t],d=s[t];if(a&&d)for(var p=0;p<d.length;++p)d[p](n,r,o);return i&&(delete l[t],f&&f[0])?f[0](2).then(function(){return e.get(t)}):e.get(t)},S=0,getTimestamp=function(){return++S},internalMutate=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return __awaiter(void 0,void 0,void 0,function(){var t,n,r,o,a,u,c,s,l,f,d,p,b,h,v,g,y,m,_,w;return __generator(this,function(S){switch(S.label){case 0:if(t=e[0],n=e[1],r=e[2],u=!!isUndefined((a="boolean"==typeof(o=e[3])?{revalidate:o}:o||{}).populateCache)||a.populateCache,c=!1!==a.revalidate,s=!1!==a.rollbackOnError,l=a.optimisticData,d=(f=serialize(n))[0],p=f[2],!d)return[2];if(b=O.get(t)[2],e.length<3)return[2,broadcastState(t,d,t.get(d),i,i,c,!0)];if(h=r,g=getTimestamp(),b[d]=[g,0],y=!isUndefined(l),m=t.get(d),y&&(_=isFunction(l)?l(m):l,t.set(d,_),broadcastState(t,d,_)),isFunction(h))try{h=h(t.get(d))}catch(e){v=e}if(!(h&&isFunction(h.then)))return[3,2];return[4,h.catch(function(e){v=e})];case 1:if(h=S.sent(),g!==b[d][0]){if(v)throw v;return[2,h]}v&&y&&s&&(u=!0,h=m,t.set(d,m)),S.label=2;case 2:return u&&(v||(isFunction(u)&&(h=u(h,m)),t.set(d,h)),t.set(p,mergeObjects(t.get(p),{error:v}))),b[d][1]=getTimestamp(),[4,broadcastState(t,d,h,v,i,c,!!u)];case 3:if(w=S.sent(),v)throw v;return[2,u?w:h]}})})},revalidateAllKeys=function(e,t){for(var n in e)e[n][0]&&e[n][0](t)},initCache=function(e,t){if(!O.has(e)){var n=mergeObjects(g,t),r={},o=internalMutate.bind(i,e),a=noop;if(O.set(e,[r,{},{},{},o]),!y){var u=n.initFocus(setTimeout.bind(i,revalidateAllKeys.bind(i,r,0))),c=n.initReconnect(setTimeout.bind(i,revalidateAllKeys.bind(i,r,1)));a=function(){u&&u(),c&&c(),O.delete(e)}}return[e,o,a]}return[e,O.get(e)[4]]},j=initCache(new Map),C=j[0],k=mergeObjects({onLoadingSlow:noop,onSuccess:noop,onError:noop,onErrorRetry:function(e,t,n,r,o){var i=n.errorRetryCount,a=o.retryCount,u=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;(isUndefined(i)||!(a>i))&&setTimeout(r,u,o)},onDiscarded:noop,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:w?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:w?5e3:3e3,compare:function(e,t){return stableHash(e)==stableHash(t)},isPaused:function(){return!1},cache:C,mutate:j[1],fallback:{}},{isOnline:function(){return l},isVisible:function(){var e=d&&document.visibilityState;return isUndefined(e)||"hidden"!==e}}),mergeConfigs=function(e,t){var n=mergeObjects(e,t);if(t){var r=e.use,o=e.fallback,i=t.use,a=t.fallback;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=mergeObjects(o,a))}return n},P=(0,o.createContext)({}),useStateWithDeps=function(e,t){var n=(0,o.useState)({})[1],r=(0,o.useRef)(e),i=(0,o.useRef)({data:!1,error:!1,isValidating:!1}),a=(0,o.useCallback)(function(e){var o=!1,a=r.current;for(var u in e)a[u]!==e[u]&&(a[u]=e[u],i.current[u]&&(o=!0));o&&!t.current&&n({})},[]);return m(function(){r.current=e}),[r,i.current,a]},subscribeCallback=function(e,t,n){var r=t[e]||(t[e]=[]);return r.push(n),function(){var e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},E={dedupe:!0};a.defineProperty(function(e){var t=e.value,n=mergeConfigs((0,o.useContext)(P),t),r=t&&t.provider,a=(0,o.useState)(function(){return r?initCache(r(n.cache||C),t):i})[0];return a&&(n.cache=a[0],n.mutate=a[1]),m(function(){return a?a[2]:i},[]),(0,o.createElement)(P.Provider,mergeObjects(e,{value:n}))},"default",{value:k});var R=(r=function(e,t,n){var r=n.cache,a=n.compare,c=n.fallbackData,s=n.suspense,l=n.revalidateOnMount,f=n.refreshInterval,d=n.refreshWhenHidden,p=n.refreshWhenOffline,b=O.get(r),h=b[0],v=b[1],g=b[2],_=b[3],w=serialize(e),S=w[0],j=w[1],C=w[2],k=(0,o.useRef)(!1),P=(0,o.useRef)(!1),R=(0,o.useRef)(S),T=(0,o.useRef)(t),L=(0,o.useRef)(n),getConfig=function(){return L.current},isActive=function(){return getConfig().isVisible()&&getConfig().isOnline()},patchFetchInfo=function(e){return r.set(C,mergeObjects(r.get(C),e))},x=r.get(S),D=isUndefined(c)?n.fallback[S]:c,A=isUndefined(x)?D:x,I=r.get(C)||{},V=I.error,M=!k.current,shouldRevalidate=function(){return M&&!isUndefined(l)?l:!getConfig().isPaused()&&(s?!isUndefined(A)&&n.revalidateIfStale:isUndefined(A)||n.revalidateIfStale)},U=!!S&&!!t&&(!!I.isValidating||M&&shouldRevalidate()),W=useStateWithDeps({data:A,error:V,isValidating:U},P),G=W[0],K=W[1],H=W[2],z=(0,o.useCallback)(function(e){return __awaiter(void 0,void 0,void 0,function(){var t,o,u,c,s,l,f,d,p,b,h,v,y;return __generator(this,function(m){switch(m.label){case 0:if(t=T.current,!S||!t||P.current||getConfig().isPaused())return[2,!1];c=!0,s=e||{},l=!_[S]||!s.dedupe,f=function(){return!P.current&&S===R.current&&k.current},d=function(){var e=_[S];e&&e[1]===u&&delete _[S]},p={isValidating:!1},b=function(){patchFetchInfo({isValidating:!1}),f()&&H(p)},patchFetchInfo({isValidating:!0}),H({isValidating:!0}),m.label=1;case 1:return m.trys.push([1,3,,4]),l&&(broadcastState(r,S,G.current.data,G.current.error,!0),n.loadingTimeout&&!r.get(S)&&setTimeout(function(){c&&f()&&getConfig().onLoadingSlow(S,n)},n.loadingTimeout),_[S]=[t.apply(void 0,j),getTimestamp()]),o=(y=_[S])[0],u=y[1],[4,o];case 2:if(o=m.sent(),l&&setTimeout(d,n.dedupingInterval),!_[S]||_[S][1]!==u)return l&&f()&&getConfig().onDiscarded(S),[2,!1];if(patchFetchInfo({error:i}),p.error=i,!isUndefined(h=g[S])&&(u<=h[0]||u<=h[1]||0===h[1]))return b(),l&&f()&&getConfig().onDiscarded(S),[2,!1];return a(G.current.data,o)?p.data=G.current.data:p.data=o,a(r.get(S),o)||r.set(S,o),l&&f()&&getConfig().onSuccess(o,S,n),[3,4];case 3:return v=m.sent(),d(),!getConfig().isPaused()&&(patchFetchInfo({error:v}),p.error=v,l&&f()&&(getConfig().onError(v,S,n),("boolean"==typeof n.shouldRetryOnError&&n.shouldRetryOnError||isFunction(n.shouldRetryOnError)&&n.shouldRetryOnError(v))&&isActive()&&getConfig().onErrorRetry(v,S,n,z,{retryCount:(s.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return c=!1,b(),f()&&l&&broadcastState(r,S,p.data,p.error,!1),[2,!0]}})})},[S]),N=(0,o.useCallback)(internalMutate.bind(i,r,function(){return R.current}),[]);if(m(function(){T.current=t,L.current=n}),m(function(){if(S){var e=S!==R.current,t=z.bind(i,E),n=0,r=subscribeCallback(S,v,function(e,t,n){H(mergeObjects({error:t,isValidating:n},a(G.current.data,e)?i:{data:e}))}),o=subscribeCallback(S,h,function(e){if(0==e){var r=Date.now();getConfig().revalidateOnFocus&&r>n&&isActive()&&(n=r+getConfig().focusThrottleInterval,t())}else if(1==e)getConfig().revalidateOnReconnect&&isActive()&&t();else if(2==e)return z()});return P.current=!1,R.current=S,k.current=!0,e&&H({data:A,error:V,isValidating:U}),shouldRevalidate()&&(isUndefined(A)||y?t():hasWindow()&&typeof window.requestAnimationFrame!=u?window.requestAnimationFrame(t):setTimeout(t,1)),function(){P.current=!0,r(),o()}}},[S,z]),m(function(){var e;function next(){var t=isFunction(f)?f(A):f;t&&-1!==e&&(e=setTimeout(execute,t))}function execute(){!G.current.error&&(d||getConfig().isVisible())&&(p||getConfig().isOnline())?z(E).then(next):next()}return next(),function(){e&&(clearTimeout(e),e=-1)}},[f,d,p,z]),(0,o.useDebugValue)(A),s&&isUndefined(A)&&S)throw T.current=t,L.current=n,P.current=!1,isUndefined(V)?z(E):V;return{mutate:N,get data(){return K.data=!0,A},get error(){return K.error=!0,V},get isValidating(){return K.isValidating=!0,U}}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=mergeObjects(k,(0,o.useContext)(P)),i=isFunction(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],a=i[0],u=i[1],c=mergeConfigs(n,i[2]),s=r,l=c.use;if(l)for(var f=l.length;f-- >0;)s=l[f](s);return s(a,u||c.fetcher,c)})}}]);