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F,EAASpL,GACtC,OAAOqL,EAAOvB,KAAK3F,MAAMkH,QAAQE,GAErCvE,OAAShH,IACLoG,EAAQoF,WAAWJ,EAASpL,IAEhC4G,IAAK,CAAC5G,EAAKa,KACP,MAAM4K,EAAO,IAAMrF,EAAQsF,QAAQN,EAASpL,EAAK8J,KAAKC,UAAUlJ,IAChE,IACI,OAAO4K,IAEX,MAAOxC,GACH,MAAM0C,EAAYzL,OAAO4H,QAAQ1B,GAC5BwF,QAAO,EAAE5L,KAASA,EAAIwI,WAAW4C,IAAWhF,EAAQkF,QAAQtL,KAC5D6L,KAAI,EAAE7L,EAAK8L,KAAS,CAAC9L,EAAK8J,KAAK3F,MAAM2H,MAE1C,IAAK,MAAOC,EAAalL,KAAU8K,EACX,WAAhB9K,EAAMyF,OAAsB8C,EAAUvI,KAAWsI,EAAStI,IAC1DuF,EAAQoF,WAAWO,GAI3B,IACI,OAAON,IAEX,MAAOO,GAGH,MAAMC,EAAcN,EAAU1B,MAAK,EAAE,CAAEiC,IAAU,CAAEC,MAAaD,EAAO/G,WAAa,IAAMgH,EAAOhH,WAAa,KAC9G,IAAK,MAAO4G,KAAgBE,EAAa,CACrC7F,EAAQoF,WAAWO,GACnB,IACI,OAAON,IAEX,MAAOO,MAMf5F,EAAQoF,WAAWJ,EAASpL,O,OC7CxCoM,QAAQnD,MAAM,uFACdmD,QAAQnD,MAAM,6D","sources":["webpack://AxiosCacheInterceptor/webpack/universalModuleDefinition","webpack://AxiosCacheInterceptor/webpack/bootstrap","webpack://AxiosCacheInterceptor/webpack/runtime/define property getters","webpack://AxiosCacheInterceptor/webpack/runtime/hasOwnProperty shorthand","webpack://AxiosCacheInterceptor/webpack/runtime/make namespace object","webpack://AxiosCacheInterceptor/./node_modules/cache-parser/dist/index.modern.js","webpack://AxiosCacheInterceptor/./src/header/headers.ts","webpack://AxiosCacheInterceptor/./src/header/interpreter.ts","webpack://AxiosCacheInterceptor/./node_modules/fast-defer/dist/index.modern.js","webpack://AxiosCacheInterceptor/./src/interceptors/util.ts","webpack://AxiosCacheInterceptor/./src/interceptors/request.ts","webpack://AxiosCacheInterceptor/./src/util/cache-predicate.ts","webpack://AxiosCacheInterceptor/./src/util/update-cache.ts","webpack://AxiosCacheInterceptor/./src/interceptors/response.ts","webpack://AxiosCacheInterceptor/./src/storage/build.ts","webpack://AxiosCacheInterceptor/./src/storage/memory.ts","webpack://AxiosCacheInterceptor/./node_modules/object-code/dist/index.modern.js","webpack://AxiosCacheInterceptor/./src/util/key-generator.ts","webpack://AxiosCacheInterceptor/./src/cache/create.ts","webpack://AxiosCacheInterceptor/./src/storage/web-api.ts","webpack://AxiosCacheInterceptor/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AxiosCacheInterceptor\"] = factory();\n\telse\n\t\troot[\"AxiosCacheInterceptor\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const e=Symbol(\"cache-parser\");function t(e){return(\"string\"==typeof e||\"number\"==typeof e)&&(e=Number(e))>=0&&e<Infinity}function a(e){return!0===e||\"number\"==typeof e||\"string\"==typeof e&&\"false\"!==e}const r=Number;function s(s){const n=Object.defineProperty({},e,{enumerable:!1,value:1});if(!s||\"string\"!=typeof s)return n;const o=function(e){const t={},a=e.toLowerCase().replace(/\\s+/g,\"\").split(\",\");for(const e in a){var r;const s=a[e].split(\"=\",2);t[s[0]]=null==(r=s[1])||r}return t}(s),i=o[\"max-age\"],u=o[\"max-stale\"],l=o[\"min-fresh\"],m=o[\"s-maxage\"],p=o[\"stale-if-error\"],c=o[\"stale-while-revalidate\"];return a(o.immutable)&&(n.immutable=!0),t(i)&&(n.maxAge=r(i)),t(u)&&(n.maxStale=r(u)),t(l)&&(n.minFresh=r(l)),a(o[\"must-revalidate\"])&&(n.mustRevalidate=!0),a(o[\"must-understand\"])&&(n.mustUnderstand=!0),a(o[\"no-cache\"])&&(n.noCache=!0),a(o[\"no-store\"])&&(n.noStore=!0),a(o[\"no-transform\"])&&(n.noTransform=!0),a(o[\"only-if-cached\"])&&(n.onlyIfCached=!0),a(o.private)&&(n.private=!0),a(o[\"proxy-revalidate\"])&&(n.proxyRevalidate=!0),a(o.public)&&(n.public=!0),t(m)&&(n.sMaxAge=r(m)),t(p)&&(n.staleIfError=r(p)),t(c)&&(n.staleWhileRevalidate=r(c)),n}function n(e){if(!e||\"object\"!=typeof e)return[];const r=[];return a(e.immutable)&&r.push(\"immutable\"),t(e.maxAge)&&r.push(`max-age=${e.maxAge}`),t(e.maxStale)&&r.push(`max-stale=${e.maxStale}`),t(e.minFresh)&&r.push(`min-fresh=${e.minFresh}`),a(e.mustRevalidate)&&r.push(\"must-revalidate\"),a(e.mustUnderstand)&&r.push(\"must-understand\"),a(e.noCache)&&r.push(\"no-cache\"),a(e.noStore)&&r.push(\"no-store\"),a(e.noTransform)&&r.push(\"no-transform\"),a(e.onlyIfCached)&&r.push(\"only-if-cached\"),a(e.private)&&r.push(\"private\"),a(e.proxyRevalidate)&&r.push(\"proxy-revalidate\"),a(e.public)&&r.push(\"public\"),t(e.sMaxAge)&&r.push(`s-maxage=${e.sMaxAge}`),t(e.staleIfError)&&r.push(`stale-if-error=${e.staleIfError}`),t(e.staleWhileRevalidate)&&r.push(`stale-while-revalidate=${e.staleWhileRevalidate}`),r}function o(t){return!!t&&!!t[e]}export{o as isCacheControl,s as parse,n as tokenize};\n//# sourceMappingURL=index.modern.js.map\n","export const Header = Object.freeze({\n    /**\n     * ```txt\n     * If-Modified-Since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since\n     */\n    IfModifiedSince: 'if-modified-since',\n    /**\n     * ```txt\n     * Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified\n     */\n    LastModified: 'last-modified',\n    /**\n     * ```txt\n     * If-None-Match: \"<etag_value>\"\n     * If-None-Match: \"<etag_value>\", \"<etag_value>\", …\n     * If-None-Match: *\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match\n     */\n    IfNoneMatch: 'if-none-match',\n    /**\n     * ```txt\n     * Cache-Control: max-age=604800\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control\n     */\n    CacheControl: 'cache-control',\n    /**\n     * ```txt\n     * ETag: W / '<etag_value>';\n     * ETag: '<etag_value>';\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag\n     */\n    ETag: 'etag',\n    /**\n     * ```txt\n     * Expires: <http-date>\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires\n     */\n    Expires: 'expires',\n    /**\n     * ```txt\n     * Age: <delta-seconds>\n     * ```\n     *\n     * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age\n     */\n    Age: 'age',\n    /**\n     * Used internally as metadata to mark the cache item as revalidatable and enabling\n     * stale cache state Contains a string of ASCII characters that can be used as ETag for\n     * `If-Match` header Provided by user using `cache.etag` value.\n     *\n     * ```txt\n     * X-Axios-Cache-Etag: \"<etag_value>\"\n     * ```\n     */\n    XAxiosCacheEtag: 'x-axios-cache-etag',\n    /**\n     * Used internally as metadata to mark the cache item as revalidatable and enabling\n     * stale cache state may contain `'use-cache-timestamp'` if `cache.modifiedSince` is\n     * `true`, otherwise will contain a date from `cache.modifiedSince`. If a date is\n     * provided, it can be used for `If-Modified-Since` header, otherwise the cache\n     * timestamp can be used for `If-Modified-Since` header.\n     *\n     * ```txt\n     * X-Axios-Cache-Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT\n     * X-Axios-Cache-Last-Modified: use-cache-timestamp\n     * ```\n     */\n    XAxiosCacheLastModified: 'x-axios-cache-last-modified',\n    /**\n     * Used internally as metadata to mark the cache item able to be used if the server\n     * returns an error. The stale-if-error response directive indicates that the cache can\n     * reuse a stale response when any error occurs.\n     *\n     * ```txt\n     * XAxiosCacheStaleIfError: <seconds>\n     * ```\n     */\n    XAxiosCacheStaleIfError: 'x-axios-cache-stale-if-error'\n});\n","import { parse } from 'cache-parser';\nimport { Header } from './headers';\nexport const defaultHeaderInterpreter = (headers) => {\n    if (!headers)\n        return 'not enough headers';\n    const cacheControl = headers[Header.CacheControl];\n    if (cacheControl) {\n        const { noCache, noStore, mustRevalidate, maxAge, immutable } = parse(String(cacheControl));\n        // Header told that this response should not be cached.\n        if (noCache || noStore) {\n            return 'dont cache';\n        }\n        if (immutable) {\n            // 1 year is sufficient, as Infinity may cause more problems.\n            // It might not be the best way, but a year is better than none.\n            return 1000 * 60 * 60 * 24 * 365;\n        }\n        // Already out of date, for cache can be saved, but must be requested again\n        if (mustRevalidate) {\n            return 0;\n        }\n        if (maxAge) {\n            const age = headers[Header.Age];\n            if (!age) {\n                return maxAge * 1000;\n            }\n            return (maxAge - Number(age)) * 1000;\n        }\n    }\n    const expires = headers[Header.Expires];\n    if (expires) {\n        const milliseconds = Date.parse(String(expires)) - Date.now();\n        return milliseconds >= 0 ? milliseconds : 'dont cache';\n    }\n    return 'not enough headers';\n};\n","const e=Symbol();function n(){let n,t;const o=new Promise((e,o)=>{n=e,t=o});return o.resolve=n,o.reject=t,o[e]=1,o}function t(n){return!!n&&!!n[e]}export{n as deferred,t as isDeferred};\n//# sourceMappingURL=index.modern.js.map\n","import { Header } from '../header/headers';\n/**\n * Creates a new validateStatus function that will use the one already used and also\n * accept status code 304.\n */\nexport function createValidateStatus(oldValidate) {\n    return oldValidate\n        ? (status) => oldValidate(status) || status === 304\n        : (status) => (status >= 200 && status < 300) || status === 304;\n}\n/** Checks if the given method is in the methods array */\nexport function isMethodIn(requestMethod = 'get', methodList = []) {\n    requestMethod = requestMethod.toLowerCase();\n    for (const method of methodList) {\n        if (method.toLowerCase() === requestMethod) {\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * This function updates the cache when the request is stale. So, the next request to the\n * server will be made with proper header / settings.\n */\nexport function updateStaleRequest(cache, config) {\n    config.headers || (config.headers = {});\n    const { etag, modifiedSince } = config.cache;\n    if (etag) {\n        const etagValue = etag === true ? cache.data?.headers[Header.ETag] : etag;\n        if (etagValue) {\n            config.headers[Header.IfNoneMatch] = etagValue;\n        }\n    }\n    if (modifiedSince) {\n        config.headers[Header.IfModifiedSince] =\n            modifiedSince === true\n                ? // If last-modified is not present, use the createdAt timestamp\n                    cache.data.headers[Header.LastModified] ||\n                        new Date(cache.createdAt).toUTCString()\n                : modifiedSince.toUTCString();\n    }\n}\n/**\n * Creates the new date to the cache by the provided response. Also handles possible 304\n * Not Modified by updating response properties.\n */\nexport function createCacheResponse(response, cache) {\n    if (response.status === 304 && cache) {\n        // Set the cache information into the response object\n        response.cached = true;\n        response.data = cache.data;\n        response.status = cache.status;\n        response.statusText = cache.statusText;\n        // Update possible new headers\n        response.headers = {\n            ...cache.headers,\n            ...response.headers\n        };\n        // return the old cache\n        return cache;\n    }\n    // New Response\n    return {\n        data: response.data,\n        status: response.status,\n        statusText: response.statusText,\n        headers: response.headers\n    };\n}\n","import { deferred } from 'fast-defer';\nimport { createValidateStatus, isMethodIn, updateStaleRequest } from './util';\nexport function defaultRequestInterceptor(axios) {\n    const onFulfilled = async (config) => {\n        if (config.cache === false) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    msg: 'Ignoring cache because config.cache is false',\n                    data: config\n                });\n            }\n            return config;\n        }\n        // merge defaults with per request configuration\n        config.cache = { ...axios.defaults.cache, ...config.cache };\n        if (!isMethodIn(config.method, config.cache.methods)) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    msg: `Ignored because method (${config.method}) is not in cache.methods (${config.cache.methods})`\n                });\n            }\n            return config;\n        }\n        const key = (config.id = axios.generateKey(config));\n        // Assumes that the storage handled staled responses\n        let cache = await axios.storage.get(key);\n        // Not cached, continue the request, and mark it as fetching\n        emptyOrStale: if (cache.state === 'empty' || cache.state === 'stale') {\n            /**\n             * This checks for simultaneous access to a new key. The js event loop jumps on the\n             * first await statement, so the second (asynchronous call) request may have already\n             * started executing.\n             */\n            if (axios.waiting[key]) {\n                cache = (await axios.storage.get(key));\n                if (__ACI_DEV__) {\n                    axios.debug?.({\n                        id: key,\n                        msg: 'Waiting list had an deferred for this key, waiting for it to finish'\n                    });\n                }\n                break emptyOrStale;\n            }\n            // Create a deferred to resolve other requests for the same key when it's completed\n            axios.waiting[key] = deferred();\n            /**\n             * Add a default reject handler to catch when the request is aborted without others\n             * waiting for it.\n             */\n            axios.waiting[key]?.catch(() => undefined);\n            await axios.storage.set(key, {\n                state: 'loading',\n                previous: cache.state,\n                // Eslint complains a lot :)\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n                data: cache.data,\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n                createdAt: cache.createdAt\n            });\n            if (cache.state === 'stale') {\n                updateStaleRequest(cache, config);\n                if (__ACI_DEV__) {\n                    axios.debug?.({\n                        id: key,\n                        msg: 'Updated stale request'\n                    });\n                }\n            }\n            config.validateStatus = createValidateStatus(config.validateStatus);\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    id: key,\n                    msg: 'Sending request, waiting for response'\n                });\n            }\n            return config;\n        }\n        let cachedResponse;\n        if (cache.state === 'loading') {\n            const deferred = axios.waiting[key];\n            // Just in case, the deferred doesn't exists.\n            /* istanbul ignore if 'really hard to test' */\n            if (!deferred) {\n                await axios.storage.remove(key);\n                return config;\n            }\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    id: key,\n                    msg: 'Detected concurrent request, waiting for it to finish'\n                });\n            }\n            try {\n                cachedResponse = await deferred;\n            }\n            catch (err) {\n                if (__ACI_DEV__) {\n                    axios.debug?.({\n                        id: key,\n                        msg: 'Deferred rejected, requesting again',\n                        data: err\n                    });\n                }\n                // The deferred is rejected when the request that we are waiting rejected cache.\n                return config;\n            }\n        }\n        else {\n            cachedResponse = cache.data;\n        }\n        // Even though the response interceptor receives this one from here,\n        // it has been configured to ignore cached responses = true\n        config.adapter = () => Promise.resolve({\n            config,\n            data: cachedResponse.data,\n            headers: cachedResponse.headers,\n            status: cachedResponse.status,\n            statusText: cachedResponse.statusText,\n            cached: true,\n            id: key\n        });\n        if (__ACI_DEV__) {\n            axios.debug?.({\n                id: key,\n                msg: 'Returning cached response'\n            });\n        }\n        return config;\n    };\n    return {\n        onFulfilled,\n        apply: () => axios.interceptors.request.use(onFulfilled)\n    };\n}\n","/** Tests an response against a {@link CachePredicateObject}. */\nexport async function testCachePredicate(response, predicate) {\n    if (typeof predicate === 'function') {\n        return predicate(response);\n    }\n    const { statusCheck, responseMatch, containsHeaders } = predicate;\n    if ((statusCheck && !(await statusCheck(response.status))) ||\n        (responseMatch && !(await responseMatch(response)))) {\n        return false;\n    }\n    if (containsHeaders) {\n        for (const header in containsHeaders) {\n            const predicate = containsHeaders[header];\n            if (predicate &&\n                !(await predicate(\n                // Axios uses lowercase headers, but if for some reason it doesn't, we should\n                // still be able to match.\n                response.headers[header.toLowerCase()] ?? response.headers[header]))) {\n                return false;\n            }\n        }\n    }\n    return true;\n}\n","/** Function to update all caches, from CacheProperties.update, with the new data. */\nexport async function updateCache(storage, data, entries) {\n    for (const cacheKey in entries) {\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        const value = entries[cacheKey];\n        if (value === 'delete') {\n            await storage.remove(cacheKey);\n            continue;\n        }\n        const oldValue = await storage.get(cacheKey);\n        if (oldValue.state === 'loading') {\n            continue;\n        }\n        const newValue = await value(oldValue, data);\n        if (newValue === 'delete') {\n            await storage.remove(cacheKey);\n            continue;\n        }\n        if (newValue === 'ignore') {\n            continue;\n        }\n        await storage.set(cacheKey, newValue);\n    }\n}\n","import { Header } from '../header/headers';\nimport { testCachePredicate } from '../util/cache-predicate';\nimport { updateCache } from '../util/update-cache';\nimport { createCacheResponse } from './util';\nexport function defaultResponseInterceptor(axios) {\n    /**\n     * Rejects cache for an response response.\n     *\n     * Also update the waiting list for this key by rejecting it.\n     */\n    const rejectResponse = async (responseId) => {\n        // Update the cache to empty to prevent infinite loading state\n        await axios.storage.remove(responseId);\n        // Reject the deferred if present\n        axios.waiting[responseId]?.reject(null);\n        delete axios.waiting[responseId];\n    };\n    const onFulfilled = async (response) => {\n        var _a;\n        response.id = (_a = response.config).id ?? (_a.id = axios.generateKey(response.config));\n        response.cached ?? (response.cached = false);\n        // Response is already cached\n        if (response.cached) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    id: response.id,\n                    msg: 'Returned cached response'\n                });\n            }\n            return response;\n        }\n        // Skip cache: either false or weird behavior\n        // config.cache should always exists, at least from global config merge.\n        if (!response.config.cache) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    id: response.id,\n                    msg: 'Response with config.cache === false',\n                    data: response\n                });\n            }\n            return { ...response, cached: false };\n        }\n        // Request interceptor merges defaults with per request configuration\n        const cacheConfig = response.config.cache;\n        const cache = await axios.storage.get(response.id);\n        if (\n        // If the request interceptor had a problem\n        cache.state === 'stale' ||\n            cache.state === 'empty' ||\n            // Should not hit here because of previous response.cached check\n            cache.state === 'cached') {\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    id: response.id,\n                    msg: 'Response not cached but storage is not loading',\n                    data: { cache, response }\n                });\n            }\n            return response;\n        }\n        // Config told that this response should be cached.\n        if (\n        // For 'loading' values (post stale), this check was already run in the past.\n        !cache.data &&\n            !(await testCachePredicate(response, cacheConfig.cachePredicate))) {\n            await rejectResponse(response.id);\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    id: response.id,\n                    msg: 'Cache predicate rejected this response'\n                });\n            }\n            return response;\n        }\n        // avoid remnant headers from remote server to break implementation\n        for (const header in Header) {\n            if (!header.startsWith('XAxiosCache')) {\n                continue;\n            }\n            delete response.headers[header];\n        }\n        if (cacheConfig.etag && cacheConfig.etag !== true) {\n            response.headers[Header.XAxiosCacheEtag] = cacheConfig.etag;\n        }\n        if (cacheConfig.modifiedSince) {\n            response.headers[Header.XAxiosCacheLastModified] =\n                cacheConfig.modifiedSince === true\n                    ? 'use-cache-timestamp'\n                    : cacheConfig.modifiedSince.toUTCString();\n        }\n        let ttl = cacheConfig.ttl || -1; // always set from global config\n        if (cacheConfig?.interpretHeader) {\n            const expirationTime = axios.headerInterpreter(response.headers);\n            // Cache should not be used\n            if (expirationTime === 'dont cache') {\n                await rejectResponse(response.id);\n                if (__ACI_DEV__) {\n                    axios.debug?.({\n                        id: response.id,\n                        msg: `Cache header interpreted as 'dont cache'`,\n                        data: {\n                            cache,\n                            response,\n                            expirationTime\n                        }\n                    });\n                }\n                return response;\n            }\n            ttl = expirationTime === 'not enough headers' ? ttl : expirationTime;\n        }\n        const data = createCacheResponse(response, cache.data);\n        if (typeof ttl === 'function') {\n            ttl = await ttl(response);\n        }\n        if (cacheConfig.staleIfError) {\n            response.headers[Header.XAxiosCacheStaleIfError] = String(ttl);\n        }\n        if (__ACI_DEV__) {\n            axios.debug?.({\n                id: response.id,\n                msg: 'Useful response configuration found',\n                data: { cacheConfig, ttl, cacheResponse: data }\n            });\n        }\n        // Update other entries before updating himself\n        if (cacheConfig?.update) {\n            await updateCache(axios.storage, response, cacheConfig.update);\n        }\n        const newCache = {\n            state: 'cached',\n            ttl,\n            createdAt: Date.now(),\n            data\n        };\n        // Resolve all other requests waiting for this response\n        const waiting = axios.waiting[response.id];\n        if (waiting) {\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            waiting.resolve(newCache.data);\n            delete axios.waiting[response.id];\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    id: response.id,\n                    msg: 'Found waiting deferred(s) and resolved them'\n                });\n            }\n        }\n        // Define this key as cache on the storage\n        await axios.storage.set(response.id, newCache);\n        if (__ACI_DEV__) {\n            axios.debug?.({\n                id: response.id,\n                msg: 'Response cached',\n                data: { cache: newCache, response }\n            });\n        }\n        // Return the response with cached as false, because it was not cached at all\n        return response;\n    };\n    const onRejected = async (error) => {\n        const config = error['config'];\n        if (!config || config.cache === false || !config.id) {\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    msg: 'Web request returned an error but cache handling is not enabled',\n                    data: { error, config }\n                });\n            }\n            throw error;\n        }\n        const cache = await axios.storage.get(config.id);\n        const cacheConfig = config.cache;\n        if (\n        // This will only not be loading if the interceptor broke\n        cache.state !== 'loading' ||\n            cache.previous !== 'stale') {\n            await rejectResponse(config.id);\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    msg: 'Caught an error in the request interceptor',\n                    data: { error, config }\n                });\n            }\n            throw error;\n        }\n        if (cacheConfig?.staleIfError) {\n            const staleIfError = typeof cacheConfig.staleIfError === 'function'\n                ? await cacheConfig.staleIfError(error.response, cache, error)\n                : cacheConfig.staleIfError;\n            if (__ACI_DEV__) {\n                axios.debug?.({\n                    msg: 'Found cache if stale config for rejected response',\n                    data: { error, config, staleIfError }\n                });\n            }\n            if (staleIfError === true ||\n                // staleIfError is the number of seconds that stale is allowed to be used\n                (typeof staleIfError === 'number' && cache.createdAt + staleIfError > Date.now())) {\n                // Resolve all other requests waiting for this response\n                axios.waiting[config.id]?.resolve(cache.data);\n                delete axios.waiting[config.id];\n                // re-mark the cache as stale\n                await axios.storage.set(config.id, {\n                    state: 'stale',\n                    createdAt: Date.now(),\n                    data: cache.data\n                });\n                if (__ACI_DEV__) {\n                    axios.debug?.({\n                        msg: 'staleIfError resolved this response with cached data',\n                        data: { error, config, cache }\n                    });\n                }\n                return {\n                    cached: true,\n                    config,\n                    id: config.id,\n                    data: cache.data.data,\n                    headers: cache.data.headers,\n                    status: cache.data.status,\n                    statusText: cache.data.statusText\n                };\n            }\n        }\n        if (__ACI_DEV__) {\n            axios.debug?.({\n                msg: 'Received an unknown error that could not be handled',\n                data: { error, config }\n            });\n        }\n        throw error;\n    };\n    return {\n        onFulfilled,\n        onRejected,\n        apply: () => axios.interceptors.response.use(onFulfilled, onRejected)\n    };\n}\n","import { Header } from '../header/headers';\nconst storage = Symbol();\n/** Returns true if the provided object was created from {@link buildStorage} function. */\nexport const isStorage = (obj) => !!obj && !!obj[storage];\n/** Returns true if this storage is expired, but it has sufficient properties to stale. */\nexport function canStale(value) {\n    const headers = value.data.headers;\n    return (Header.ETag in headers ||\n        Header.LastModified in headers ||\n        Header.XAxiosCacheEtag in headers ||\n        Header.XAxiosCacheStaleIfError in headers ||\n        Header.XAxiosCacheLastModified in headers);\n}\n/** Checks if the provided cache is expired. You should also check if the cache {@link canStale} */\nexport function isExpired(value) {\n    return value.createdAt + value.ttl <= Date.now();\n}\n/**\n * Builds a custom storage.\n *\n * **Note**: You can only create an custom storage with this function.\n *\n * @example\n *\n * ```js\n * const myStorage = buildStorage({\n *   find: () => {...},\n *   set: () => {...},\n *   remove: () => {...}\n * });\n *\n * const axios = setupCache(axios, { storage: myStorage });\n * ```\n */\nexport function buildStorage({ set, find, remove }) {\n    return {\n        //@ts-expect-error - we don't want to expose this\n        [storage]: 1,\n        set,\n        remove,\n        get: async (key) => {\n            const value = await find(key);\n            if (!value) {\n                return { state: 'empty' };\n            }\n            if (\n            // Not cached or fresh value\n            value.state !== 'cached' ||\n                !isExpired(value)) {\n                return value;\n            }\n            if (canStale(value)) {\n                const stale = {\n                    state: 'stale',\n                    createdAt: value.createdAt,\n                    data: value.data\n                };\n                await set(key, stale);\n                return stale;\n            }\n            await remove(key);\n            return { state: 'empty' };\n        }\n    };\n}\n","import { buildStorage } from './build';\n/**\n * Creates a simple in-memory storage. This means that if you need to persist data between\n * page or server reloads, this will not help.\n *\n * This is the storage used by default.\n *\n * If you need to modify it's data, you can do by the `data` property.\n *\n * @example\n *\n * ```js\n * const memoryStorage = buildMemoryStorage();\n *\n * setupCache(axios, { storage: memoryStorage });\n *\n * // Simple example to force delete the request cache\n *\n * const { id } = axios.get('url');\n *\n * delete memoryStorage.data[id];\n * ```\n */\nexport function buildMemoryStorage() {\n    const storage = buildStorage({\n        find: (key) => storage.data[key],\n        set: (key, value) => {\n            storage.data[key] = value;\n        },\n        remove: (key) => {\n            delete storage.data[key];\n        }\n    });\n    storage.data = Object.create(null);\n    return storage;\n}\n","function t(n){const r=typeof n;if(n&&\"object\"==r&&!(n instanceof Date||n instanceof RegExp)){const r=Array.isArray(n)?[]:{};for(const o in n)r[o]=t(n[o]);return`${n.constructor}${JSON.stringify(r,Object.keys(n).sort())}`}return`${r}${String(n)}`}function n(n){n=t(n);let r=5381,o=0;for(;o<n.length;)r=33*r^n.charCodeAt(o++);return r}export{n as hash,t as serialize};\n//# sourceMappingURL=index.modern.js.map\n","import { hash } from 'object-code';\n// Remove first and last '/' char, if present\nconst SLASHES_REGEX = /^\\/|\\/$/g;\nexport function buildKeyGenerator(shouldHash, generator) {\n    return (request) => {\n        if (request.id) {\n            return request.id;\n        }\n        // Remove trailing slashes\n        request.baseURL && (request.baseURL = request.baseURL.replace(SLASHES_REGEX, ''));\n        request.url && (request.url = request.url.replace(SLASHES_REGEX, ''));\n        // lowercase method\n        request.method && (request.method = request.method.toLowerCase());\n        const result = generator(request);\n        return shouldHash ? `${hash(result)}` : result;\n    };\n}\nexport const defaultKeyGenerator = buildKeyGenerator(true, ({ baseURL = '', url = '', method = 'get', params, data }) => {\n    return {\n        url: baseURL + (baseURL && url ? '/' : '') + url,\n        method,\n        params: params,\n        data\n    };\n});\n","import { defaultHeaderInterpreter } from '../header/interpreter';\nimport { defaultRequestInterceptor } from '../interceptors/request';\nimport { defaultResponseInterceptor } from '../interceptors/response';\nimport { isStorage } from '../storage/build';\nimport { buildMemoryStorage } from '../storage/memory';\nimport { defaultKeyGenerator } from '../util/key-generator';\n/**\n * Apply the caching interceptors for a already created axios instance.\n *\n * @example\n *\n * ```ts\n * import Axios from 'axios';\n * import { setupCache, AxiosCacheInstance } from 'axios-cache-interceptor';\n *\n * // instance will have our custom typings from the return of this function\n * const instance = setupCache(\n *   Axios.create({\n *     // Axios options\n *   }),\n *   {\n *     // Axios-cache-interceptor options\n *   }\n * );\n *\n * // OR\n *\n * const instance = axios.create({\n *   // Axios options\n * }) as AxiosCacheInstance;\n *\n * // As this functions returns the same axios instance but only with\n * // different typings, you can ignore the function return.\n * setupCache(instance, {\n *   // Axios-cache-interceptor options\n * });\n * ```\n *\n * @param axios The already created axios instance\n * @param config The config for the caching interceptors\n * @returns The same instance with extended typescript types.\n */\nexport function setupCache(axios, options = {}) {\n    const axiosCache = axios;\n    axiosCache.storage = options.storage || buildMemoryStorage();\n    if (!isStorage(axiosCache.storage)) {\n        throw new Error('Use buildStorage() function');\n    }\n    axiosCache.generateKey = options.generateKey || defaultKeyGenerator;\n    axiosCache.waiting = options.waiting || {};\n    axiosCache.headerInterpreter = options.headerInterpreter || defaultHeaderInterpreter;\n    axiosCache.requestInterceptor =\n        options.requestInterceptor || defaultRequestInterceptor(axiosCache);\n    axiosCache.responseInterceptor =\n        options.responseInterceptor || defaultResponseInterceptor(axiosCache);\n    axiosCache.debug = options.debug;\n    // CacheRequestConfig values\n    axiosCache.defaults.cache = {\n        ttl: options.ttl ?? 1000 * 60 * 5,\n        interpretHeader: options.interpretHeader ?? false,\n        methods: options.methods || ['get'],\n        cachePredicate: options.cachePredicate || {\n            statusCheck: (status) => status >= 200 && status < 400\n        },\n        etag: options.etag ?? false,\n        modifiedSince: options.modifiedSince ?? false,\n        staleIfError: options.staleIfError ?? false,\n        update: options.update || {}\n    };\n    // Apply interceptors\n    axiosCache.requestInterceptor.apply();\n    axiosCache.responseInterceptor.apply();\n    return axiosCache;\n}\n","import { buildStorage, canStale, isExpired } from './build';\n/**\n * Creates a simple storage. You can persist his data by using `sessionStorage` or\n * `localStorage` with it.\n *\n * **ImplNote**: Without polyfill, this storage only works on browser environments.\n *\n * @example\n *\n * ```js\n * const fromLocalStorage = buildWebStorage(localStorage);\n * const fromSessionStorage = buildWebStorage(sessionStorage);\n *\n * const myStorage = new Storage();\n * const fromMyStorage = buildWebStorage(myStorage);\n * ```\n *\n * @param storage The type of web storage to use. localStorage or sessionStorage.\n * @param prefix The prefix to index the storage. Useful to prevent collision between\n *   multiple places using the same storage.\n */\nexport function buildWebStorage(storage, prefix = '') {\n    return buildStorage({\n        find: (key) => {\n            const json = storage.getItem(prefix + key);\n            return json ? JSON.parse(json) : undefined;\n        },\n        remove: (key) => {\n            storage.removeItem(prefix + key);\n        },\n        set: (key, value) => {\n            const save = () => storage.setItem(prefix + key, JSON.stringify(value));\n            try {\n                return save();\n            }\n            catch (error) {\n                const allValues = Object.entries(storage)\n                    .filter(([key]) => key.startsWith(prefix) && storage.getItem(key))\n                    .map(([key, val]) => [key, JSON.parse(val)]);\n                // Remove all expired values\n                for (const [prefixedKey, value] of allValues) {\n                    if (value.state === 'cached' && isExpired(value) && !canStale(value)) {\n                        storage.removeItem(prefixedKey);\n                    }\n                }\n                // Try save again after removing expired values\n                try {\n                    return save();\n                }\n                catch (_) {\n                    // Storage still full, try removing the oldest value until it can be saved\n                    // Descending sort by createdAt\n                    const sortedItems = allValues.sort(([, valueA], [, valueB]) => (valueA.createdAt || 0) - (valueB.createdAt || 0));\n                    for (const [prefixedKey] of sortedItems) {\n                        storage.removeItem(prefixedKey);\n                        try {\n                            return save();\n                        }\n                        catch (_) {\n                            // This key didn't free all the required space\n                        }\n                    }\n                }\n                // Clear the cache for the specified key\n                storage.removeItem(prefix + key);\n            }\n        }\n    });\n}\n","export * from './cache/axios';\nexport * from './cache/cache';\nexport * from './cache/create';\nexport * from './header/headers';\nexport * from './header/interpreter';\nexport * from './header/types';\nexport * from './interceptors/build';\nexport * from './interceptors/request';\nexport * from './interceptors/response';\nexport * from './interceptors/util';\nexport * from './storage/build';\nexport * from './storage/memory';\nexport * from './storage/types';\nexport * from './storage/web-api';\nexport * from './util/cache-predicate';\nexport * from './util/key-generator';\nexport * from './util/types';\nexport * from './util/update-cache';\nif (__ACI_DEV__) {\n    console.error('You are using a development build. Make sure to use the correct build in production');\n    console.error('https://axios-cache-interceptor.js.org/#/pages/installing');\n}\n"],"names":["root","factory","exports","module","define","amd","self","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","e","t","Number","Infinity","a","r","Header","freeze","IfModifiedSince","LastModified","IfNoneMatch","CacheControl","ETag","Expires","Age","XAxiosCacheEtag","XAxiosCacheLastModified","XAxiosCacheStaleIfError","defaultHeaderInterpreter","headers","cacheControl","noCache","noStore","mustRevalidate","maxAge","immutable","s","n","toLowerCase","replace","split","i","u","l","m","p","c","maxStale","minFresh","mustUnderstand","noTransform","onlyIfCached","private","proxyRevalidate","public","sMaxAge","staleIfError","staleWhileRevalidate","String","age","expires","milliseconds","Date","parse","now","createValidateStatus","oldValidate","status","isMethodIn","requestMethod","methodList","method","updateStaleRequest","cache","config","etag","modifiedSince","etagValue","data","createdAt","toUTCString","createCacheResponse","response","cached","statusText","defaultRequestInterceptor","axios","onFulfilled","async","debug","msg","defaults","methods","id","generateKey","cachedResponse","storage","emptyOrStale","state","waiting","Promise","resolve","reject","catch","set","previous","validateStatus","deferred","remove","err","adapter","apply","interceptors","request","use","testCachePredicate","predicate","statusCheck","responseMatch","containsHeaders","header","updateCache","entries","cacheKey","oldValue","newValue","defaultResponseInterceptor","rejectResponse","responseId","_a","cacheConfig","cachePredicate","startsWith","ttl","interpretHeader","expirationTime","headerInterpreter","cacheResponse","update","newCache","onRejected","error","isStorage","canStale","isExpired","buildStorage","find","stale","buildMemoryStorage","create","RegExp","Array","isArray","constructor","JSON","stringify","keys","sort","length","charCodeAt","SLASHES_REGEX","buildKeyGenerator","shouldHash","generator","baseURL","url","result","defaultKeyGenerator","params","setupCache","options","axiosCache","Error","requestInterceptor","responseInterceptor","buildWebStorage","prefix","json","getItem","undefined","removeItem","save","setItem","allValues","filter","map","val","prefixedKey","_","sortedItems","valueA","valueB","console"],"sourceRoot":""}