hexo/workbox-ba6c455d.js.map

1 line
144 KiB
Plaintext

{"version":3,"file":"workbox-ba6c455d.js","sources":["node_modules/workbox-core/_version.js","node_modules/workbox-core/_private/logger.js","node_modules/workbox-core/models/messages/messageGenerator.js","node_modules/workbox-core/_private/WorkboxError.js","node_modules/workbox-routing/_version.js","node_modules/workbox-routing/utils/constants.js","node_modules/workbox-routing/utils/normalizeHandler.js","node_modules/workbox-routing/Route.js","node_modules/workbox-routing/RegExpRoute.js","node_modules/workbox-routing/Router.js","node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","node_modules/workbox-routing/registerRoute.js","node_modules/workbox-core/_private/cacheNames.js","node_modules/workbox-core/_private/cacheMatchIgnoreParams.js","node_modules/workbox-core/_private/Deferred.js","node_modules/workbox-core/models/quotaErrorCallbacks.js","node_modules/workbox-strategies/_version.js","node_modules/workbox-strategies/StrategyHandler.js","node_modules/workbox-core/_private/timeout.js","node_modules/workbox-core/_private/getFriendlyURL.js","node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","node_modules/workbox-strategies/Strategy.js","node_modules/workbox-core/_private/waitUntil.js","node_modules/workbox-precaching/_version.js","node_modules/workbox-precaching/utils/createCacheKey.js","node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js","node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js","node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","node_modules/workbox-core/copyResponse.js","node_modules/workbox-precaching/PrecacheStrategy.js","node_modules/workbox-precaching/PrecacheController.js","node_modules/workbox-precaching/PrecacheRoute.js","node_modules/workbox-precaching/utils/generateURLVariations.js","node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","node_modules/workbox-strategies/CacheFirst.js","node_modules/workbox-core/clientsClaim.js","node_modules/workbox-precaching/precacheAndRoute.js","node_modules/workbox-precaching/precache.js","node_modules/workbox-precaching/addRoute.js"],"sourcesContent":["\"use strict\";\r\n// @ts-ignore\r\ntry {\r\n self['workbox:core:6.5.3'] && _();\r\n}\r\ncatch (e) { }\r\n","/*\r\n Copyright 2019 Google LLC\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\nconst logger = (process.env.NODE_ENV === 'production'\r\n ? null\r\n : (() => {\r\n // Don't overwrite this value if it's already set.\r\n // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\r\n if (!('__WB_DISABLE_DEV_LOGS' in self)) {\r\n self.__WB_DISABLE_DEV_LOGS = false;\r\n }\r\n let inGroup = false;\r\n const methodToColorMap = {\r\n debug: `#7f8c8d`,\r\n log: `#2ecc71`,\r\n warn: `#f39c12`,\r\n error: `#c0392b`,\r\n groupCollapsed: `#3498db`,\r\n groupEnd: null, // No colored prefix on groupEnd\r\n };\r\n const print = function (method, args) {\r\n if (self.__WB_DISABLE_DEV_LOGS) {\r\n return;\r\n }\r\n if (method === 'groupCollapsed') {\r\n // Safari doesn't print all console.groupCollapsed() arguments:\r\n // https://bugs.webkit.org/show_bug.cgi?id=182754\r\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\r\n console[method](...args);\r\n return;\r\n }\r\n }\r\n const styles = [\r\n `background: ${methodToColorMap[method]}`,\r\n `border-radius: 0.5em`,\r\n `color: white`,\r\n `font-weight: bold`,\r\n `padding: 2px 0.5em`,\r\n ];\r\n // When in a group, the workbox prefix is not displayed.\r\n const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\r\n console[method](...logPrefix, ...args);\r\n if (method === 'groupCollapsed') {\r\n inGroup = true;\r\n }\r\n if (method === 'groupEnd') {\r\n inGroup = false;\r\n }\r\n };\r\n // eslint-disable-next-line @typescript-eslint/ban-types\r\n const api = {};\r\n const loggerMethods = Object.keys(methodToColorMap);\r\n for (const key of loggerMethods) {\r\n const method = key;\r\n api[method] = (...args) => {\r\n print(method, args);\r\n };\r\n }\r\n return api;\r\n })());\r\nexport { logger };\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { messages } from './messages.js';\r\nimport '../../_version.js';\r\nconst fallback = (code, ...args) => {\r\n let msg = code;\r\n if (args.length > 0) {\r\n msg += ` :: ${JSON.stringify(args)}`;\r\n }\r\n return msg;\r\n};\r\nconst generatorFunction = (code, details = {}) => {\r\n const message = messages[code];\r\n if (!message) {\r\n throw new Error(`Unable to find message for code '${code}'.`);\r\n }\r\n return message(details);\r\n};\r\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\r\nimport '../_version.js';\r\n/**\r\n * Workbox errors should be thrown with this class.\r\n * This allows use to ensure the type easily in tests,\r\n * helps developers identify errors from workbox\r\n * easily and allows use to optimise error\r\n * messages correctly.\r\n *\r\n * @private\r\n */\r\nclass WorkboxError extends Error {\r\n /**\r\n *\r\n * @param {string} errorCode The error code that\r\n * identifies this particular error.\r\n * @param {Object=} details Any relevant arguments\r\n * that will help developers identify issues should\r\n * be added as a key on the context object.\r\n */\r\n constructor(errorCode, details) {\r\n const message = messageGenerator(errorCode, details);\r\n super(message);\r\n this.name = errorCode;\r\n this.details = details;\r\n }\r\n}\r\nexport { WorkboxError };\r\n","\"use strict\";\r\n// @ts-ignore\r\ntry {\r\n self['workbox:routing:6.5.3'] && _();\r\n}\r\ncatch (e) { }\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\n/**\r\n * The default HTTP method, 'GET', used when there's no specific method\r\n * configured for a route.\r\n *\r\n * @type {string}\r\n *\r\n * @private\r\n */\r\nexport const defaultMethod = 'GET';\r\n/**\r\n * The list of valid HTTP methods associated with requests that could be routed.\r\n *\r\n * @type {Array<string>}\r\n *\r\n * @private\r\n */\r\nexport const validMethods = [\r\n 'DELETE',\r\n 'GET',\r\n 'HEAD',\r\n 'PATCH',\r\n 'POST',\r\n 'PUT',\r\n];\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { assert } from 'workbox-core/_private/assert.js';\r\nimport '../_version.js';\r\n/**\r\n * @param {function()|Object} handler Either a function, or an object with a\r\n * 'handle' method.\r\n * @return {Object} An object with a handle method.\r\n *\r\n * @private\r\n */\r\nexport const normalizeHandler = (handler) => {\r\n if (handler && typeof handler === 'object') {\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.hasMethod(handler, 'handle', {\r\n moduleName: 'workbox-routing',\r\n className: 'Route',\r\n funcName: 'constructor',\r\n paramName: 'handler',\r\n });\r\n }\r\n return handler;\r\n }\r\n else {\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.isType(handler, 'function', {\r\n moduleName: 'workbox-routing',\r\n className: 'Route',\r\n funcName: 'constructor',\r\n paramName: 'handler',\r\n });\r\n }\r\n return { handle: handler };\r\n }\r\n};\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { assert } from 'workbox-core/_private/assert.js';\r\nimport { defaultMethod, validMethods } from './utils/constants.js';\r\nimport { normalizeHandler } from './utils/normalizeHandler.js';\r\nimport './_version.js';\r\n/**\r\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\r\n * The \"match\" callback determine if a route should be used to \"handle\" a\r\n * request by returning a non-falsy value if it can. The \"handler\" callback\r\n * is called when there is a match and should return a Promise that resolves\r\n * to a `Response`.\r\n *\r\n * @memberof workbox-routing\r\n */\r\nclass Route {\r\n /**\r\n * Constructor for Route class.\r\n *\r\n * @param {workbox-routing~matchCallback} match\r\n * A callback function that determines whether the route matches a given\r\n * `fetch` event by returning a non-falsy value.\r\n * @param {workbox-routing~handlerCallback} handler A callback\r\n * function that returns a Promise resolving to a Response.\r\n * @param {string} [method='GET'] The HTTP method to match the Route\r\n * against.\r\n */\r\n constructor(match, handler, method = defaultMethod) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.isType(match, 'function', {\r\n moduleName: 'workbox-routing',\r\n className: 'Route',\r\n funcName: 'constructor',\r\n paramName: 'match',\r\n });\r\n if (method) {\r\n assert.isOneOf(method, validMethods, { paramName: 'method' });\r\n }\r\n }\r\n // These values are referenced directly by Router so cannot be\r\n // altered by minificaton.\r\n this.handler = normalizeHandler(handler);\r\n this.match = match;\r\n this.method = method;\r\n }\r\n /**\r\n *\r\n * @param {workbox-routing-handlerCallback} handler A callback\r\n * function that returns a Promise resolving to a Response\r\n */\r\n setCatchHandler(handler) {\r\n this.catchHandler = normalizeHandler(handler);\r\n }\r\n}\r\nexport { Route };\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { assert } from 'workbox-core/_private/assert.js';\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { Route } from './Route.js';\r\nimport './_version.js';\r\n/**\r\n * RegExpRoute makes it easy to create a regular expression based\r\n * {@link workbox-routing.Route}.\r\n *\r\n * For same-origin requests the RegExp only needs to match part of the URL. For\r\n * requests against third-party servers, you must define a RegExp that matches\r\n * the start of the URL.\r\n *\r\n * @memberof workbox-routing\r\n * @extends workbox-routing.Route\r\n */\r\nclass RegExpRoute extends Route {\r\n /**\r\n * If the regular expression contains\r\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\r\n * the captured values will be passed to the\r\n * {@link workbox-routing~handlerCallback} `params`\r\n * argument.\r\n *\r\n * @param {RegExp} regExp The regular expression to match against URLs.\r\n * @param {workbox-routing~handlerCallback} handler A callback\r\n * function that returns a Promise resulting in a Response.\r\n * @param {string} [method='GET'] The HTTP method to match the Route\r\n * against.\r\n */\r\n constructor(regExp, handler, method) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.isInstance(regExp, RegExp, {\r\n moduleName: 'workbox-routing',\r\n className: 'RegExpRoute',\r\n funcName: 'constructor',\r\n paramName: 'pattern',\r\n });\r\n }\r\n const match = ({ url }) => {\r\n const result = regExp.exec(url.href);\r\n // Return immediately if there's no match.\r\n if (!result) {\r\n return;\r\n }\r\n // Require that the match start at the first character in the URL string\r\n // if it's a cross-origin request.\r\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\r\n // behind this behavior.\r\n if (url.origin !== location.origin && result.index !== 0) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\r\n `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\r\n `handle cross-origin requests if they match the entire URL.`);\r\n }\r\n return;\r\n }\r\n // If the route matches, but there aren't any capture groups defined, then\r\n // this will return [], which is truthy and therefore sufficient to\r\n // indicate a match.\r\n // If there are capture groups, then it will return their values.\r\n return result.slice(1);\r\n };\r\n super(match, handler, method);\r\n }\r\n}\r\nexport { RegExpRoute };\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { assert } from 'workbox-core/_private/assert.js';\r\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\r\nimport { defaultMethod } from './utils/constants.js';\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { normalizeHandler } from './utils/normalizeHandler.js';\r\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\r\nimport './_version.js';\r\n/**\r\n * The Router can be used to process a `FetchEvent` using one or more\r\n * {@link workbox-routing.Route}, responding with a `Response` if\r\n * a matching route exists.\r\n *\r\n * If no route matches a given a request, the Router will use a \"default\"\r\n * handler if one is defined.\r\n *\r\n * Should the matching Route throw an error, the Router will use a \"catch\"\r\n * handler if one is defined to gracefully deal with issues and respond with a\r\n * Request.\r\n *\r\n * If a request matches multiple routes, the **earliest** registered route will\r\n * be used to respond to the request.\r\n *\r\n * @memberof workbox-routing\r\n */\r\nclass Router {\r\n /**\r\n * Initializes a new Router.\r\n */\r\n constructor() {\r\n this._routes = new Map();\r\n this._defaultHandlerMap = new Map();\r\n }\r\n /**\r\n * @return {Map<string, Array<workbox-routing.Route>>} routes A `Map` of HTTP\r\n * method name ('GET', etc.) to an array of all the corresponding `Route`\r\n * instances that are registered.\r\n */\r\n get routes() {\r\n return this._routes;\r\n }\r\n /**\r\n * Adds a fetch event listener to respond to events when a route matches\r\n * the event's request.\r\n */\r\n addFetchListener() {\r\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\r\n self.addEventListener('fetch', ((event) => {\r\n const { request } = event;\r\n const responsePromise = this.handleRequest({ request, event });\r\n if (responsePromise) {\r\n event.respondWith(responsePromise);\r\n }\r\n }));\r\n }\r\n /**\r\n * Adds a message event listener for URLs to cache from the window.\r\n * This is useful to cache resources loaded on the page prior to when the\r\n * service worker started controlling it.\r\n *\r\n * The format of the message data sent from the window should be as follows.\r\n * Where the `urlsToCache` array may consist of URL strings or an array of\r\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\r\n *\r\n * ```\r\n * {\r\n * type: 'CACHE_URLS',\r\n * payload: {\r\n * urlsToCache: [\r\n * './script1.js',\r\n * './script2.js',\r\n * ['./script3.js', {mode: 'no-cors'}],\r\n * ],\r\n * },\r\n * }\r\n * ```\r\n */\r\n addCacheListener() {\r\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\r\n self.addEventListener('message', ((event) => {\r\n // event.data is type 'any'\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\r\n if (event.data && event.data.type === 'CACHE_URLS') {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\r\n const { payload } = event.data;\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\r\n }\r\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\r\n if (typeof entry === 'string') {\r\n entry = [entry];\r\n }\r\n const request = new Request(...entry);\r\n return this.handleRequest({ request, event });\r\n // TODO(philipwalton): TypeScript errors without this typecast for\r\n // some reason (probably a bug). The real type here should work but\r\n // doesn't: `Array<Promise<Response> | undefined>`.\r\n })); // TypeScript\r\n event.waitUntil(requestPromises);\r\n // If a MessageChannel was used, reply to the message on success.\r\n if (event.ports && event.ports[0]) {\r\n void requestPromises.then(() => event.ports[0].postMessage(true));\r\n }\r\n }\r\n }));\r\n }\r\n /**\r\n * Apply the routing rules to a FetchEvent object to get a Response from an\r\n * appropriate Route's handler.\r\n *\r\n * @param {Object} options\r\n * @param {Request} options.request The request to handle.\r\n * @param {ExtendableEvent} options.event The event that triggered the\r\n * request.\r\n * @return {Promise<Response>|undefined} A promise is returned if a\r\n * registered route can handle the request. If there is no matching\r\n * route and there's no `defaultHandler`, `undefined` is returned.\r\n */\r\n handleRequest({ request, event, }) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.isInstance(request, Request, {\r\n moduleName: 'workbox-routing',\r\n className: 'Router',\r\n funcName: 'handleRequest',\r\n paramName: 'options.request',\r\n });\r\n }\r\n const url = new URL(request.url, location.href);\r\n if (!url.protocol.startsWith('http')) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\r\n }\r\n return;\r\n }\r\n const sameOrigin = url.origin === location.origin;\r\n const { params, route } = this.findMatchingRoute({\r\n event,\r\n request,\r\n sameOrigin,\r\n url,\r\n });\r\n let handler = route && route.handler;\r\n const debugMessages = [];\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (handler) {\r\n debugMessages.push([`Found a route to handle this request:`, route]);\r\n if (params) {\r\n debugMessages.push([\r\n `Passing the following params to the route's handler:`,\r\n params,\r\n ]);\r\n }\r\n }\r\n }\r\n // If we don't have a handler because there was no matching route, then\r\n // fall back to defaultHandler if that's defined.\r\n const method = request.method;\r\n if (!handler && this._defaultHandlerMap.has(method)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n debugMessages.push(`Failed to find a matching route. Falling ` +\r\n `back to the default handler for ${method}.`);\r\n }\r\n handler = this._defaultHandlerMap.get(method);\r\n }\r\n if (!handler) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n // No handler so Workbox will do nothing. If logs is set of debug\r\n // i.e. verbose, we should print out this information.\r\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\r\n }\r\n return;\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n // We have a handler, meaning Workbox is going to handle the route.\r\n // print the routing details to the console.\r\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\r\n debugMessages.forEach((msg) => {\r\n if (Array.isArray(msg)) {\r\n logger.log(...msg);\r\n }\r\n else {\r\n logger.log(msg);\r\n }\r\n });\r\n logger.groupEnd();\r\n }\r\n // Wrap in try and catch in case the handle method throws a synchronous\r\n // error. It should still callback to the catch handler.\r\n let responsePromise;\r\n try {\r\n responsePromise = handler.handle({ url, request, event, params });\r\n }\r\n catch (err) {\r\n responsePromise = Promise.reject(err);\r\n }\r\n // Get route's catch handler, if it exists\r\n const catchHandler = route && route.catchHandler;\r\n if (responsePromise instanceof Promise &&\r\n (this._catchHandler || catchHandler)) {\r\n responsePromise = responsePromise.catch(async (err) => {\r\n // If there's a route catch handler, process that first\r\n if (catchHandler) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n // Still include URL here as it will be async from the console group\r\n // and may not make sense without the URL\r\n logger.groupCollapsed(`Error thrown when responding to: ` +\r\n ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\r\n logger.error(`Error thrown by:`, route);\r\n logger.error(err);\r\n logger.groupEnd();\r\n }\r\n try {\r\n return await catchHandler.handle({ url, request, event, params });\r\n }\r\n catch (catchErr) {\r\n if (catchErr instanceof Error) {\r\n err = catchErr;\r\n }\r\n }\r\n }\r\n if (this._catchHandler) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n // Still include URL here as it will be async from the console group\r\n // and may not make sense without the URL\r\n logger.groupCollapsed(`Error thrown when responding to: ` +\r\n ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\r\n logger.error(`Error thrown by:`, route);\r\n logger.error(err);\r\n logger.groupEnd();\r\n }\r\n return this._catchHandler.handle({ url, request, event });\r\n }\r\n throw err;\r\n });\r\n }\r\n return responsePromise;\r\n }\r\n /**\r\n * Checks a request and URL (and optionally an event) against the list of\r\n * registered routes, and if there's a match, returns the corresponding\r\n * route along with any params generated by the match.\r\n *\r\n * @param {Object} options\r\n * @param {URL} options.url\r\n * @param {boolean} options.sameOrigin The result of comparing `url.origin`\r\n * against the current origin.\r\n * @param {Request} options.request The request to match.\r\n * @param {Event} options.event The corresponding event.\r\n * @return {Object} An object with `route` and `params` properties.\r\n * They are populated if a matching route was found or `undefined`\r\n * otherwise.\r\n */\r\n findMatchingRoute({ url, sameOrigin, request, event, }) {\r\n const routes = this._routes.get(request.method) || [];\r\n for (const route of routes) {\r\n let params;\r\n // route.match returns type any, not possible to change right now.\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\r\n const matchResult = route.match({ url, sameOrigin, request, event });\r\n if (matchResult) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n // Warn developers that using an async matchCallback is almost always\r\n // not the right thing to do.\r\n if (matchResult instanceof Promise) {\r\n logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\r\n `matchCallback function was used. Please convert the ` +\r\n `following route to use a synchronous matchCallback function:`, route);\r\n }\r\n }\r\n // See https://github.com/GoogleChrome/workbox/issues/2079\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\r\n params = matchResult;\r\n if (Array.isArray(params) && params.length === 0) {\r\n // Instead of passing an empty array in as params, use undefined.\r\n params = undefined;\r\n }\r\n else if (matchResult.constructor === Object && // eslint-disable-line\r\n Object.keys(matchResult).length === 0) {\r\n // Instead of passing an empty object in as params, use undefined.\r\n params = undefined;\r\n }\r\n else if (typeof matchResult === 'boolean') {\r\n // For the boolean value true (rather than just something truth-y),\r\n // don't set params.\r\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\r\n params = undefined;\r\n }\r\n // Return early if have a match.\r\n return { route, params };\r\n }\r\n }\r\n // If no match was found above, return and empty object.\r\n return {};\r\n }\r\n /**\r\n * Define a default `handler` that's called when no routes explicitly\r\n * match the incoming request.\r\n *\r\n * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\r\n *\r\n * Without a default handler, unmatched requests will go against the\r\n * network as if there were no service worker present.\r\n *\r\n * @param {workbox-routing~handlerCallback} handler A callback\r\n * function that returns a Promise resulting in a Response.\r\n * @param {string} [method='GET'] The HTTP method to associate with this\r\n * default handler. Each method has its own default.\r\n */\r\n setDefaultHandler(handler, method = defaultMethod) {\r\n this._defaultHandlerMap.set(method, normalizeHandler(handler));\r\n }\r\n /**\r\n * If a Route throws an error while handling a request, this `handler`\r\n * will be called and given a chance to provide a response.\r\n *\r\n * @param {workbox-routing~handlerCallback} handler A callback\r\n * function that returns a Promise resulting in a Response.\r\n */\r\n setCatchHandler(handler) {\r\n this._catchHandler = normalizeHandler(handler);\r\n }\r\n /**\r\n * Registers a route with the router.\r\n *\r\n * @param {workbox-routing.Route} route The route to register.\r\n */\r\n registerRoute(route) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.isType(route, 'object', {\r\n moduleName: 'workbox-routing',\r\n className: 'Router',\r\n funcName: 'registerRoute',\r\n paramName: 'route',\r\n });\r\n assert.hasMethod(route, 'match', {\r\n moduleName: 'workbox-routing',\r\n className: 'Router',\r\n funcName: 'registerRoute',\r\n paramName: 'route',\r\n });\r\n assert.isType(route.handler, 'object', {\r\n moduleName: 'workbox-routing',\r\n className: 'Router',\r\n funcName: 'registerRoute',\r\n paramName: 'route',\r\n });\r\n assert.hasMethod(route.handler, 'handle', {\r\n moduleName: 'workbox-routing',\r\n className: 'Router',\r\n funcName: 'registerRoute',\r\n paramName: 'route.handler',\r\n });\r\n assert.isType(route.method, 'string', {\r\n moduleName: 'workbox-routing',\r\n className: 'Router',\r\n funcName: 'registerRoute',\r\n paramName: 'route.method',\r\n });\r\n }\r\n if (!this._routes.has(route.method)) {\r\n this._routes.set(route.method, []);\r\n }\r\n // Give precedence to all of the earlier routes by adding this additional\r\n // route to the end of the array.\r\n this._routes.get(route.method).push(route);\r\n }\r\n /**\r\n * Unregisters a route with the router.\r\n *\r\n * @param {workbox-routing.Route} route The route to unregister.\r\n */\r\n unregisterRoute(route) {\r\n if (!this._routes.has(route.method)) {\r\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\r\n method: route.method,\r\n });\r\n }\r\n const routeIndex = this._routes.get(route.method).indexOf(route);\r\n if (routeIndex > -1) {\r\n this._routes.get(route.method).splice(routeIndex, 1);\r\n }\r\n else {\r\n throw new WorkboxError('unregister-route-route-not-registered');\r\n }\r\n }\r\n}\r\nexport { Router };\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { Router } from '../Router.js';\r\nimport '../_version.js';\r\nlet defaultRouter;\r\n/**\r\n * Creates a new, singleton Router instance if one does not exist. If one\r\n * does already exist, that instance is returned.\r\n *\r\n * @private\r\n * @return {Router}\r\n */\r\nexport const getOrCreateDefaultRouter = () => {\r\n if (!defaultRouter) {\r\n defaultRouter = new Router();\r\n // The helpers that use the default Router assume these listeners exist.\r\n defaultRouter.addFetchListener();\r\n defaultRouter.addCacheListener();\r\n }\r\n return defaultRouter;\r\n};\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\r\nimport { Route } from './Route.js';\r\nimport { RegExpRoute } from './RegExpRoute.js';\r\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\r\nimport './_version.js';\r\n/**\r\n * Easily register a RegExp, string, or function with a caching\r\n * strategy to a singleton Router instance.\r\n *\r\n * This method will generate a Route for you if needed and\r\n * call {@link workbox-routing.Router#registerRoute}.\r\n *\r\n * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture\r\n * If the capture param is a `Route`, all other arguments will be ignored.\r\n * @param {workbox-routing~handlerCallback} [handler] A callback\r\n * function that returns a Promise resulting in a Response. This parameter\r\n * is required if `capture` is not a `Route` object.\r\n * @param {string} [method='GET'] The HTTP method to match the Route\r\n * against.\r\n * @return {workbox-routing.Route} The generated `Route`.\r\n *\r\n * @memberof workbox-routing\r\n */\r\nfunction registerRoute(capture, handler, method) {\r\n let route;\r\n if (typeof capture === 'string') {\r\n const captureUrl = new URL(capture, location.href);\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\r\n throw new WorkboxError('invalid-string', {\r\n moduleName: 'workbox-routing',\r\n funcName: 'registerRoute',\r\n paramName: 'capture',\r\n });\r\n }\r\n // We want to check if Express-style wildcards are in the pathname only.\r\n // TODO: Remove this log message in v4.\r\n const valueToCheck = capture.startsWith('http')\r\n ? captureUrl.pathname\r\n : capture;\r\n // See https://github.com/pillarjs/path-to-regexp#parameters\r\n const wildcards = '[*:?+]';\r\n if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\r\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\r\n `character (${wildcards}). Strings are now always interpreted as ` +\r\n `exact matches; use a RegExp for partial or wildcard matches.`);\r\n }\r\n }\r\n const matchCallback = ({ url }) => {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (url.pathname === captureUrl.pathname &&\r\n url.origin !== captureUrl.origin) {\r\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\r\n `${url.toString()}. This route will only handle cross-origin requests ` +\r\n `if they match the entire URL.`);\r\n }\r\n }\r\n return url.href === captureUrl.href;\r\n };\r\n // If `capture` is a string then `handler` and `method` must be present.\r\n route = new Route(matchCallback, handler, method);\r\n }\r\n else if (capture instanceof RegExp) {\r\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\r\n route = new RegExpRoute(capture, handler, method);\r\n }\r\n else if (typeof capture === 'function') {\r\n // If `capture` is a function then `handler` and `method` must be present.\r\n route = new Route(capture, handler, method);\r\n }\r\n else if (capture instanceof Route) {\r\n route = capture;\r\n }\r\n else {\r\n throw new WorkboxError('unsupported-route-type', {\r\n moduleName: 'workbox-routing',\r\n funcName: 'registerRoute',\r\n paramName: 'capture',\r\n });\r\n }\r\n const defaultRouter = getOrCreateDefaultRouter();\r\n defaultRouter.registerRoute(route);\r\n return route;\r\n}\r\nexport { registerRoute };\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\nconst _cacheNameDetails = {\r\n googleAnalytics: 'googleAnalytics',\r\n precache: 'precache-v2',\r\n prefix: 'workbox',\r\n runtime: 'runtime',\r\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\r\n};\r\nconst _createCacheName = (cacheName) => {\r\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\r\n .filter((value) => value && value.length > 0)\r\n .join('-');\r\n};\r\nconst eachCacheNameDetail = (fn) => {\r\n for (const key of Object.keys(_cacheNameDetails)) {\r\n fn(key);\r\n }\r\n};\r\nexport const cacheNames = {\r\n updateDetails: (details) => {\r\n eachCacheNameDetail((key) => {\r\n if (typeof details[key] === 'string') {\r\n _cacheNameDetails[key] = details[key];\r\n }\r\n });\r\n },\r\n getGoogleAnalyticsName: (userCacheName) => {\r\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\r\n },\r\n getPrecacheName: (userCacheName) => {\r\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\r\n },\r\n getPrefix: () => {\r\n return _cacheNameDetails.prefix;\r\n },\r\n getRuntimeName: (userCacheName) => {\r\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\r\n },\r\n getSuffix: () => {\r\n return _cacheNameDetails.suffix;\r\n },\r\n};\r\n","/*\r\n Copyright 2020 Google LLC\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\nfunction stripParams(fullURL, ignoreParams) {\r\n const strippedURL = new URL(fullURL);\r\n for (const param of ignoreParams) {\r\n strippedURL.searchParams.delete(param);\r\n }\r\n return strippedURL.href;\r\n}\r\n/**\r\n * Matches an item in the cache, ignoring specific URL params. This is similar\r\n * to the `ignoreSearch` option, but it allows you to ignore just specific\r\n * params (while continuing to match on the others).\r\n *\r\n * @private\r\n * @param {Cache} cache\r\n * @param {Request} request\r\n * @param {Object} matchOptions\r\n * @param {Array<string>} ignoreParams\r\n * @return {Promise<Response|undefined>}\r\n */\r\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\r\n const strippedRequestURL = stripParams(request.url, ignoreParams);\r\n // If the request doesn't include any ignored params, match as normal.\r\n if (request.url === strippedRequestURL) {\r\n return cache.match(request, matchOptions);\r\n }\r\n // Otherwise, match by comparing keys\r\n const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\r\n const cacheKeys = await cache.keys(request, keysOptions);\r\n for (const cacheKey of cacheKeys) {\r\n const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\r\n if (strippedRequestURL === strippedCacheKeyURL) {\r\n return cache.match(cacheKey, matchOptions);\r\n }\r\n }\r\n return;\r\n}\r\nexport { cacheMatchIgnoreParams };\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\n/**\r\n * The Deferred class composes Promises in a way that allows for them to be\r\n * resolved or rejected from outside the constructor. In most cases promises\r\n * should be used directly, but Deferreds can be necessary when the logic to\r\n * resolve a promise must be separate.\r\n *\r\n * @private\r\n */\r\nclass Deferred {\r\n /**\r\n * Creates a promise and exposes its resolve and reject functions as methods.\r\n */\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => {\r\n this.resolve = resolve;\r\n this.reject = reject;\r\n });\r\n }\r\n}\r\nexport { Deferred };\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\n// Callbacks to be executed whenever there's a quota error.\r\n// Can't change Function type right now.\r\n// eslint-disable-next-line @typescript-eslint/ban-types\r\nconst quotaErrorCallbacks = new Set();\r\nexport { quotaErrorCallbacks };\r\n","\"use strict\";\r\n// @ts-ignore\r\ntry {\r\n self['workbox:strategies:6.5.3'] && _();\r\n}\r\ncatch (e) { }\r\n","/*\r\n Copyright 2020 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { assert } from 'workbox-core/_private/assert.js';\r\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\r\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\r\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\r\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { timeout } from 'workbox-core/_private/timeout.js';\r\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\r\nimport './_version.js';\r\nfunction toRequest(input) {\r\n return typeof input === 'string' ? new Request(input) : input;\r\n}\r\n/**\r\n * A class created every time a Strategy instance instance calls\r\n * {@link workbox-strategies.Strategy~handle} or\r\n * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and\r\n * cache actions around plugin callbacks and keeps track of when the strategy\r\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\r\n *\r\n * @memberof workbox-strategies\r\n */\r\nclass StrategyHandler {\r\n /**\r\n * Creates a new instance associated with the passed strategy and event\r\n * that's handling the request.\r\n *\r\n * The constructor also initializes the state that will be passed to each of\r\n * the plugins handling this request.\r\n *\r\n * @param {workbox-strategies.Strategy} strategy\r\n * @param {Object} options\r\n * @param {Request|string} options.request A request to run this strategy for.\r\n * @param {ExtendableEvent} options.event The event associated with the\r\n * request.\r\n * @param {URL} [options.url]\r\n * @param {*} [options.params] The return value from the\r\n * {@link workbox-routing~matchCallback} (if applicable).\r\n */\r\n constructor(strategy, options) {\r\n this._cacheKeys = {};\r\n /**\r\n * The request the strategy is performing (passed to the strategy's\r\n * `handle()` or `handleAll()` method).\r\n * @name request\r\n * @instance\r\n * @type {Request}\r\n * @memberof workbox-strategies.StrategyHandler\r\n */\r\n /**\r\n * The event associated with this request.\r\n * @name event\r\n * @instance\r\n * @type {ExtendableEvent}\r\n * @memberof workbox-strategies.StrategyHandler\r\n */\r\n /**\r\n * A `URL` instance of `request.url` (if passed to the strategy's\r\n * `handle()` or `handleAll()` method).\r\n * Note: the `url` param will be present if the strategy was invoked\r\n * from a workbox `Route` object.\r\n * @name url\r\n * @instance\r\n * @type {URL|undefined}\r\n * @memberof workbox-strategies.StrategyHandler\r\n */\r\n /**\r\n * A `param` value (if passed to the strategy's\r\n * `handle()` or `handleAll()` method).\r\n * Note: the `param` param will be present if the strategy was invoked\r\n * from a workbox `Route` object and the\r\n * {@link workbox-routing~matchCallback} returned\r\n * a truthy value (it will be that value).\r\n * @name params\r\n * @instance\r\n * @type {*|undefined}\r\n * @memberof workbox-strategies.StrategyHandler\r\n */\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.isInstance(options.event, ExtendableEvent, {\r\n moduleName: 'workbox-strategies',\r\n className: 'StrategyHandler',\r\n funcName: 'constructor',\r\n paramName: 'options.event',\r\n });\r\n }\r\n Object.assign(this, options);\r\n this.event = options.event;\r\n this._strategy = strategy;\r\n this._handlerDeferred = new Deferred();\r\n this._extendLifetimePromises = [];\r\n // Copy the plugins list (since it's mutable on the strategy),\r\n // so any mutations don't affect this handler instance.\r\n this._plugins = [...strategy.plugins];\r\n this._pluginStateMap = new Map();\r\n for (const plugin of this._plugins) {\r\n this._pluginStateMap.set(plugin, {});\r\n }\r\n this.event.waitUntil(this._handlerDeferred.promise);\r\n }\r\n /**\r\n * Fetches a given request (and invokes any applicable plugin callback\r\n * methods) using the `fetchOptions` (for non-navigation requests) and\r\n * `plugins` defined on the `Strategy` object.\r\n *\r\n * The following plugin lifecycle methods are invoked when using this method:\r\n * - `requestWillFetch()`\r\n * - `fetchDidSucceed()`\r\n * - `fetchDidFail()`\r\n *\r\n * @param {Request|string} input The URL or request to fetch.\r\n * @return {Promise<Response>}\r\n */\r\n async fetch(input) {\r\n const { event } = this;\r\n let request = toRequest(input);\r\n if (request.mode === 'navigate' &&\r\n event instanceof FetchEvent &&\r\n event.preloadResponse) {\r\n const possiblePreloadResponse = (await event.preloadResponse);\r\n if (possiblePreloadResponse) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.log(`Using a preloaded navigation response for ` +\r\n `'${getFriendlyURL(request.url)}'`);\r\n }\r\n return possiblePreloadResponse;\r\n }\r\n }\r\n // If there is a fetchDidFail plugin, we need to save a clone of the\r\n // original request before it's either modified by a requestWillFetch\r\n // plugin or before the original request's body is consumed via fetch().\r\n const originalRequest = this.hasCallback('fetchDidFail')\r\n ? request.clone()\r\n : null;\r\n try {\r\n for (const cb of this.iterateCallbacks('requestWillFetch')) {\r\n request = await cb({ request: request.clone(), event });\r\n }\r\n }\r\n catch (err) {\r\n if (err instanceof Error) {\r\n throw new WorkboxError('plugin-error-request-will-fetch', {\r\n thrownErrorMessage: err.message,\r\n });\r\n }\r\n }\r\n // The request can be altered by plugins with `requestWillFetch` making\r\n // the original request (most likely from a `fetch` event) different\r\n // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\r\n const pluginFilteredRequest = request.clone();\r\n try {\r\n let fetchResponse;\r\n // See https://github.com/GoogleChrome/workbox/issues/1796\r\n fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.debug(`Network request for ` +\r\n `'${getFriendlyURL(request.url)}' returned a response with ` +\r\n `status '${fetchResponse.status}'.`);\r\n }\r\n for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\r\n fetchResponse = await callback({\r\n event,\r\n request: pluginFilteredRequest,\r\n response: fetchResponse,\r\n });\r\n }\r\n return fetchResponse;\r\n }\r\n catch (error) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.log(`Network request for ` +\r\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\r\n }\r\n // `originalRequest` will only exist if a `fetchDidFail` callback\r\n // is being used (see above).\r\n if (originalRequest) {\r\n await this.runCallbacks('fetchDidFail', {\r\n error: error,\r\n event,\r\n originalRequest: originalRequest.clone(),\r\n request: pluginFilteredRequest.clone(),\r\n });\r\n }\r\n throw error;\r\n }\r\n }\r\n /**\r\n * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\r\n * the response generated by `this.fetch()`.\r\n *\r\n * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\r\n * so you do not have to manually call `waitUntil()` on the event.\r\n *\r\n * @param {Request|string} input The request or URL to fetch and cache.\r\n * @return {Promise<Response>}\r\n */\r\n async fetchAndCachePut(input) {\r\n const response = await this.fetch(input);\r\n const responseClone = response.clone();\r\n void this.waitUntil(this.cachePut(input, responseClone));\r\n return response;\r\n }\r\n /**\r\n * Matches a request from the cache (and invokes any applicable plugin\r\n * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\r\n * defined on the strategy object.\r\n *\r\n * The following plugin lifecycle methods are invoked when using this method:\r\n * - cacheKeyWillByUsed()\r\n * - cachedResponseWillByUsed()\r\n *\r\n * @param {Request|string} key The Request or URL to use as the cache key.\r\n * @return {Promise<Response|undefined>} A matching response, if found.\r\n */\r\n async cacheMatch(key) {\r\n const request = toRequest(key);\r\n let cachedResponse;\r\n const { cacheName, matchOptions } = this._strategy;\r\n const effectiveRequest = await this.getCacheKey(request, 'read');\r\n const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\r\n cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (cachedResponse) {\r\n logger.debug(`Found a cached response in '${cacheName}'.`);\r\n }\r\n else {\r\n logger.debug(`No cached response found in '${cacheName}'.`);\r\n }\r\n }\r\n for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\r\n cachedResponse =\r\n (await callback({\r\n cacheName,\r\n matchOptions,\r\n cachedResponse,\r\n request: effectiveRequest,\r\n event: this.event,\r\n })) || undefined;\r\n }\r\n return cachedResponse;\r\n }\r\n /**\r\n * Puts a request/response pair in the cache (and invokes any applicable\r\n * plugin callback methods) using the `cacheName` and `plugins` defined on\r\n * the strategy object.\r\n *\r\n * The following plugin lifecycle methods are invoked when using this method:\r\n * - cacheKeyWillByUsed()\r\n * - cacheWillUpdate()\r\n * - cacheDidUpdate()\r\n *\r\n * @param {Request|string} key The request or URL to use as the cache key.\r\n * @param {Response} response The response to cache.\r\n * @return {Promise<boolean>} `false` if a cacheWillUpdate caused the response\r\n * not be cached, and `true` otherwise.\r\n */\r\n async cachePut(key, response) {\r\n const request = toRequest(key);\r\n // Run in the next task to avoid blocking other cache reads.\r\n // https://github.com/w3c/ServiceWorker/issues/1397\r\n await timeout(0);\r\n const effectiveRequest = await this.getCacheKey(request, 'write');\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\r\n throw new WorkboxError('attempt-to-cache-non-get-request', {\r\n url: getFriendlyURL(effectiveRequest.url),\r\n method: effectiveRequest.method,\r\n });\r\n }\r\n // See https://github.com/GoogleChrome/workbox/issues/2818\r\n const vary = response.headers.get('Vary');\r\n if (vary) {\r\n logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\r\n `has a 'Vary: ${vary}' header. ` +\r\n `Consider setting the {ignoreVary: true} option on your strategy ` +\r\n `to ensure cache matching and deletion works as expected.`);\r\n }\r\n }\r\n if (!response) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.error(`Cannot cache non-existent response for ` +\r\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\r\n }\r\n throw new WorkboxError('cache-put-with-no-response', {\r\n url: getFriendlyURL(effectiveRequest.url),\r\n });\r\n }\r\n const responseToCache = await this._ensureResponseSafeToCache(response);\r\n if (!responseToCache) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\r\n `will not be cached.`, responseToCache);\r\n }\r\n return false;\r\n }\r\n const { cacheName, matchOptions } = this._strategy;\r\n const cache = await self.caches.open(cacheName);\r\n const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\r\n const oldResponse = hasCacheUpdateCallback\r\n ? await cacheMatchIgnoreParams(\r\n // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\r\n // feature. Consider into ways to only add this behavior if using\r\n // precaching.\r\n cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\r\n : null;\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\r\n `for ${getFriendlyURL(effectiveRequest.url)}.`);\r\n }\r\n try {\r\n await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\r\n }\r\n catch (error) {\r\n if (error instanceof Error) {\r\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\r\n if (error.name === 'QuotaExceededError') {\r\n await executeQuotaErrorCallbacks();\r\n }\r\n throw error;\r\n }\r\n }\r\n for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\r\n await callback({\r\n cacheName,\r\n oldResponse,\r\n newResponse: responseToCache.clone(),\r\n request: effectiveRequest,\r\n event: this.event,\r\n });\r\n }\r\n return true;\r\n }\r\n /**\r\n * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\r\n * executes any of those callbacks found in sequence. The final `Request`\r\n * object returned by the last plugin is treated as the cache key for cache\r\n * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\r\n * been registered, the passed request is returned unmodified\r\n *\r\n * @param {Request} request\r\n * @param {string} mode\r\n * @return {Promise<Request>}\r\n */\r\n async getCacheKey(request, mode) {\r\n const key = `${request.url} | ${mode}`;\r\n if (!this._cacheKeys[key]) {\r\n let effectiveRequest = request;\r\n for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\r\n effectiveRequest = toRequest(await callback({\r\n mode,\r\n request: effectiveRequest,\r\n event: this.event,\r\n // params has a type any can't change right now.\r\n params: this.params, // eslint-disable-line\r\n }));\r\n }\r\n this._cacheKeys[key] = effectiveRequest;\r\n }\r\n return this._cacheKeys[key];\r\n }\r\n /**\r\n * Returns true if the strategy has at least one plugin with the given\r\n * callback.\r\n *\r\n * @param {string} name The name of the callback to check for.\r\n * @return {boolean}\r\n */\r\n hasCallback(name) {\r\n for (const plugin of this._strategy.plugins) {\r\n if (name in plugin) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Runs all plugin callbacks matching the given name, in order, passing the\r\n * given param object (merged ith the current plugin state) as the only\r\n * argument.\r\n *\r\n * Note: since this method runs all plugins, it's not suitable for cases\r\n * where the return value of a callback needs to be applied prior to calling\r\n * the next callback. See\r\n * {@link workbox-strategies.StrategyHandler#iterateCallbacks}\r\n * below for how to handle that case.\r\n *\r\n * @param {string} name The name of the callback to run within each plugin.\r\n * @param {Object} param The object to pass as the first (and only) param\r\n * when executing each callback. This object will be merged with the\r\n * current plugin state prior to callback execution.\r\n */\r\n async runCallbacks(name, param) {\r\n for (const callback of this.iterateCallbacks(name)) {\r\n // TODO(philipwalton): not sure why `any` is needed. It seems like\r\n // this should work with `as WorkboxPluginCallbackParam[C]`.\r\n await callback(param);\r\n }\r\n }\r\n /**\r\n * Accepts a callback and returns an iterable of matching plugin callbacks,\r\n * where each callback is wrapped with the current handler state (i.e. when\r\n * you call each callback, whatever object parameter you pass it will\r\n * be merged with the plugin's current state).\r\n *\r\n * @param {string} name The name fo the callback to run\r\n * @return {Array<Function>}\r\n */\r\n *iterateCallbacks(name) {\r\n for (const plugin of this._strategy.plugins) {\r\n if (typeof plugin[name] === 'function') {\r\n const state = this._pluginStateMap.get(plugin);\r\n const statefulCallback = (param) => {\r\n const statefulParam = Object.assign(Object.assign({}, param), { state });\r\n // TODO(philipwalton): not sure why `any` is needed. It seems like\r\n // this should work with `as WorkboxPluginCallbackParam[C]`.\r\n return plugin[name](statefulParam);\r\n };\r\n yield statefulCallback;\r\n }\r\n }\r\n }\r\n /**\r\n * Adds a promise to the\r\n * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\r\n * of the event event associated with the request being handled (usually a\r\n * `FetchEvent`).\r\n *\r\n * Note: you can await\r\n * {@link workbox-strategies.StrategyHandler~doneWaiting}\r\n * to know when all added promises have settled.\r\n *\r\n * @param {Promise} promise A promise to add to the extend lifetime promises\r\n * of the event that triggered the request.\r\n */\r\n waitUntil(promise) {\r\n this._extendLifetimePromises.push(promise);\r\n return promise;\r\n }\r\n /**\r\n * Returns a promise that resolves once all promises passed to\r\n * {@link workbox-strategies.StrategyHandler~waitUntil}\r\n * have settled.\r\n *\r\n * Note: any work done after `doneWaiting()` settles should be manually\r\n * passed to an event's `waitUntil()` method (not this handler's\r\n * `waitUntil()` method), otherwise the service worker thread my be killed\r\n * prior to your work completing.\r\n */\r\n async doneWaiting() {\r\n let promise;\r\n while ((promise = this._extendLifetimePromises.shift())) {\r\n await promise;\r\n }\r\n }\r\n /**\r\n * Stops running the strategy and immediately resolves any pending\r\n * `waitUntil()` promises.\r\n */\r\n destroy() {\r\n this._handlerDeferred.resolve(null);\r\n }\r\n /**\r\n * This method will call cacheWillUpdate on the available plugins (or use\r\n * status === 200) to determine if the Response is safe and valid to cache.\r\n *\r\n * @param {Request} options.request\r\n * @param {Response} options.response\r\n * @return {Promise<Response|undefined>}\r\n *\r\n * @private\r\n */\r\n async _ensureResponseSafeToCache(response) {\r\n let responseToCache = response;\r\n let pluginsUsed = false;\r\n for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\r\n responseToCache =\r\n (await callback({\r\n request: this.request,\r\n response: responseToCache,\r\n event: this.event,\r\n })) || undefined;\r\n pluginsUsed = true;\r\n if (!responseToCache) {\r\n break;\r\n }\r\n }\r\n if (!pluginsUsed) {\r\n if (responseToCache && responseToCache.status !== 200) {\r\n responseToCache = undefined;\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (responseToCache) {\r\n if (responseToCache.status !== 200) {\r\n if (responseToCache.status === 0) {\r\n logger.warn(`The response for '${this.request.url}' ` +\r\n `is an opaque response. The caching strategy that you're ` +\r\n `using will not cache opaque responses by default.`);\r\n }\r\n else {\r\n logger.debug(`The response for '${this.request.url}' ` +\r\n `returned a status code of '${response.status}' and won't ` +\r\n `be cached as a result.`);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return responseToCache;\r\n }\r\n}\r\nexport { StrategyHandler };\r\n","/*\r\n Copyright 2019 Google LLC\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\n/**\r\n * Returns a promise that resolves and the passed number of milliseconds.\r\n * This utility is an async/await-friendly version of `setTimeout`.\r\n *\r\n * @param {number} ms\r\n * @return {Promise}\r\n * @private\r\n */\r\nexport function timeout(ms) {\r\n return new Promise((resolve) => setTimeout(resolve, ms));\r\n}\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\nconst getFriendlyURL = (url) => {\r\n const urlObj = new URL(String(url), location.href);\r\n // See https://github.com/GoogleChrome/workbox/issues/2323\r\n // We want to include everything, except for the origin if it's same-origin.\r\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\r\n};\r\nexport { getFriendlyURL };\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { logger } from '../_private/logger.js';\r\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\r\nimport '../_version.js';\r\n/**\r\n * Runs all of the callback functions, one at a time sequentially, in the order\r\n * in which they were registered.\r\n *\r\n * @memberof workbox-core\r\n * @private\r\n */\r\nasync function executeQuotaErrorCallbacks() {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\r\n `callbacks to clean up caches.`);\r\n }\r\n for (const callback of quotaErrorCallbacks) {\r\n await callback();\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.log(callback, 'is complete.');\r\n }\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.log('Finished running callbacks.');\r\n }\r\n}\r\nexport { executeQuotaErrorCallbacks };\r\n","/*\r\n Copyright 2020 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\r\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\r\nimport { StrategyHandler } from './StrategyHandler.js';\r\nimport './_version.js';\r\n/**\r\n * An abstract base class that all other strategy classes must extend from:\r\n *\r\n * @memberof workbox-strategies\r\n */\r\nclass Strategy {\r\n /**\r\n * Creates a new instance of the strategy and sets all documented option\r\n * properties as public instance properties.\r\n *\r\n * Note: if a custom strategy class extends the base Strategy class and does\r\n * not need more than these properties, it does not need to define its own\r\n * constructor.\r\n *\r\n * @param {Object} [options]\r\n * @param {string} [options.cacheName] Cache name to store and retrieve\r\n * requests. Defaults to the cache names provided by\r\n * {@link workbox-core.cacheNames}.\r\n * @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\r\n * to use in conjunction with this caching strategy.\r\n * @param {Object} [options.fetchOptions] Values passed along to the\r\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\r\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\r\n * `fetch()` requests made by this strategy.\r\n * @param {Object} [options.matchOptions] The\r\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\r\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\r\n */\r\n constructor(options = {}) {\r\n /**\r\n * Cache name to store and retrieve\r\n * requests. Defaults to the cache names provided by\r\n * {@link workbox-core.cacheNames}.\r\n *\r\n * @type {string}\r\n */\r\n this.cacheName = cacheNames.getRuntimeName(options.cacheName);\r\n /**\r\n * The list\r\n * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\r\n * used by this strategy.\r\n *\r\n * @type {Array<Object>}\r\n */\r\n this.plugins = options.plugins || [];\r\n /**\r\n * Values passed along to the\r\n * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\r\n * of all fetch() requests made by this strategy.\r\n *\r\n * @type {Object}\r\n */\r\n this.fetchOptions = options.fetchOptions;\r\n /**\r\n * The\r\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\r\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\r\n *\r\n * @type {Object}\r\n */\r\n this.matchOptions = options.matchOptions;\r\n }\r\n /**\r\n * Perform a request strategy and returns a `Promise` that will resolve with\r\n * a `Response`, invoking all relevant plugin callbacks.\r\n *\r\n * When a strategy instance is registered with a Workbox\r\n * {@link workbox-routing.Route}, this method is automatically\r\n * called when the route matches.\r\n *\r\n * Alternatively, this method can be used in a standalone `FetchEvent`\r\n * listener by passing it to `event.respondWith()`.\r\n *\r\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\r\n * properties listed below.\r\n * @param {Request|string} options.request A request to run this strategy for.\r\n * @param {ExtendableEvent} options.event The event associated with the\r\n * request.\r\n * @param {URL} [options.url]\r\n * @param {*} [options.params]\r\n */\r\n handle(options) {\r\n const [responseDone] = this.handleAll(options);\r\n return responseDone;\r\n }\r\n /**\r\n * Similar to {@link workbox-strategies.Strategy~handle}, but\r\n * instead of just returning a `Promise` that resolves to a `Response` it\r\n * it will return an tuple of `[response, done]` promises, where the former\r\n * (`response`) is equivalent to what `handle()` returns, and the latter is a\r\n * Promise that will resolve once any promises that were added to\r\n * `event.waitUntil()` as part of performing the strategy have completed.\r\n *\r\n * You can await the `done` promise to ensure any extra work performed by\r\n * the strategy (usually caching responses) completes successfully.\r\n *\r\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\r\n * properties listed below.\r\n * @param {Request|string} options.request A request to run this strategy for.\r\n * @param {ExtendableEvent} options.event The event associated with the\r\n * request.\r\n * @param {URL} [options.url]\r\n * @param {*} [options.params]\r\n * @return {Array<Promise>} A tuple of [response, done]\r\n * promises that can be used to determine when the response resolves as\r\n * well as when the handler has completed all its work.\r\n */\r\n handleAll(options) {\r\n // Allow for flexible options to be passed.\r\n if (options instanceof FetchEvent) {\r\n options = {\r\n event: options,\r\n request: options.request,\r\n };\r\n }\r\n const event = options.event;\r\n const request = typeof options.request === 'string'\r\n ? new Request(options.request)\r\n : options.request;\r\n const params = 'params' in options ? options.params : undefined;\r\n const handler = new StrategyHandler(this, { event, request, params });\r\n const responseDone = this._getResponse(handler, request, event);\r\n const handlerDone = this._awaitComplete(responseDone, handler, request, event);\r\n // Return an array of promises, suitable for use with Promise.all().\r\n return [responseDone, handlerDone];\r\n }\r\n async _getResponse(handler, request, event) {\r\n await handler.runCallbacks('handlerWillStart', { event, request });\r\n let response = undefined;\r\n try {\r\n response = await this._handle(request, handler);\r\n // The \"official\" Strategy subclasses all throw this error automatically,\r\n // but in case a third-party Strategy doesn't, ensure that we have a\r\n // consistent failure when there's no response or an error response.\r\n if (!response || response.type === 'error') {\r\n throw new WorkboxError('no-response', { url: request.url });\r\n }\r\n }\r\n catch (error) {\r\n if (error instanceof Error) {\r\n for (const callback of handler.iterateCallbacks('handlerDidError')) {\r\n response = await callback({ error, event, request });\r\n if (response) {\r\n break;\r\n }\r\n }\r\n }\r\n if (!response) {\r\n throw error;\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\r\n `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\r\n `a handlerDidError plugin.`);\r\n }\r\n }\r\n for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\r\n response = await callback({ event, request, response });\r\n }\r\n return response;\r\n }\r\n async _awaitComplete(responseDone, handler, request, event) {\r\n let response;\r\n let error;\r\n try {\r\n response = await responseDone;\r\n }\r\n catch (error) {\r\n // Ignore errors, as response errors should be caught via the `response`\r\n // promise above. The `done` promise will only throw for errors in\r\n // promises passed to `handler.waitUntil()`.\r\n }\r\n try {\r\n await handler.runCallbacks('handlerDidRespond', {\r\n event,\r\n request,\r\n response,\r\n });\r\n await handler.doneWaiting();\r\n }\r\n catch (waitUntilError) {\r\n if (waitUntilError instanceof Error) {\r\n error = waitUntilError;\r\n }\r\n }\r\n await handler.runCallbacks('handlerDidComplete', {\r\n event,\r\n request,\r\n response,\r\n error: error,\r\n });\r\n handler.destroy();\r\n if (error) {\r\n throw error;\r\n }\r\n }\r\n}\r\nexport { Strategy };\r\n/**\r\n * Classes extending the `Strategy` based class should implement this method,\r\n * and leverage the {@link workbox-strategies.StrategyHandler}\r\n * arg to perform all fetching and cache logic, which will ensure all relevant\r\n * cache, cache options, fetch options and plugins are used (per the current\r\n * strategy instance).\r\n *\r\n * @name _handle\r\n * @instance\r\n * @abstract\r\n * @function\r\n * @param {Request} request\r\n * @param {workbox-strategies.StrategyHandler} handler\r\n * @return {Promise<Response>}\r\n *\r\n * @memberof workbox-strategies.Strategy\r\n */\r\n","/*\r\n Copyright 2020 Google LLC\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\n/**\r\n * A utility method that makes it easier to use `event.waitUntil` with\r\n * async functions and return the result.\r\n *\r\n * @param {ExtendableEvent} event\r\n * @param {Function} asyncFn\r\n * @return {Function}\r\n * @private\r\n */\r\nfunction waitUntil(event, asyncFn) {\r\n const returnPromise = asyncFn();\r\n event.waitUntil(returnPromise);\r\n return returnPromise;\r\n}\r\nexport { waitUntil };\r\n","\"use strict\";\r\n// @ts-ignore\r\ntry {\r\n self['workbox:precaching:6.5.3'] && _();\r\n}\r\ncatch (e) { }\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\r\nimport '../_version.js';\r\n// Name of the search parameter used to store revision info.\r\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\r\n/**\r\n * Converts a manifest entry into a versioned URL suitable for precaching.\r\n *\r\n * @param {Object|string} entry\r\n * @return {string} A URL with versioning info.\r\n *\r\n * @private\r\n * @memberof workbox-precaching\r\n */\r\nexport function createCacheKey(entry) {\r\n if (!entry) {\r\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\r\n }\r\n // If a precache manifest entry is a string, it's assumed to be a versioned\r\n // URL, like '/app.abcd1234.js'. Return as-is.\r\n if (typeof entry === 'string') {\r\n const urlObject = new URL(entry, location.href);\r\n return {\r\n cacheKey: urlObject.href,\r\n url: urlObject.href,\r\n };\r\n }\r\n const { revision, url } = entry;\r\n if (!url) {\r\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\r\n }\r\n // If there's just a URL and no revision, then it's also assumed to be a\r\n // versioned URL.\r\n if (!revision) {\r\n const urlObject = new URL(url, location.href);\r\n return {\r\n cacheKey: urlObject.href,\r\n url: urlObject.href,\r\n };\r\n }\r\n // Otherwise, construct a properly versioned URL using the custom Workbox\r\n // search parameter along with the revision info.\r\n const cacheKeyURL = new URL(url, location.href);\r\n const originalURL = new URL(url, location.href);\r\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\r\n return {\r\n cacheKey: cacheKeyURL.href,\r\n url: originalURL.href,\r\n };\r\n}\r\n","/*\r\n Copyright 2020 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\n/**\r\n * A plugin, designed to be used with PrecacheController, to determine the\r\n * of assets that were updated (or not updated) during the install event.\r\n *\r\n * @private\r\n */\r\nclass PrecacheInstallReportPlugin {\r\n constructor() {\r\n this.updatedURLs = [];\r\n this.notUpdatedURLs = [];\r\n this.handlerWillStart = async ({ request, state, }) => {\r\n // TODO: `state` should never be undefined...\r\n if (state) {\r\n state.originalRequest = request;\r\n }\r\n };\r\n this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\r\n if (event.type === 'install') {\r\n if (state &&\r\n state.originalRequest &&\r\n state.originalRequest instanceof Request) {\r\n // TODO: `state` should never be undefined...\r\n const url = state.originalRequest.url;\r\n if (cachedResponse) {\r\n this.notUpdatedURLs.push(url);\r\n }\r\n else {\r\n this.updatedURLs.push(url);\r\n }\r\n }\r\n }\r\n return cachedResponse;\r\n };\r\n }\r\n}\r\nexport { PrecacheInstallReportPlugin };\r\n","/*\r\n Copyright 2020 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\n/**\r\n * A plugin, designed to be used with PrecacheController, to translate URLs into\r\n * the corresponding cache key, based on the current revision info.\r\n *\r\n * @private\r\n */\r\nclass PrecacheCacheKeyPlugin {\r\n constructor({ precacheController }) {\r\n this.cacheKeyWillBeUsed = async ({ request, params, }) => {\r\n // Params is type any, can't change right now.\r\n /* eslint-disable */\r\n const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\r\n this._precacheController.getCacheKeyForURL(request.url);\r\n /* eslint-enable */\r\n return cacheKey\r\n ? new Request(cacheKey, { headers: request.headers })\r\n : request;\r\n };\r\n this._precacheController = precacheController;\r\n }\r\n}\r\nexport { PrecacheCacheKeyPlugin };\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\nlet supportStatus;\r\n/**\r\n * A utility function that determines whether the current browser supports\r\n * constructing a new `Response` from a `response.body` stream.\r\n *\r\n * @return {boolean} `true`, if the current browser can successfully\r\n * construct a `Response` from a `response.body` stream, `false` otherwise.\r\n *\r\n * @private\r\n */\r\nfunction canConstructResponseFromBodyStream() {\r\n if (supportStatus === undefined) {\r\n const testResponse = new Response('');\r\n if ('body' in testResponse) {\r\n try {\r\n new Response(testResponse.body);\r\n supportStatus = true;\r\n }\r\n catch (error) {\r\n supportStatus = false;\r\n }\r\n }\r\n supportStatus = false;\r\n }\r\n return supportStatus;\r\n}\r\nexport { canConstructResponseFromBodyStream };\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { PrecacheController } from '../PrecacheController.js';\r\nimport '../_version.js';\r\nlet precacheController;\r\n/**\r\n * @return {PrecacheController}\r\n * @private\r\n */\r\nexport const getOrCreatePrecacheController = () => {\r\n if (!precacheController) {\r\n precacheController = new PrecacheController();\r\n }\r\n return precacheController;\r\n};\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\r\nimport { WorkboxError } from './_private/WorkboxError.js';\r\nimport './_version.js';\r\n/**\r\n * Allows developers to copy a response and modify its `headers`, `status`,\r\n * or `statusText` values (the values settable via a\r\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\r\n * object in the constructor).\r\n * To modify these values, pass a function as the second argument. That\r\n * function will be invoked with a single object with the response properties\r\n * `{headers, status, statusText}`. The return value of this function will\r\n * be used as the `ResponseInit` for the new `Response`. To change the values\r\n * either modify the passed parameter(s) and return it, or return a totally\r\n * new object.\r\n *\r\n * This method is intentionally limited to same-origin responses, regardless of\r\n * whether CORS was used or not.\r\n *\r\n * @param {Response} response\r\n * @param {Function} modifier\r\n * @memberof workbox-core\r\n */\r\nasync function copyResponse(response, modifier) {\r\n let origin = null;\r\n // If response.url isn't set, assume it's cross-origin and keep origin null.\r\n if (response.url) {\r\n const responseURL = new URL(response.url);\r\n origin = responseURL.origin;\r\n }\r\n if (origin !== self.location.origin) {\r\n throw new WorkboxError('cross-origin-copy-response', { origin });\r\n }\r\n const clonedResponse = response.clone();\r\n // Create a fresh `ResponseInit` object by cloning the headers.\r\n const responseInit = {\r\n headers: new Headers(clonedResponse.headers),\r\n status: clonedResponse.status,\r\n statusText: clonedResponse.statusText,\r\n };\r\n // Apply any user modifications.\r\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\r\n // Create the new response from the body stream and `ResponseInit`\r\n // modifications. Note: not all browsers support the Response.body stream,\r\n // so fall back to reading the entire body into memory as a blob.\r\n const body = canConstructResponseFromBodyStream()\r\n ? clonedResponse.body\r\n : await clonedResponse.blob();\r\n return new Response(body, modifiedResponseInit);\r\n}\r\nexport { copyResponse };\r\n","/*\r\n Copyright 2020 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { copyResponse } from 'workbox-core/copyResponse.js';\r\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\r\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\r\nimport { Strategy } from 'workbox-strategies/Strategy.js';\r\nimport './_version.js';\r\n/**\r\n * A {@link workbox-strategies.Strategy} implementation\r\n * specifically designed to work with\r\n * {@link workbox-precaching.PrecacheController}\r\n * to both cache and fetch precached assets.\r\n *\r\n * Note: an instance of this class is created automatically when creating a\r\n * `PrecacheController`; it's generally not necessary to create this yourself.\r\n *\r\n * @extends workbox-strategies.Strategy\r\n * @memberof workbox-precaching\r\n */\r\nclass PrecacheStrategy extends Strategy {\r\n /**\r\n *\r\n * @param {Object} [options]\r\n * @param {string} [options.cacheName] Cache name to store and retrieve\r\n * requests. Defaults to the cache names provided by\r\n * {@link workbox-core.cacheNames}.\r\n * @param {Array<Object>} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}\r\n * to use in conjunction with this caching strategy.\r\n * @param {Object} [options.fetchOptions] Values passed along to the\r\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}\r\n * of all fetch() requests made by this strategy.\r\n * @param {Object} [options.matchOptions] The\r\n * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}\r\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\r\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\r\n * get the response from the network if there's a precache miss.\r\n */\r\n constructor(options = {}) {\r\n options.cacheName = cacheNames.getPrecacheName(options.cacheName);\r\n super(options);\r\n this._fallbackToNetwork =\r\n options.fallbackToNetwork === false ? false : true;\r\n // Redirected responses cannot be used to satisfy a navigation request, so\r\n // any redirected response must be \"copied\" rather than cloned, so the new\r\n // response doesn't contain the `redirected` flag. See:\r\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\r\n this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\r\n }\r\n /**\r\n * @private\r\n * @param {Request|string} request A request to run this strategy for.\r\n * @param {workbox-strategies.StrategyHandler} handler The event that\r\n * triggered the request.\r\n * @return {Promise<Response>}\r\n */\r\n async _handle(request, handler) {\r\n const response = await handler.cacheMatch(request);\r\n if (response) {\r\n return response;\r\n }\r\n // If this is an `install` event for an entry that isn't already cached,\r\n // then populate the cache.\r\n if (handler.event && handler.event.type === 'install') {\r\n return await this._handleInstall(request, handler);\r\n }\r\n // Getting here means something went wrong. An entry that should have been\r\n // precached wasn't found in the cache.\r\n return await this._handleFetch(request, handler);\r\n }\r\n async _handleFetch(request, handler) {\r\n let response;\r\n const params = (handler.params || {});\r\n // Fall back to the network if we're configured to do so.\r\n if (this._fallbackToNetwork) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.warn(`The precached response for ` +\r\n `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\r\n `found. Falling back to the network.`);\r\n }\r\n const integrityInManifest = params.integrity;\r\n const integrityInRequest = request.integrity;\r\n const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\r\n // Do not add integrity if the original request is no-cors\r\n // See https://github.com/GoogleChrome/workbox/issues/3096\r\n response = await handler.fetch(new Request(request, {\r\n integrity: request.mode !== 'no-cors'\r\n ? integrityInRequest || integrityInManifest\r\n : undefined,\r\n }));\r\n // It's only \"safe\" to repair the cache if we're using SRI to guarantee\r\n // that the response matches the precache manifest's expectations,\r\n // and there's either a) no integrity property in the incoming request\r\n // or b) there is an integrity, and it matches the precache manifest.\r\n // See https://github.com/GoogleChrome/workbox/issues/2858\r\n // Also if the original request users no-cors we don't use integrity.\r\n // See https://github.com/GoogleChrome/workbox/issues/3096\r\n if (integrityInManifest &&\r\n noIntegrityConflict &&\r\n request.mode !== 'no-cors') {\r\n this._useDefaultCacheabilityPluginIfNeeded();\r\n const wasCached = await handler.cachePut(request, response.clone());\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (wasCached) {\r\n logger.log(`A response for ${getFriendlyURL(request.url)} ` +\r\n `was used to \"repair\" the precache.`);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // This shouldn't normally happen, but there are edge cases:\r\n // https://github.com/GoogleChrome/workbox/issues/1441\r\n throw new WorkboxError('missing-precache-entry', {\r\n cacheName: this.cacheName,\r\n url: request.url,\r\n });\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\r\n // Workbox is going to handle the route.\r\n // print the routing details to the console.\r\n logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\r\n logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\r\n logger.groupCollapsed(`View request details here.`);\r\n logger.log(request);\r\n logger.groupEnd();\r\n logger.groupCollapsed(`View response details here.`);\r\n logger.log(response);\r\n logger.groupEnd();\r\n logger.groupEnd();\r\n }\r\n return response;\r\n }\r\n async _handleInstall(request, handler) {\r\n this._useDefaultCacheabilityPluginIfNeeded();\r\n const response = await handler.fetch(request);\r\n // Make sure we defer cachePut() until after we know the response\r\n // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\r\n const wasCached = await handler.cachePut(request, response.clone());\r\n if (!wasCached) {\r\n // Throwing here will lead to the `install` handler failing, which\r\n // we want to do if *any* of the responses aren't safe to cache.\r\n throw new WorkboxError('bad-precaching-response', {\r\n url: request.url,\r\n status: response.status,\r\n });\r\n }\r\n return response;\r\n }\r\n /**\r\n * This method is complex, as there a number of things to account for:\r\n *\r\n * The `plugins` array can be set at construction, and/or it might be added to\r\n * to at any time before the strategy is used.\r\n *\r\n * At the time the strategy is used (i.e. during an `install` event), there\r\n * needs to be at least one plugin that implements `cacheWillUpdate` in the\r\n * array, other than `copyRedirectedCacheableResponsesPlugin`.\r\n *\r\n * - If this method is called and there are no suitable `cacheWillUpdate`\r\n * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\r\n *\r\n * - If this method is called and there is exactly one `cacheWillUpdate`, then\r\n * we don't have to do anything (this might be a previously added\r\n * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\r\n *\r\n * - If this method is called and there is more than one `cacheWillUpdate`,\r\n * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\r\n * we need to remove it. (This situation is unlikely, but it could happen if\r\n * the strategy is used multiple times, the first without a `cacheWillUpdate`,\r\n * and then later on after manually adding a custom `cacheWillUpdate`.)\r\n *\r\n * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\r\n *\r\n * @private\r\n */\r\n _useDefaultCacheabilityPluginIfNeeded() {\r\n let defaultPluginIndex = null;\r\n let cacheWillUpdatePluginCount = 0;\r\n for (const [index, plugin] of this.plugins.entries()) {\r\n // Ignore the copy redirected plugin when determining what to do.\r\n if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\r\n continue;\r\n }\r\n // Save the default plugin's index, in case it needs to be removed.\r\n if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\r\n defaultPluginIndex = index;\r\n }\r\n if (plugin.cacheWillUpdate) {\r\n cacheWillUpdatePluginCount++;\r\n }\r\n }\r\n if (cacheWillUpdatePluginCount === 0) {\r\n this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\r\n }\r\n else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\r\n // Only remove the default plugin; multiple custom plugins are allowed.\r\n this.plugins.splice(defaultPluginIndex, 1);\r\n }\r\n // Nothing needs to be done if cacheWillUpdatePluginCount is 1\r\n }\r\n}\r\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\r\n async cacheWillUpdate({ response }) {\r\n if (!response || response.status >= 400) {\r\n return null;\r\n }\r\n return response;\r\n },\r\n};\r\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\r\n async cacheWillUpdate({ response }) {\r\n return response.redirected ? await copyResponse(response) : response;\r\n },\r\n};\r\nexport { PrecacheStrategy };\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { assert } from 'workbox-core/_private/assert.js';\r\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\r\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\r\nimport { createCacheKey } from './utils/createCacheKey.js';\r\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\r\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\r\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\r\nimport { printInstallDetails } from './utils/printInstallDetails.js';\r\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\r\nimport './_version.js';\r\n/**\r\n * Performs efficient precaching of assets.\r\n *\r\n * @memberof workbox-precaching\r\n */\r\nclass PrecacheController {\r\n /**\r\n * Create a new PrecacheController.\r\n *\r\n * @param {Object} [options]\r\n * @param {string} [options.cacheName] The cache to use for precaching.\r\n * @param {string} [options.plugins] Plugins to use when precaching as well\r\n * as responding to fetch events for precached assets.\r\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\r\n * get the response from the network if there's a precache miss.\r\n */\r\n constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\r\n this._urlsToCacheKeys = new Map();\r\n this._urlsToCacheModes = new Map();\r\n this._cacheKeysToIntegrities = new Map();\r\n this._strategy = new PrecacheStrategy({\r\n cacheName: cacheNames.getPrecacheName(cacheName),\r\n plugins: [\r\n ...plugins,\r\n new PrecacheCacheKeyPlugin({ precacheController: this }),\r\n ],\r\n fallbackToNetwork,\r\n });\r\n // Bind the install and activate methods to the instance.\r\n this.install = this.install.bind(this);\r\n this.activate = this.activate.bind(this);\r\n }\r\n /**\r\n * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and\r\n * used to cache assets and respond to fetch events.\r\n */\r\n get strategy() {\r\n return this._strategy;\r\n }\r\n /**\r\n * Adds items to the precache list, removing any duplicates and\r\n * stores the files in the\r\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\r\n * worker installs.\r\n *\r\n * This method can be called multiple times.\r\n *\r\n * @param {Array<Object|string>} [entries=[]] Array of entries to precache.\r\n */\r\n precache(entries) {\r\n this.addToCacheList(entries);\r\n if (!this._installAndActiveListenersAdded) {\r\n self.addEventListener('install', this.install);\r\n self.addEventListener('activate', this.activate);\r\n this._installAndActiveListenersAdded = true;\r\n }\r\n }\r\n /**\r\n * This method will add items to the precache list, removing duplicates\r\n * and ensuring the information is valid.\r\n *\r\n * @param {Array<workbox-precaching.PrecacheController.PrecacheEntry|string>} entries\r\n * Array of entries to precache.\r\n */\r\n addToCacheList(entries) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.isArray(entries, {\r\n moduleName: 'workbox-precaching',\r\n className: 'PrecacheController',\r\n funcName: 'addToCacheList',\r\n paramName: 'entries',\r\n });\r\n }\r\n const urlsToWarnAbout = [];\r\n for (const entry of entries) {\r\n // See https://github.com/GoogleChrome/workbox/issues/2259\r\n if (typeof entry === 'string') {\r\n urlsToWarnAbout.push(entry);\r\n }\r\n else if (entry && entry.revision === undefined) {\r\n urlsToWarnAbout.push(entry.url);\r\n }\r\n const { cacheKey, url } = createCacheKey(entry);\r\n const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\r\n if (this._urlsToCacheKeys.has(url) &&\r\n this._urlsToCacheKeys.get(url) !== cacheKey) {\r\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\r\n firstEntry: this._urlsToCacheKeys.get(url),\r\n secondEntry: cacheKey,\r\n });\r\n }\r\n if (typeof entry !== 'string' && entry.integrity) {\r\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\r\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\r\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\r\n url,\r\n });\r\n }\r\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\r\n }\r\n this._urlsToCacheKeys.set(url, cacheKey);\r\n this._urlsToCacheModes.set(url, cacheMode);\r\n if (urlsToWarnAbout.length > 0) {\r\n const warningMessage = `Workbox is precaching URLs without revision ` +\r\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\r\n `Learn more at https://bit.ly/wb-precache`;\r\n if (process.env.NODE_ENV === 'production') {\r\n // Use console directly to display this warning without bloating\r\n // bundle sizes by pulling in all of the logger codebase in prod.\r\n console.warn(warningMessage);\r\n }\r\n else {\r\n logger.warn(warningMessage);\r\n }\r\n }\r\n }\r\n }\r\n /**\r\n * Precaches new and updated assets. Call this method from the service worker\r\n * install event.\r\n *\r\n * Note: this method calls `event.waitUntil()` for you, so you do not need\r\n * to call it yourself in your event handlers.\r\n *\r\n * @param {ExtendableEvent} event\r\n * @return {Promise<workbox-precaching.InstallResult>}\r\n */\r\n install(event) {\r\n // waitUntil returns Promise<any>\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\r\n return waitUntil(event, async () => {\r\n const installReportPlugin = new PrecacheInstallReportPlugin();\r\n this.strategy.plugins.push(installReportPlugin);\r\n // Cache entries one at a time.\r\n // See https://github.com/GoogleChrome/workbox/issues/2528\r\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\r\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\r\n const cacheMode = this._urlsToCacheModes.get(url);\r\n const request = new Request(url, {\r\n integrity,\r\n cache: cacheMode,\r\n credentials: 'same-origin',\r\n });\r\n await Promise.all(this.strategy.handleAll({\r\n params: { cacheKey },\r\n request,\r\n event,\r\n }));\r\n }\r\n const { updatedURLs, notUpdatedURLs } = installReportPlugin;\r\n if (process.env.NODE_ENV !== 'production') {\r\n printInstallDetails(updatedURLs, notUpdatedURLs);\r\n }\r\n return { updatedURLs, notUpdatedURLs };\r\n });\r\n }\r\n /**\r\n * Deletes assets that are no longer present in the current precache manifest.\r\n * Call this method from the service worker activate event.\r\n *\r\n * Note: this method calls `event.waitUntil()` for you, so you do not need\r\n * to call it yourself in your event handlers.\r\n *\r\n * @param {ExtendableEvent} event\r\n * @return {Promise<workbox-precaching.CleanupResult>}\r\n */\r\n activate(event) {\r\n // waitUntil returns Promise<any>\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\r\n return waitUntil(event, async () => {\r\n const cache = await self.caches.open(this.strategy.cacheName);\r\n const currentlyCachedRequests = await cache.keys();\r\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\r\n const deletedURLs = [];\r\n for (const request of currentlyCachedRequests) {\r\n if (!expectedCacheKeys.has(request.url)) {\r\n await cache.delete(request);\r\n deletedURLs.push(request.url);\r\n }\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n printCleanupDetails(deletedURLs);\r\n }\r\n return { deletedURLs };\r\n });\r\n }\r\n /**\r\n * Returns a mapping of a precached URL to the corresponding cache key, taking\r\n * into account the revision information for the URL.\r\n *\r\n * @return {Map<string, string>} A URL to cache key mapping.\r\n */\r\n getURLsToCacheKeys() {\r\n return this._urlsToCacheKeys;\r\n }\r\n /**\r\n * Returns a list of all the URLs that have been precached by the current\r\n * service worker.\r\n *\r\n * @return {Array<string>} The precached URLs.\r\n */\r\n getCachedURLs() {\r\n return [...this._urlsToCacheKeys.keys()];\r\n }\r\n /**\r\n * Returns the cache key used for storing a given URL. If that URL is\r\n * unversioned, like `/index.html', then the cache key will be the original\r\n * URL with a search parameter appended to it.\r\n *\r\n * @param {string} url A URL whose cache key you want to look up.\r\n * @return {string} The versioned URL that corresponds to a cache key\r\n * for the original URL, or undefined if that URL isn't precached.\r\n */\r\n getCacheKeyForURL(url) {\r\n const urlObject = new URL(url, location.href);\r\n return this._urlsToCacheKeys.get(urlObject.href);\r\n }\r\n /**\r\n * @param {string} url A cache key whose SRI you want to look up.\r\n * @return {string} The subresource integrity associated with the cache key,\r\n * or undefined if it's not set.\r\n */\r\n getIntegrityForCacheKey(cacheKey) {\r\n return this._cacheKeysToIntegrities.get(cacheKey);\r\n }\r\n /**\r\n * This acts as a drop-in replacement for\r\n * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\r\n * with the following differences:\r\n *\r\n * - It knows what the name of the precache is, and only checks in that cache.\r\n * - It allows you to pass in an \"original\" URL without versioning parameters,\r\n * and it will automatically look up the correct cache key for the currently\r\n * active revision of that URL.\r\n *\r\n * E.g., `matchPrecache('index.html')` will find the correct precached\r\n * response for the currently active service worker, even if the actual cache\r\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\r\n *\r\n * @param {string|Request} request The key (without revisioning parameters)\r\n * to look up in the precache.\r\n * @return {Promise<Response|undefined>}\r\n */\r\n async matchPrecache(request) {\r\n const url = request instanceof Request ? request.url : request;\r\n const cacheKey = this.getCacheKeyForURL(url);\r\n if (cacheKey) {\r\n const cache = await self.caches.open(this.strategy.cacheName);\r\n return cache.match(cacheKey);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Returns a function that looks up `url` in the precache (taking into\r\n * account revision information), and returns the corresponding `Response`.\r\n *\r\n * @param {string} url The precached URL which will be used to lookup the\r\n * `Response`.\r\n * @return {workbox-routing~handlerCallback}\r\n */\r\n createHandlerBoundToURL(url) {\r\n const cacheKey = this.getCacheKeyForURL(url);\r\n if (!cacheKey) {\r\n throw new WorkboxError('non-precached-url', { url });\r\n }\r\n return (options) => {\r\n options.request = new Request(url);\r\n options.params = Object.assign({ cacheKey }, options.params);\r\n return this.strategy.handle(options);\r\n };\r\n }\r\n}\r\nexport { PrecacheController };\r\n","/*\r\n Copyright 2020 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\r\nimport { Route } from 'workbox-routing/Route.js';\r\nimport { generateURLVariations } from './utils/generateURLVariations.js';\r\nimport './_version.js';\r\n/**\r\n * A subclass of {@link workbox-routing.Route} that takes a\r\n * {@link workbox-precaching.PrecacheController}\r\n * instance and uses it to match incoming requests and handle fetching\r\n * responses from the precache.\r\n *\r\n * @memberof workbox-precaching\r\n * @extends workbox-routing.Route\r\n */\r\nclass PrecacheRoute extends Route {\r\n /**\r\n * @param {PrecacheController} precacheController A `PrecacheController`\r\n * instance used to both match requests and respond to fetch events.\r\n * @param {Object} [options] Options to control how requests are matched\r\n * against the list of precached URLs.\r\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\r\n * check cache entries for a URLs ending with '/' to see if there is a hit when\r\n * appending the `directoryIndex` value.\r\n * @param {Array<RegExp>} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\r\n * array of regex's to remove search params when looking for a cache match.\r\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\r\n * check the cache for the URL with a `.html` added to the end of the end.\r\n * @param {workbox-precaching~urlManipulation} [options.urlManipulation]\r\n * This is a function that should take a URL and return an array of\r\n * alternative URLs that should be checked for precache matches.\r\n */\r\n constructor(precacheController, options) {\r\n const match = ({ request, }) => {\r\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\r\n for (const possibleURL of generateURLVariations(request.url, options)) {\r\n const cacheKey = urlsToCacheKeys.get(possibleURL);\r\n if (cacheKey) {\r\n const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\r\n return { cacheKey, integrity };\r\n }\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\r\n }\r\n return;\r\n };\r\n super(match, precacheController.strategy);\r\n }\r\n}\r\nexport { PrecacheRoute };\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\r\nimport '../_version.js';\r\n/**\r\n * Generator function that yields possible variations on the original URL to\r\n * check, one at a time.\r\n *\r\n * @param {string} url\r\n * @param {Object} options\r\n *\r\n * @private\r\n * @memberof workbox-precaching\r\n */\r\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\r\n const urlObject = new URL(url, location.href);\r\n urlObject.hash = '';\r\n yield urlObject.href;\r\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\r\n yield urlWithoutIgnoredParams.href;\r\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\r\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\r\n directoryURL.pathname += directoryIndex;\r\n yield directoryURL.href;\r\n }\r\n if (cleanURLs) {\r\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\r\n cleanURL.pathname += '.html';\r\n yield cleanURL.href;\r\n }\r\n if (urlManipulation) {\r\n const additionalURLs = urlManipulation({ url: urlObject });\r\n for (const urlToAttempt of additionalURLs) {\r\n yield urlToAttempt.href;\r\n }\r\n }\r\n}\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport '../_version.js';\r\n/**\r\n * Removes any URL search parameters that should be ignored.\r\n *\r\n * @param {URL} urlObject The original URL.\r\n * @param {Array<RegExp>} ignoreURLParametersMatching RegExps to test against\r\n * each search parameter name. Matches mean that the search parameter should be\r\n * ignored.\r\n * @return {URL} The URL with any ignored search parameters removed.\r\n *\r\n * @private\r\n * @memberof workbox-precaching\r\n */\r\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\r\n // Convert the iterable into an array at the start of the loop to make sure\r\n // deletion doesn't mess up iteration.\r\n for (const paramName of [...urlObject.searchParams.keys()]) {\r\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\r\n urlObject.searchParams.delete(paramName);\r\n }\r\n }\r\n return urlObject;\r\n}\r\n","/*\r\n Copyright 2018 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { assert } from 'workbox-core/_private/assert.js';\r\nimport { logger } from 'workbox-core/_private/logger.js';\r\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\r\nimport { Strategy } from './Strategy.js';\r\nimport { messages } from './utils/messages.js';\r\nimport './_version.js';\r\n/**\r\n * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)\r\n * request strategy.\r\n *\r\n * A cache first strategy is useful for assets that have been revisioned,\r\n * such as URLs like `/styles/example.a8f5f1.css`, since they\r\n * can be cached for long periods of time.\r\n *\r\n * If the network request fails, and there is no cache match, this will throw\r\n * a `WorkboxError` exception.\r\n *\r\n * @extends workbox-strategies.Strategy\r\n * @memberof workbox-strategies\r\n */\r\nclass CacheFirst extends Strategy {\r\n /**\r\n * @private\r\n * @param {Request|string} request A request to run this strategy for.\r\n * @param {workbox-strategies.StrategyHandler} handler The event that\r\n * triggered the request.\r\n * @return {Promise<Response>}\r\n */\r\n async _handle(request, handler) {\r\n const logs = [];\r\n if (process.env.NODE_ENV !== 'production') {\r\n assert.isInstance(request, Request, {\r\n moduleName: 'workbox-strategies',\r\n className: this.constructor.name,\r\n funcName: 'makeRequest',\r\n paramName: 'request',\r\n });\r\n }\r\n let response = await handler.cacheMatch(request);\r\n let error = undefined;\r\n if (!response) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logs.push(`No response found in the '${this.cacheName}' cache. ` +\r\n `Will respond with a network request.`);\r\n }\r\n try {\r\n response = await handler.fetchAndCachePut(request);\r\n }\r\n catch (err) {\r\n if (err instanceof Error) {\r\n error = err;\r\n }\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (response) {\r\n logs.push(`Got response from network.`);\r\n }\r\n else {\r\n logs.push(`Unable to get a response from the network.`);\r\n }\r\n }\r\n }\r\n else {\r\n if (process.env.NODE_ENV !== 'production') {\r\n logs.push(`Found a cached response in the '${this.cacheName}' cache.`);\r\n }\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\r\n for (const log of logs) {\r\n logger.log(log);\r\n }\r\n messages.printFinalResponse(response);\r\n logger.groupEnd();\r\n }\r\n if (!response) {\r\n throw new WorkboxError('no-response', { url: request.url, error });\r\n }\r\n return response;\r\n }\r\n}\r\nexport { CacheFirst };\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport './_version.js';\r\n/**\r\n * Claim any currently available clients once the service worker\r\n * becomes active. This is normally used in conjunction with `skipWaiting()`.\r\n *\r\n * @memberof workbox-core\r\n */\r\nfunction clientsClaim() {\r\n self.addEventListener('activate', () => self.clients.claim());\r\n}\r\nexport { clientsClaim };\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { addRoute } from './addRoute.js';\r\nimport { precache } from './precache.js';\r\nimport './_version.js';\r\n/**\r\n * This method will add entries to the precache list and add a route to\r\n * respond to fetch events.\r\n *\r\n * This is a convenience method that will call\r\n * {@link workbox-precaching.precache} and\r\n * {@link workbox-precaching.addRoute} in a single call.\r\n *\r\n * @param {Array<Object|string>} entries Array of entries to precache.\r\n * @param {Object} [options] See the\r\n * {@link workbox-precaching.PrecacheRoute} options.\r\n *\r\n * @memberof workbox-precaching\r\n */\r\nfunction precacheAndRoute(entries, options) {\r\n precache(entries);\r\n addRoute(options);\r\n}\r\nexport { precacheAndRoute };\r\n","/*\r\n Copyright 2019 Google LLC\r\n\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\r\nimport './_version.js';\r\n/**\r\n * Adds items to the precache list, removing any duplicates and\r\n * stores the files in the\r\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\r\n * worker installs.\r\n *\r\n * This method can be called multiple times.\r\n *\r\n * Please note: This method **will not** serve any of the cached files for you.\r\n * It only precaches files. To respond to a network request you call\r\n * {@link workbox-precaching.addRoute}.\r\n *\r\n * If you have a single array of files to precache, you can just call\r\n * {@link workbox-precaching.precacheAndRoute}.\r\n *\r\n * @param {Array<Object|string>} [entries=[]] Array of entries to precache.\r\n *\r\n * @memberof workbox-precaching\r\n */\r\nfunction precache(entries) {\r\n const precacheController = getOrCreatePrecacheController();\r\n precacheController.precache(entries);\r\n}\r\nexport { precache };\r\n","/*\r\n Copyright 2019 Google LLC\r\n Use of this source code is governed by an MIT-style\r\n license that can be found in the LICENSE file or at\r\n https://opensource.org/licenses/MIT.\r\n*/\r\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\r\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\r\nimport { PrecacheRoute } from './PrecacheRoute.js';\r\nimport './_version.js';\r\n/**\r\n * Add a `fetch` listener to the service worker that will\r\n * respond to\r\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\r\n * with precached assets.\r\n *\r\n * Requests for assets that aren't precached, the `FetchEvent` will not be\r\n * responded to, allowing the event to fall through to other `fetch` event\r\n * listeners.\r\n *\r\n * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}\r\n * options.\r\n *\r\n * @memberof workbox-precaching\r\n */\r\nfunction addRoute(options) {\r\n const precacheController = getOrCreatePrecacheController();\r\n const precacheRoute = new PrecacheRoute(precacheController, options);\r\n registerRoute(precacheRoute);\r\n}\r\nexport { addRoute };\r\n"],"names":["self","_","e","messageGenerator","fallback","code","args","msg","length","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","super","this","name","normalizeHandler","handler","handle","Route","match","method","setCatchHandler","catchHandler","RegExpRoute","regExp","url","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","addFetchListener","addEventListener","event","request","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","requestPromises","Promise","all","urlsToCache","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","has","get","err","reject","_catchHandler","catch","async","catchErr","matchResult","Array","isArray","Object","keys","undefined","setDefaultHandler","set","registerRoute","push","unregisterRoute","routeIndex","indexOf","splice","defaultRouter","getOrCreateDefaultRouter","capture","captureUrl","matchCallback","RegExp","moduleName","funcName","paramName","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","join","cacheNames","userCacheName","stripParams","fullURL","ignoreParams","strippedURL","param","searchParams","delete","Deferred","promise","resolve","quotaErrorCallbacks","Set","toRequest","input","StrategyHandler","strategy","options","_cacheKeys","assign","_strategy","_handlerDeferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","plugin","mode","FetchEvent","preloadResponse","possiblePreloadResponse","originalRequest","hasCallback","clone","cb","iterateCallbacks","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","fetch","fetchOptions","callback","response","error","runCallbacks","responseClone","cachePut","key","cachedResponse","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","ms","setTimeout","String","replace","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","strippedRequestURL","keysOptions","ignoreSearch","cacheKeys","cacheKey","cacheMatchIgnoreParams","put","executeQuotaErrorCallbacks","newResponse","state","statefulCallback","statefulParam","shift","destroy","pluginsUsed","status","Strategy","responseDone","handleAll","_getResponse","_awaitComplete","_handle","doneWaiting","waitUntilError","asyncFn","returnPromise","createCacheKey","urlObject","revision","cacheKeyURL","originalURL","PrecacheInstallReportPlugin","updatedURLs","notUpdatedURLs","handlerWillStart","cachedResponseWillBeUsed","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","_precacheController","getCacheKeyForURL","headers","supportStatus","copyResponse","modifier","clonedResponse","responseInit","Headers","statusText","modifiedResponseInit","body","testResponse","Response","canConstructResponseFromBodyStream","blob","PrecacheStrategy","_fallbackToNetwork","fallbackToNetwork","copyRedirectedCacheableResponsesPlugin","cacheMatch","_handleInstall","_handleFetch","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","_useDefaultCacheabilityPluginIfNeeded","defaultPluginIndex","cacheWillUpdatePluginCount","entries","defaultPrecacheCacheabilityPlugin","cacheWillUpdate","redirected","PrecacheController","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","install","bind","activate","addToCacheList","_installAndActiveListenersAdded","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","warningMessage","console","warn","installReportPlugin","credentials","currentlyCachedRequests","expectedCacheKeys","values","deletedURLs","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","createHandlerBoundToURL","getOrCreatePrecacheController","PrecacheRoute","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","some","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","fetchAndCachePut","clients","claim","addRoute"],"mappings":"6CAEA,IACIA,KAAK,uBAAyBC,GAClC,CACA,MAAOC,GAAG,CCEV,MCgBaC,EAdIC,CAACC,KAASC,KACvB,IAAIC,EAAMF,EAIV,OAHIC,EAAKE,OAAS,IACdD,GAAQ,OAAME,KAAKC,UAAUJ,MAE1BC,CAAG,ECId,MAAMI,UAAqBC,MASvBC,YAAYC,EAAWC,GAEnBC,MADgBb,EAAiBW,EAAWC,IAE5CE,KAAKC,KAAOJ,EACZG,KAAKF,QAAUA,CACnB,EC9BJ,IACIf,KAAK,0BAA4BC,GACrC,CACA,MAAOC,GAAG,CCWH,MCAMiB,EAAoBC,GACzBA,GAA8B,iBAAZA,EASXA,EAWA,CAAEC,OAAQD,GCjBzB,MAAME,EAYFT,YAAYU,EAAOH,EAASI,EFhBH,OE8BrBP,KAAKG,QAAUD,EAAiBC,GAChCH,KAAKM,MAAQA,EACbN,KAAKO,OAASA,CAClB,CAMAC,gBAAgBL,GACZH,KAAKS,aAAeP,EAAiBC,EACzC,ECnCJ,MAAMO,UAAoBL,EActBT,YAAYe,EAAQR,EAASI,GAiCzBR,OAxBcO,EAAGM,UACb,MAAMC,EAASF,EAAOG,KAAKF,EAAIG,MAE/B,GAAKF,IAODD,EAAII,SAAWC,SAASD,QAA2B,IAAjBH,EAAO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