mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-22 14:52:17 +01:00
Remove service worker from v4.0 and v4.1.
This commit is contained in:
parent
915830f154
commit
3a0c275069
4
docs/4.0/assets/js/docs.min.js
vendored
4
docs/4.0/assets/js/docs.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,17 +0,0 @@
|
||||
/* eslint no-console:off */
|
||||
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function () {
|
||||
navigator.serviceWorker.register('/sw.js').then(function (registration) { // eslint-disable-line compat/compat
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope)
|
||||
}).catch(function (err) {
|
||||
console.log('ServiceWorker registration failed: ', err)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
console.log('Service workers are not supported.')
|
||||
}
|
||||
}())
|
187
docs/4.0/assets/js/vendor/workbox-sw.prod.v2.1.0.js
vendored
187
docs/4.0/assets/js/vendor/workbox-sw.prod.v2.1.0.js
vendored
@ -1,187 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
var WorkboxSW = (function () {
|
||||
'use strict';
|
||||
|
||||
class ErrorFactory$1{constructor(a){this._errors=a;}createError(a,b){if(!(a in this._errors))throw new Error(`Unable to generate error '${a}'.`);let c=this._errors[a].replace(/\s+/g,' '),d=null;b&&(c+=` [${b.message}]`,d=b.stack);const e=new Error;return e.name=a,e.message=c,e.stack=d,e}}
|
||||
|
||||
const errors={"not-in-sw":'workbox-sw must be loaded in your service worker file.',"unsupported-route-type":'The first parameter to registerRoute() should be either an Express-style path string, a RegExp, or a function.',"empty-express-string":'The Express style route string must have some characters, an empty string is invalid.',"bad-revisioned-cache-list":`The 'precache()' method expects`+`an array of revisioned urls like so: ['/example/hello.1234.txt', `+`{path: 'hello.txt', revision: '1234'}]`,"navigation-route-url-string":`The registerNavigationRoute() method `+`expects a URL string as its first parameter.`,"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character`,"bad-skip-waiting":`The 'skipWaiting' parameter must be a boolean.`,"bad-clients-claim":`The 'clientsClaim' parameter must be a boolean.`,"bad-directory-index":`The 'directoryIndex' parameter must be a boolean.`};var ErrorFactory = new ErrorFactory$1(errors);
|
||||
|
||||
const errors$1={"express-route-invalid-path":`When using ExpressRoute, you must
|
||||
provide a path that starts with a '/' character (to match same-origin
|
||||
requests) or that starts with 'http' (to match cross-origin requests)`};var ErrorFactory$3 = new ErrorFactory$1(errors$1);
|
||||
|
||||
var ErrorStackParser = {parse:()=>[]};
|
||||
|
||||
function atLeastOne(a){const b=Object.keys(a);b.some((b)=>a[b]!==void 0)||throwError('Please set at least one of the following parameters: '+b.map((a)=>`'${a}'`).join(', '));}function hasMethod(a,b){const c=Object.keys(a).pop(),d=typeof a[c][b];'function'!=d&&throwError(`The '${c}' parameter must be an object that exposes a
|
||||
'${b}' method.`);}function isInstance(a,b){const c=Object.keys(a).pop();a[c]instanceof b||throwError(`The '${c}' parameter must be an instance of
|
||||
'${b.name}'`);}function isOneOf(a,b){const c=Object.keys(a).pop();b.includes(a[c])||throwError(`The '${c}' parameter must be set to one of the
|
||||
following: ${b}`);}function isType(a,b){const c=Object.keys(a).pop(),d=typeof a[c];d!==b&&throwError(`The '${c}' parameter has the wrong type. (Expected:
|
||||
${b}, actual: ${d})`);}function isArrayOfType(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing
|
||||
one or more '${b}' elements.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])typeof e!==b&&throwError(d);}function isArrayOfClass(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing
|
||||
one or more '${b.name}' instances.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])e instanceof b||throwError(d);}function throwError(a){a=a.replace(/\s+/g,' ');const b=new Error(a);b.name='assertion-failed';const c=ErrorStackParser.parse(b);throw 3<=c.length&&(b.message=`Invalid call to ${c[2].functionName}() — `+a),b}
|
||||
|
||||
function normalizeHandler(a){return'object'==typeof a?(hasMethod({handler:a},'handle'),a):(isType({handler:a},'function'),{handle:a})}
|
||||
|
||||
const defaultMethod='GET';const validMethods=['DELETE','GET','HEAD','POST','PUT'];
|
||||
|
||||
class Route{constructor({match:a,handler:b,method:c}={}){this.handler=normalizeHandler(b),isType({match:a},'function'),this.match=a,c?(isOneOf({method:c},validMethods),this.method=c):this.method=defaultMethod;}}
|
||||
|
||||
var index$1=Array.isArray||function(a){return'[object Array]'==Object.prototype.toString.call(a)};
|
||||
|
||||
var index=pathToRegexp; var parse_1=parse; var compile_1=compile; var tokensToFunction_1=tokensToFunction; var tokensToRegExp_1=tokensToRegExp; var PATH_REGEXP=new RegExp('(\\\\.)|([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))','g');function parse(a,b){for(var c,d=[],e=0,f=0,g='',h=b&&b.delimiter||'/';null!=(c=PATH_REGEXP.exec(a));){var i=c[0],j=c[1],k=c.index;if(g+=a.slice(f,k),f=k+i.length,j){g+=j[1];continue}var l=a[f],m=c[2],n=c[3],o=c[4],p=c[5],q=c[6],r=c[7];g&&(d.push(g),g='');var s=c[2]||h,t=o||p;d.push({name:n||e++,prefix:m||'',delimiter:s,optional:'?'===q||'*'===q,repeat:'+'===q||'*'===q,partial:null!=m&&null!=l&&l!==m,asterisk:!!r,pattern:t?escapeGroup(t):r?'.*':'[^'+escapeString(s)+']+?'});}return f<a.length&&(g+=a.substr(f)),g&&d.push(g),d}function compile(a,b){return tokensToFunction(parse(a,b))}function encodeURIComponentPretty(a){return encodeURI(a).replace(/[\/?#]/g,function(a){return'%'+a.charCodeAt(0).toString(16).toUpperCase()})}function encodeAsterisk(a){return encodeURI(a).replace(/[?#]/g,function(a){return'%'+a.charCodeAt(0).toString(16).toUpperCase()})}function tokensToFunction(a){for(var b=Array(a.length),c=0;c<a.length;c++)'object'==typeof a[c]&&(b[c]=new RegExp('^(?:'+a[c].pattern+')$'));return function(c,d){for(var e,f='',g=c||{},h=d||{},k=h.pretty?encodeURIComponentPretty:encodeURIComponent,l=0;l<a.length;l++){if(e=a[l],'string'==typeof e){f+=e;continue}var i,m=g[e.name];if(null==m)if(e.optional){e.partial&&(f+=e.prefix);continue}else throw new TypeError('Expected "'+e.name+'" to be defined');if(index$1(m)){if(!e.repeat)throw new TypeError('Expected "'+e.name+'" to not repeat, but received `'+JSON.stringify(m)+'`');if(0===m.length)if(e.optional)continue;else throw new TypeError('Expected "'+e.name+'" to not be empty');for(var n=0;n<m.length;n++){if(i=k(m[n]),!b[l].test(i))throw new TypeError('Expected all "'+e.name+'" to match "'+e.pattern+'", but received `'+JSON.stringify(i)+'`');f+=(0===n?e.prefix:e.delimiter)+i;}continue}if(i=e.asterisk?encodeAsterisk(m):k(m),!b[l].test(i))throw new TypeError('Expected "'+e.name+'" to match "'+e.pattern+'", but received "'+i+'"');f+=e.prefix+i;}return f}}function escapeString(a){return a.replace(/([.+*?=^!:${}()[\]|\/\\])/g,'\\$1')}function escapeGroup(a){return a.replace(/([=!:$\/()])/g,'\\$1')}function attachKeys(a,b){return a.keys=b,a}function flags(a){return a.sensitive?'':'i'}function regexpToRegexp(a,b){var c=a.source.match(/\((?!\?)/g);if(c)for(var d=0;d<c.length;d++)b.push({name:d,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return attachKeys(a,b)}function arrayToRegexp(a,b,c){for(var d=[],e=0;e<a.length;e++)d.push(pathToRegexp(a[e],b,c).source);var f=new RegExp('(?:'+d.join('|')+')',flags(c));return attachKeys(f,b)}function stringToRegexp(a,b,c){return tokensToRegExp(parse(a,c),b,c)}function tokensToRegExp(a,b,c){index$1(b)||(c=b||c,b=[]),c=c||{};for(var d,e=c.strict,f=!1!==c.end,g='',h=0;h<a.length;h++)if(d=a[h],'string'==typeof d)g+=escapeString(d);else{var i=escapeString(d.prefix),j='(?:'+d.pattern+')';b.push(d),d.repeat&&(j+='(?:'+i+j+')*'),j=d.optional?d.partial?i+'('+j+')?':'(?:'+i+'('+j+'))?':i+'('+j+')',g+=j;}var k=escapeString(c.delimiter||'/'),l=g.slice(-k.length)===k;return e||(g=(l?g.slice(0,-k.length):g)+'(?:'+k+'(?=$))?'),g+=f?'$':e&&l?'':'(?='+k+'|$)',attachKeys(new RegExp('^'+g,flags(c)),b)}function pathToRegexp(a,b,c){return index$1(b)||(c=b||c,b=[]),c=c||{},a instanceof RegExp?regexpToRegexp(a,b):index$1(a)?arrayToRegexp(a,b,c):stringToRegexp(a,b,c)}index.parse=parse_1,index.compile=compile_1,index.tokensToFunction=tokensToFunction_1,index.tokensToRegExp=tokensToRegExp_1;
|
||||
|
||||
class ExpressRoute extends Route{constructor({path:a,handler:b,method:c}){if(!(a.startsWith('/')||a.startsWith('http')))throw ErrorFactory$3.createError('express-route-invalid-path');let d=[];const e=index(a,d);super({match:({url:b})=>{if(a.startsWith('/')&&b.origin!==location.origin)return null;const c=a.startsWith('/')?b.pathname:b.href,f=c.match(e);if(!f)return null;const g={};return d.forEach((a,b)=>{g[a.name]=f[b+1];}),g},handler:b,method:c});}}
|
||||
|
||||
class LogGroup{constructor(){this._logs=[],this._childGroups=[],this._isFallbackMode=!1;const a=/Firefox\/(\d*)\.\d*/.exec(navigator.userAgent);if(a)try{const b=parseInt(a[1],10);55>b&&(this._isFallbackMode=!0);}catch(a){this._isFallbackMode=!0;}/Edge\/\d*\.\d*/.exec(navigator.userAgent)&&(this._isFallbackMode=!0);}addPrimaryLog(a){this._primaryLog=a;}addLog(a){this._logs.push(a);}addChildGroup(a){0===a._logs.length||this._childGroups.push(a);}print(){return 0===this._logs.length&&0===this._childGroups.length?void this._printLogDetails(this._primaryLog):void(this._primaryLog&&(this._isFallbackMode?this._printLogDetails(this._primaryLog):console.groupCollapsed(...this._getLogContent(this._primaryLog))),this._logs.forEach((a)=>{this._printLogDetails(a);}),this._childGroups.forEach((a)=>{a.print();}),this._primaryLog&&!this._isFallbackMode&&console.groupEnd())}_printLogDetails(a){const b=a.logFunc?a.logFunc:console.log;b(...this._getLogContent(a));}_getLogContent(a){let b=a.message;this._isFallbackMode&&'string'==typeof b&&(b=b.replace(/%c/g,''));let c=[b];return!this._isFallbackMode&&a.colors&&(c=c.concat(a.colors)),a.args&&(c=c.concat(a.args)),c}}
|
||||
|
||||
function isServiceWorkerGlobalScope(){return'ServiceWorkerGlobalScope'in self&&self instanceof ServiceWorkerGlobalScope}function isDevBuild(){return`dev`==`prod`}function isLocalhost(){return!!('localhost'===location.hostname||'[::1]'===location.hostname||location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))}
|
||||
|
||||
self.workbox=self.workbox||{},self.workbox.LOG_LEVEL=self.workbox.LOG_LEVEL||{none:-1,verbose:0,debug:1,warn:2,error:3};const LIGHT_GREY=`#bdc3c7`; const DARK_GREY=`#7f8c8d`; const LIGHT_GREEN=`#2ecc71`; const LIGHT_YELLOW=`#f1c40f`; const LIGHT_RED=`#e74c3c`; const LIGHT_BLUE=`#3498db`;class LogHelper{constructor(){this._defaultLogLevel=isDevBuild()?self.workbox.LOG_LEVEL.debug:self.workbox.LOG_LEVEL.warn;}log(a){this._printMessage(self.workbox.LOG_LEVEL.verbose,a);}debug(a){this._printMessage(self.workbox.LOG_LEVEL.debug,a);}warn(a){this._printMessage(self.workbox.LOG_LEVEL.warn,a);}error(a){this._printMessage(self.workbox.LOG_LEVEL.error,a);}_printMessage(a,b){if(this._shouldLogMessage(a,b)){const c=this._getAllLogGroups(a,b);c.print();}}_getAllLogGroups(a,b){const c=new LogGroup,d=this._getPrimaryMessageDetails(a,b);if(c.addPrimaryLog(d),b.error){const a={message:b.error,logFunc:console.error};c.addLog(a);}const e=new LogGroup;if(b.that&&b.that.constructor&&b.that.constructor.name){const a=b.that.constructor.name;e.addLog(this._getKeyValueDetails('class',a));}return b.data&&('object'!=typeof b.data||b.data instanceof Array?e.addLog(this._getKeyValueDetails('additionalData',b.data)):Object.keys(b.data).forEach((a)=>{e.addLog(this._getKeyValueDetails(a,b.data[a]));})),c.addChildGroup(e),c}_getKeyValueDetails(a,b){return{message:`%c${a}: `,colors:[`color: ${LIGHT_BLUE}`],args:b}}_getPrimaryMessageDetails(a,b){let c,d;a===self.workbox.LOG_LEVEL.verbose?(c='Info',d=LIGHT_GREY):a===self.workbox.LOG_LEVEL.debug?(c='Debug',d=LIGHT_GREEN):a===self.workbox.LOG_LEVEL.warn?(c='Warn',d=LIGHT_YELLOW):a===self.workbox.LOG_LEVEL.error?(c='Error',d=LIGHT_RED):void 0;let e=`%c🔧 %c[${c}]`;const f=[`color: ${LIGHT_GREY}`,`color: ${d}`];let g;return'string'==typeof b?g=b:b.message&&(g=b.message),g&&(g=g.replace(/\s+/g,' '),e+=`%c ${g}`,f.push(`color: ${DARK_GREY}; font-weight: normal`)),{message:e,colors:f}}_shouldLogMessage(a,b){if(!b)return!1;let c=this._defaultLogLevel;return self&&self.workbox&&'number'==typeof self.workbox.logLevel&&(c=self.workbox.logLevel),c===self.workbox.LOG_LEVEL.none||a<c?!1:!0}}var logHelper = new LogHelper;
|
||||
|
||||
class NavigationRoute extends Route{constructor({whitelist:a,blacklist:b,handler:c}={}){isArrayOfClass({whitelist:a},RegExp),b?isArrayOfClass({blacklist:b},RegExp):b=[];super({match:({event:d,url:e})=>{let f,g=!1;if('navigate'===d.request.mode){const d=e.pathname+e.search;a.some((a)=>a.test(d))?b.some((a)=>a.test(d))?f=`The navigation route is not being used, since the `+`request URL matches both the whitelist and blacklist.`:(f=`The navigation route is being used.`,g=!0):f=`The navigation route is not being used, since the `+`URL being navigated to doesn't match the whitelist.`,logHelper.debug({that:this,message:f,data:{"request-url":e.href,whitelist:a,blacklist:b,handler:c}});}return g},handler:c,method:'GET'});}}
|
||||
|
||||
class RegExpRoute extends Route{constructor({regExp:a,handler:b,method:c}){isInstance({regExp:a},RegExp);super({match:({url:b})=>{const c=a.exec(b.href);return c?b.origin!==location.origin&&0!==c.index?(logHelper.debug({that:this,message:`Skipping route, because the RegExp match didn't occur `+`at the start of the URL.`,data:{url:b.href,regExp:a}}),null):c.slice(1):null},handler:b,method:c});}}
|
||||
|
||||
class Router$2{constructor(){this._routes=new Map,this._isListenerRegistered=!1;}addFetchListener(){return this._isListenerRegistered?(logHelper.warn({that:this,message:`addFetchListener() has already been called for this Router.`}),!1):(this._isListenerRegistered=!0,self.addEventListener('fetch',(a)=>{const b=this.handleRequest({event:a});b&&a.respondWith(b);}),!0)}handleRequest({event:a}){isInstance({event:a},FetchEvent);const b=new URL(a.request.url);if(!b.protocol.startsWith('http'))return void logHelper.log({that:this,message:`The URL does not start with HTTP, so it can't be handled.`,data:{request:a.request}});let{handler:c,params:d}=this._findHandlerAndParams({event:a,url:b});if(!c&&this.defaultHandler&&(c=this.defaultHandler),c){let e=c.handle({url:b,event:a,params:d});return this.catchHandler&&(e=e.catch((c)=>this.catchHandler.handle({url:b,event:a,error:c}))),e}}_findHandlerAndParams({event:a,url:b}){const c=this._routes.get(a.request.method)||[];for(const d of c){let c=d.match({url:b,event:a});if(c)return logHelper.log({that:this,message:'The router found a matching route.',data:{route:d,request:a.request}}),Array.isArray(c)&&0===c.length?c=void 0:c.constructor===Object&&0===Object.keys(c).length&&(c=void 0),{params:c,handler:d.handler}}return{handler:void 0,params:void 0}}setDefaultHandler({handler:a}={}){this.defaultHandler=normalizeHandler(a);}setCatchHandler({handler:a}={}){this.catchHandler=normalizeHandler(a);}registerRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a)this._routes.has(b.method)||this._routes.set(b.method,[]),this._routes.get(b.method).unshift(b);}registerRoute({route:a}={}){isInstance({route:a},Route),this.registerRoutes({routes:[a]});}unregisterRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a){this._routes.has(b.method)||logHelper.error({that:this,message:`Can't unregister route; there are no ${b.method}
|
||||
routes registered.`,data:{route:b}});const a=this._routes.get(b.method).indexOf(b);-1<a?this._routes.get(b.method).splice(a,1):logHelper.error({that:this,message:`Can't unregister route; the route wasn't previously
|
||||
registered.`,data:{route:b}});}}unregisterRoute({route:a}={}){isInstance({route:a},Route),this.unregisterRoutes({routes:[a]});}}
|
||||
|
||||
class Router$$1 extends Router$2{constructor(a,b){super({handleFetch:b}),this._revisionedCacheName=a;}registerRoute(a,b,c='GET'){'function'==typeof b&&(b={handle:b});let d;if('string'==typeof a){if(0===a.length)throw ErrorFactory.createError('empty-express-string');d=new ExpressRoute({path:a,handler:b,method:c});}else if(a instanceof RegExp)d=new RegExpRoute({regExp:a,handler:b,method:c});else if('function'==typeof a)d=new Route({match:a,handler:b,method:c});else throw ErrorFactory.createError('unsupported-route-type');return super.registerRoute({route:d}),d}registerNavigationRoute(a,b={}){if('string'!=typeof a)throw ErrorFactory.createError('navigation-route-url-string');const c='cacheName'in b?b.cacheName:this._revisionedCacheName;super.registerRoute({route:new NavigationRoute({handler:()=>caches.match(a,{cacheName:c}),whitelist:b.whitelist||[/./],blacklist:b.blacklist||[]})});}}
|
||||
|
||||
const errors$2={"multiple-cache-will-update-plugins":'You cannot register more than one plugin that implements cacheWillUpdate.',"multiple-cached-response-will-be-used-plugins":'You cannot register more than one plugin that implements cachedResponseWillBeUsed.',"invalid-response-for-caching":'The fetched response could not be cached due to an invalid response code.',"no-response-received":'No response received; falling back to cache.',"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character.`};var ErrorFactory$4 = new ErrorFactory$1(errors$2);
|
||||
|
||||
class CacheableResponse{constructor({statuses:a,headers:b}={}){atLeastOne({statuses:a,headers:b}),a!==void 0&&isArrayOfType({statuses:a},'number'),b!==void 0&&isType({headers:b},'object'),this.statuses=a,this.headers=b;}isResponseCacheable({request:a,response:b}={}){isInstance({response:b},Response);let c=!0;if(this.statuses&&(c=this.statuses.includes(b.status)),this.headers&&c&&(c=Object.keys(this.headers).some((a)=>b.headers.get(a)===this.headers[a])),!c){const c={response:b};this.statuses&&(c['valid-status-codes']=JSON.stringify(this.statuses)),this.headers&&(c['valid-headers']=JSON.stringify(this.headers)),a&&(c.request=a),logHelper.debug({message:`The response does not meet the criteria for being added to the
|
||||
cache.`,data:c});}return c}}
|
||||
|
||||
class CacheableResponsePlugin extends CacheableResponse{cacheWillUpdate({request:a,response:b}={}){return this.isResponseCacheable({request:a,response:b})}}
|
||||
|
||||
const getDefaultCacheName=({cacheId:a}={})=>{let b=`workbox-runtime-caching`;return a&&(b=`${a}-${b}`),self&&self.registration&&(b+=`-${self.registration.scope}`),b};
|
||||
const pluginCallbacks=['cacheDidUpdate','cachedResponseWillBeUsed','cacheWillUpdate','fetchDidFail','requestWillFetch'];
|
||||
|
||||
var cleanResponseCopy = (({response:a})=>{isInstance({response:a},Response);const b=a.clone(),c='body'in b?Promise.resolve(b.body):b.blob();return c.then((a)=>new Response(a,{headers:b.headers,status:b.status,statusText:b.statusText}))});
|
||||
|
||||
var asyncToGenerator = function (fn) {
|
||||
return function () {
|
||||
var gen = fn.apply(this, arguments);
|
||||
return new Promise(function (resolve, reject) {
|
||||
function step(key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
return Promise.resolve(value).then(function (value) {
|
||||
step("next", value);
|
||||
}, function (err) {
|
||||
step("throw", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return step("next");
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
class RequestWrapper{constructor({cacheName:a,cacheId:b,plugins:c,fetchOptions:d,matchOptions:e}={}){if(b&&('string'!=typeof b||0===b.length))throw ErrorFactory$4.createError('bad-cache-id');a?(isType({cacheName:a},'string'),this.cacheName=a,b&&(this.cacheName=`${b}-${this.cacheName}`)):this.cacheName=getDefaultCacheName({cacheId:b}),d&&(isType({fetchOptions:d},'object'),this.fetchOptions=d),e&&(isType({matchOptions:e},'object'),this.matchOptions=e),this.plugins=new Map,c&&(isArrayOfType({plugins:c},'object'),c.forEach((a)=>{for(let b of pluginCallbacks)if('function'==typeof a[b]){if(!this.plugins.has(b))this.plugins.set(b,[]);else if('cacheWillUpdate'===b)throw ErrorFactory$4.createError('multiple-cache-will-update-plugins');else if('cachedResponseWillBeUsed'===b)throw ErrorFactory$4.createError('multiple-cached-response-will-be-used-plugins');this.plugins.get(b).push(a);}})),this.plugins.has('cacheWillUpdate')&&(this._userSpecifiedCachableResponsePlugin=this.plugins.get('cacheWillUpdate')[0]);}getDefaultCacheableResponsePlugin(){return this._defaultCacheableResponsePlugin||(this._defaultCacheableResponsePlugin=new CacheableResponsePlugin({statuses:[200]})),this._defaultCacheableResponsePlugin}getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.cacheName)),a._cache})()}match({request:a}){var b=this;return asyncToGenerator(function*(){atLeastOne({request:a});const c=yield b.getCache();let d=yield c.match(a,b.matchOptions);if(b.plugins.has('cachedResponseWillBeUsed')){const e=b.plugins.get('cachedResponseWillBeUsed')[0];d=yield e.cachedResponseWillBeUsed({request:a,cache:c,cachedResponse:d,matchOptions:b.matchOptions,cacheName:b.cacheName});}return d})()}fetch({request:a}){var b=this;return asyncToGenerator(function*(){'string'==typeof a?a=new Request(a):isInstance({request:a},Request);const c=b.plugins.has('fetchDidFail')?a.clone():null;if(b.plugins.has('requestWillFetch'))for(let c of b.plugins.get('requestWillFetch')){const b=yield c.requestWillFetch({request:a});isInstance({returnedRequest:b},Request),a=b;}try{return yield fetch(a,b.fetchOptions)}catch(a){if(b.plugins.has('fetchDidFail'))for(let a of b.plugins.get('fetchDidFail'))yield a.fetchDidFail({request:c.clone()});throw a}})()}fetchAndCache({request:a,waitOnCache:b,cacheKey:c,cacheResponsePlugin:d,cleanRedirects:e}){var f=this;return asyncToGenerator(function*(){atLeastOne({request:a});let g;const h=yield f.fetch({request:a}),i=f._userSpecifiedCachableResponsePlugin||d||f.getDefaultCacheableResponsePlugin(),j=yield i.cacheWillUpdate({request:a,response:h});if(j){const b=e&&h.redirected?yield cleanResponseCopy({response:h}):h.clone();g=f.getCache().then((()=>{var d=asyncToGenerator(function*(d){let e;const g=c||a;if('opaque'!==h.type&&f.plugins.has('cacheDidUpdate')&&(e=yield f.match({request:g})),yield d.put(g,b),f.plugins.has('cacheDidUpdate'))for(let a of f.plugins.get('cacheDidUpdate'))yield a.cacheDidUpdate({cacheName:f.cacheName,oldResponse:e,newResponse:b,url:'url'in g?g.url:g});});return function(){return d.apply(this,arguments)}})());}else if(!j&&b)throw ErrorFactory$4.createError('invalid-response-for-caching');return b&&g&&(yield g),h})()}}
|
||||
|
||||
class Handler{constructor({requestWrapper:a,waitOnCache:b}={}){this.requestWrapper=a?a:new RequestWrapper,this.waitOnCache=!!b;}handle({event:a,params:b}={}){throw Error('This abstract method must be implemented in a subclass.')}}
|
||||
|
||||
class CacheFirst extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=yield b.requestWrapper.match({request:a.request});return c||(yield b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache}))})()}}
|
||||
|
||||
class CacheOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.match({request:a.request})})()}}
|
||||
|
||||
class NetworkFirst extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});const{networkTimeoutSeconds:b}=a;b&&(isType({networkTimeoutSeconds:b},'number'),this.networkTimeoutSeconds=b);}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=[];let d;b.networkTimeoutSeconds&&c.push(new Promise(function(c){d=setTimeout(function(){c(b.requestWrapper.match({request:a.request}));},1e3*b.networkTimeoutSeconds);}));const e=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).then(function(a){return d&&clearTimeout(d),a?a:Promise.reject(ErrorFactory$4.createError('no-response-received'))}).catch(function(){return b.requestWrapper.match({request:a.request})});return c.push(e),Promise.race(c)})()}}
|
||||
|
||||
class NetworkOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.fetch({request:a.request})})()}}
|
||||
|
||||
class StaleWhileRevalidate extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).catch(function(){return Response.error()}),d=yield b.requestWrapper.match({request:a.request});return d||(yield c)})()}}
|
||||
|
||||
let tmpIdbName=`workbox-cache-expiration`;self&&self.registration&&(tmpIdbName+=`-${self.registration.scope}`);const idbName=tmpIdbName;const idbVersion=1;const urlPropertyName='url';const timestampPropertyName='timestamp';
|
||||
|
||||
function createCommonjsModule(fn, module) {
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
var idb=createCommonjsModule(function(a){'use strict';(function(){function b(a){return Array.prototype.slice.call(a)}function c(a){return new Promise(function(b,c){a.onsuccess=function(){b(a.result);},a.onerror=function(){c(a.error);};})}function d(a,b,d){var e,f=new Promise(function(f,g){e=a[b].apply(a,d),c(e).then(f,g);});return f.request=e,f}function e(a,b,c){var e=d(a,b,c);return e.then(function(a){return a?new k(a,e.request):void 0})}function f(a,b,c){c.forEach(function(c){Object.defineProperty(a.prototype,c,{get:function(){return this[b][c]},set:function(a){this[b][c]=a;}});});}function g(a,b,c,e){e.forEach(function(e){e in c.prototype&&(a.prototype[e]=function(){return d(this[b],e,arguments)});});}function h(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return this[b][d].apply(this[b],arguments)});});}function i(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return e(this[b],d,arguments)});});}function j(a){this._index=a;}function k(a,b){this._cursor=a,this._request=b;}function l(a){this._store=a;}function m(a){this._tx=a,this.complete=new Promise(function(b,c){a.oncomplete=function(){b();},a.onerror=function(){c(a.error);},a.onabort=function(){c(a.error);};});}function n(a,b,c){this._db=a,this.oldVersion=b,this.transaction=new m(c);}function o(a){this._db=a;}f(j,'_index',['name','keyPath','multiEntry','unique']),g(j,'_index',IDBIndex,['get','getKey','getAll','getAllKeys','count']),i(j,'_index',IDBIndex,['openCursor','openKeyCursor']),f(k,'_cursor',['direction','key','primaryKey','value']),g(k,'_cursor',IDBCursor,['update','delete']),['advance','continue','continuePrimaryKey'].forEach(function(a){a in IDBCursor.prototype&&(k.prototype[a]=function(){var b=this,d=arguments;return Promise.resolve().then(function(){return b._cursor[a].apply(b._cursor,d),c(b._request).then(function(a){return a?new k(a,b._request):void 0})})});}),l.prototype.createIndex=function(){return new j(this._store.createIndex.apply(this._store,arguments))},l.prototype.index=function(){return new j(this._store.index.apply(this._store,arguments))},f(l,'_store',['name','keyPath','indexNames','autoIncrement']),g(l,'_store',IDBObjectStore,['put','add','delete','clear','get','getAll','getKey','getAllKeys','count']),i(l,'_store',IDBObjectStore,['openCursor','openKeyCursor']),h(l,'_store',IDBObjectStore,['deleteIndex']),m.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))},f(m,'_tx',['objectStoreNames','mode']),h(m,'_tx',IDBTransaction,['abort']),n.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))},f(n,'_db',['name','version','objectStoreNames']),h(n,'_db',IDBDatabase,['deleteObjectStore','close']),o.prototype.transaction=function(){return new m(this._db.transaction.apply(this._db,arguments))},f(o,'_db',['name','version','objectStoreNames']),h(o,'_db',IDBDatabase,['close']),['openCursor','openKeyCursor'].forEach(function(a){[l,j].forEach(function(c){c.prototype[a.replace('open','iterate')]=function(){var c=b(arguments),d=c[c.length-1],e=this._store||this._index,f=e[a].apply(e,c.slice(0,-1));f.onsuccess=function(){d(f.result);};};});}),[j,l].forEach(function(a){a.prototype.getAll||(a.prototype.getAll=function(a,b){var c=this,d=[];return new Promise(function(e){c.iterateCursor(a,function(a){return a?(d.push(a.value),void 0!==b&&d.length==b?void e(d):void a.continue()):void e(d)});})});});var p={open:function(a,b,c){var e=d(indexedDB,'open',[a,b]),f=e.request;return f.onupgradeneeded=function(a){c&&c(new n(f.result,a.oldVersion,f.transaction));},e.then(function(a){return new o(a)})},delete:function(a){return d(indexedDB,'deleteDatabase',[a])}};a.exports=p,a.exports.default=a.exports;})();});
|
||||
|
||||
const errors$3={"max-entries-or-age-required":`Either the maxEntries or maxAgeSeconds
|
||||
parameters (or both) are required when constructing Plugin.`,"max-entries-must-be-number":`The maxEntries parameter to the Plugin
|
||||
constructor must either be a number or undefined.`,"max-age-seconds-must-be-number":`The maxAgeSeconds parameter to the Plugin
|
||||
constructor must either be a number or undefined.`};var ErrorFactory$5 = new ErrorFactory$1(errors$3);
|
||||
|
||||
class CacheExpiration{constructor({maxEntries:a,maxAgeSeconds:b}={}){if(!(a||b))throw ErrorFactory$5.createError('max-entries-or-age-required');if(a&&'number'!=typeof a)throw ErrorFactory$5.createError('max-entries-must-be-number');if(b&&'number'!=typeof b)throw ErrorFactory$5.createError('max-age-seconds-must-be-number');this.maxEntries=a,this.maxAgeSeconds=b,this._dbs=new Map,this._caches=new Map,this._expirationMutex=!1,this._timestampForNextRun=null;}getDB({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=`${idbName}-${a}`;if(!b._dbs.has(c)){const d=yield idb.open(c,idbVersion,function(b){const c=b.createObjectStore(a,{keyPath:urlPropertyName});c.createIndex(timestampPropertyName,timestampPropertyName,{unique:!1});});b._dbs.set(c,d);}return b._dbs.get(c)})()}getCache({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),!b._caches.has(a)){const c=yield caches.open(a);b._caches.set(a,c);}return b._caches.get(a)})()}isResponseFresh({cacheName:a,cachedResponse:b,now:c}={}){if(b&&this.maxAgeSeconds){isInstance({cachedResponse:b},Response);const d=b.headers.get('date');if(d){'undefined'==typeof c&&(c=Date.now());const a=new Date(d),b=a.getTime();return!!isNaN(b)||b+1e3*this.maxAgeSeconds>c}return this.expireEntries({cacheName:a,now:c}),!0}return!0}updateTimestamp({cacheName:a,url:b,now:c}={}){var d=this;return asyncToGenerator(function*(){isType({url:b},'string'),isType({cacheName:a},'string');const e=new URL(b,location);e.hash='','undefined'==typeof c&&(c=Date.now());const f=yield d.getDB({cacheName:a}),g=f.transaction(a,'readwrite');g.objectStore(a).put({[timestampPropertyName]:c,[urlPropertyName]:e.href}),yield g.complete;})()}expireEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){if(c._expirationMutex)return void(c._timestampForNextRun=b);c._expirationMutex=!0,isType({cacheName:a},'string'),'undefined'==typeof b&&(b=Date.now());const d=c.maxAgeSeconds?yield c.findOldEntries({cacheName:a,now:b}):[],e=c.maxEntries?yield c.findExtraEntries({cacheName:a}):[],f=[...new Set(d.concat(e))];if(yield c.deleteFromCacheAndIDB({cacheName:a,urls:f}),0<f.length&&logHelper.debug({that:c,message:'Expired entries have been removed from the cache.',data:{cacheName:a,urls:f}}),c._expirationMutex=!1,c._timestampForNextRun){const b=c._timestampForNextRun;return c._timestampForNextRun=null,c.expireEntries({cacheName:a,now:b})}})()}findOldEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){isType({cacheName:a},'string'),isType({now:b},'number');const d=b-1e3*c.maxAgeSeconds,e=[],f=yield c.getDB({cacheName:a}),g=f.transaction(a,'readonly'),h=g.objectStore(a),i=h.index(timestampPropertyName);return i.iterateCursor(function(a){a&&(a.value[timestampPropertyName]<d&&e.push(a.value[urlPropertyName]),a.continue());}),yield g.complete,e})()}findExtraEntries({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=[],d=yield b.getDB({cacheName:a});let e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName);const h=yield g.count();return h>b.maxEntries&&(e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName),g.iterateCursor(function(a){a&&(c.push(a.value[urlPropertyName]),h-c.length>b.maxEntries&&a.continue());})),yield e.complete,c})()}deleteFromCacheAndIDB({cacheName:a,urls:b}={}){var c=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),isArrayOfType({urls:b},'string'),0<b.length){const d=yield c.getCache({cacheName:a}),e=yield c.getDB({cacheName:a});for(let c of b){yield d.delete(c);const b=e.transaction(a,'readwrite'),f=b.objectStore(a);f.delete(c),yield b.complete;}}})()}}
|
||||
|
||||
class CacheExpirationPlugin extends CacheExpiration{cachedResponseWillBeUsed({cacheName:a,cachedResponse:b,now:c}={}){return this.isResponseFresh({cacheName:a,cachedResponse:b,now:c})?b:null}cacheDidUpdate({cacheName:a,newResponse:b,url:c,now:d}={}){var e=this;return asyncToGenerator(function*(){isType({cacheName:a},'string'),isInstance({newResponse:b},Response),'undefined'==typeof d&&(d=Date.now()),yield e.updateTimestamp({cacheName:a,url:c,now:d}),yield e.expireEntries({cacheName:a,now:d});})()}}
|
||||
|
||||
const errors$4={"channel-name-required":`The channelName parameter is required when
|
||||
constructing a new BroadcastCacheUpdate instance.`,"responses-are-same-parameters-required":`The first, second, and
|
||||
headersToCheck parameters must be valid when calling responsesAreSame()`};var ErrorFactory$6 = new ErrorFactory$1(errors$4);
|
||||
|
||||
const cacheUpdatedMessageType='CACHE_UPDATED';
|
||||
const defaultHeadersToCheck=['content-length','etag','last-modified'];
|
||||
const defaultSource='workbox-broadcast-cache-update';
|
||||
|
||||
function broadcastUpdate({channel:a,cacheName:b,url:c,source:d}={}){isInstance({channel:a},BroadcastChannel),isType({cacheName:b},'string'),isType({source:d},'string'),isType({url:c},'string'),a.postMessage({type:cacheUpdatedMessageType,meta:d,payload:{cacheName:b,updatedUrl:c}});}
|
||||
|
||||
function responsesAreSame({first:a,second:b,headersToCheck:c}={}){if(!(a instanceof Response&&b instanceof Response&&c instanceof Array))throw ErrorFactory$6.createError('responses-are-same-parameters-required');const d=c.some((c)=>a.headers.has(c)&&b.headers.has(c));return d?c.every((c)=>a.headers.has(c)===b.headers.has(c)&&a.headers.get(c)===b.headers.get(c)):(logHelper.log({message:`Unable to determine whether the response has been updated
|
||||
because none of the headers that would be checked are present.`,data:{"First Response":a,"Second Response":b,"Headers To Check":JSON.stringify(c)}}),!0)}
|
||||
|
||||
class BroadcastCacheUpdate{constructor({channelName:a,headersToCheck:b,source:c}={}){if('string'!=typeof a||0===a.length)throw ErrorFactory$6.createError('channel-name-required');this.channelName=a,this.headersToCheck=b||defaultHeadersToCheck,this.source=c||defaultSource;}get channel(){return this._channel||(this._channel=new BroadcastChannel(this.channelName)),this._channel}notifyIfUpdated({first:a,second:b,cacheName:c,url:d}){isType({cacheName:c},'string'),responsesAreSame({first:a,second:b,headersToCheck:this.headersToCheck})||broadcastUpdate({cacheName:c,url:d,channel:this.channel,source:this.source});}}
|
||||
|
||||
class BroadcastCacheUpdatePlugin extends BroadcastCacheUpdate{cacheDidUpdate({cacheName:a,oldResponse:b,newResponse:c,url:d}){isType({cacheName:a},'string'),isInstance({newResponse:c},Response),b&&this.notifyIfUpdated({cacheName:a,first:b,second:c,url:d});}}
|
||||
|
||||
class Strategies{constructor({cacheId:a}={}){this._cacheId=a;}cacheFirst(a){return this._getCachingMechanism(CacheFirst,a)}cacheOnly(a){return this._getCachingMechanism(CacheOnly,a)}networkFirst(a){return this._getCachingMechanism(NetworkFirst,a)}networkOnly(a){return this._getCachingMechanism(NetworkOnly,a)}staleWhileRevalidate(a){return this._getCachingMechanism(StaleWhileRevalidate,a)}_getCachingMechanism(a,b={}){const c={cacheExpiration:CacheExpirationPlugin,broadcastCacheUpdate:BroadcastCacheUpdatePlugin,cacheableResponse:CacheableResponsePlugin},d={plugins:[]};b.excludeCacheId||(d.cacheId=this._cacheId),b.cacheName&&(d.cacheName=b.cacheName);const e=Object.keys(c);return e.forEach((a)=>{if(b[a]){const e=c[a],f=b[a];d.plugins.push(new e(f));}}),b.plugins&&b.plugins.forEach((a)=>{d.plugins.push(a);}),b.requestWrapper=new RequestWrapper(d),new a(b)}}
|
||||
|
||||
const errorMessageFactory=(a,b)=>{let c=`An error was thrown by workbox with error code: `+`;'${a}'`;return b&&(c+=` with extras: '${JSON.stringify(b)}'`),c};
|
||||
|
||||
class WorkboxError extends Error{constructor(a,b){super(),this.name=a,this.message=errorMessageFactory(a,b),b&&(this.extras=b);}}
|
||||
|
||||
class BaseCacheManager{constructor({cacheName:a,cacheId:b,plugins:c}={}){if(b&&('string'!=typeof b||0===b.length))throw new WorkboxError('bad-cache-id',{cacheId:b});this._entriesToCache=new Map,this._requestWrapper=new RequestWrapper({cacheName:a,cacheId:b,plugins:c,fetchOptions:{credentials:'same-origin'}});}_addEntries(a){this._parsedCacheUrls=null,a.forEach((a)=>{this._addEntryToInstallList(this._parseEntry(a));});}getCacheName(){return this._requestWrapper.cacheName}getCachedUrls(){return this._parsedCacheUrls||(this._parsedCacheUrls=Array.from(this._entriesToCache.keys()).map((a)=>new URL(a,location).href)),this._parsedCacheUrls}_addEntryToInstallList(a){const b=a.entryID,c=this._entriesToCache.get(a.entryID);return c?void this._onDuplicateInstallEntryFound(a,c):void this._entriesToCache.set(b,a)}install(){var a=this;return asyncToGenerator(function*(){if(0===a._entriesToCache.size)return[];const b=[];return a._entriesToCache.forEach(function(c){b.push(a._cacheEntry(c));}),Promise.all(b)})()}_cacheEntry(a){var b=this;return asyncToGenerator(function*(){const c=yield b._isAlreadyCached(a),d={url:a.request.url,revision:a.revision,wasUpdated:!c};if(c)return d;try{return yield b._requestWrapper.fetchAndCache({request:a.getNetworkRequest(),waitOnCache:!0,cacheKey:a.request,cleanRedirects:!0}),yield b._onEntryCached(a),d}catch(b){throw new WorkboxError('request-not-cached',{url:a.request.url,error:b})}})()}cleanup(){var a=this;return asyncToGenerator(function*(){if(!(yield caches.has(a.getCacheName())))return;const b=[];a._entriesToCache.forEach(function(a){b.push(a.request.url);});const c=yield a._getCache(),d=yield c.keys(),e=d.filter(function(a){return!b.includes(a.url)});return Promise.all(e.map((()=>{var b=asyncToGenerator(function*(b){yield c.delete(b),yield a._onEntryDeleted(b.url);});return function(){return b.apply(this,arguments)}})()))})()}_getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.getCacheName())),a._cache})()}_parseEntry(){throw new WorkboxError('requires-overriding')}_onDuplicateEntryFound(){throw new WorkboxError('requires-overriding')}_isAlreadyCached(){throw new WorkboxError('requires-overriding')}_onEntryCached(){throw new WorkboxError('requires-overriding')}_onEntryDeleted(){throw new WorkboxError('requires-overriding')}}
|
||||
|
||||
class IDBHelper{constructor(a,b,c){if(a==void 0||b==void 0||c==void 0)throw Error('name, version, storeName must be passed to the constructor.');this._name=a,this._version=b,this._storeName=c;}_getDb(){return this._dbPromise?this._dbPromise:(this._dbPromise=idb.open(this._name,this._version,(a)=>{a.createObjectStore(this._storeName);}).then((a)=>a),this._dbPromise)}close(){return this._dbPromise?this._dbPromise.then((a)=>{a.close(),this._dbPromise=null;}):void 0}put(a,b){return this._getDb().then((c)=>{const d=c.transaction(this._storeName,'readwrite'),e=d.objectStore(this._storeName);return e.put(b,a),d.complete})}delete(a){return this._getDb().then((b)=>{const c=b.transaction(this._storeName,'readwrite'),d=c.objectStore(this._storeName);return d.delete(a),c.complete})}get(a){return this._getDb().then((b)=>b.transaction(this._storeName).objectStore(this._storeName).get(a))}getAllValues(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAll())}getAllKeys(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAllKeys())}}
|
||||
|
||||
const cacheBustParamName='_workbox-precaching';const version='v1';const dbName='workbox-precaching';const dbVersion='1';const dbStorename='asset-revisions';let tmpRevisionedCacheName=`workbox-precaching-revisioned-${version}`;self&&self.registration&&(tmpRevisionedCacheName+=`-${self.registration.scope}`);const defaultRevisionedCacheName=tmpRevisionedCacheName;
|
||||
|
||||
class RevisionDetailsModel{constructor(){this._idbHelper=new IDBHelper(dbName,dbVersion,dbStorename);}get(a){return this._idbHelper.get(a)}put(a,b){return this._idbHelper.put(a,b)}delete(a){return this._idbHelper.delete(a)}_close(){this._idbHelper.close();}}
|
||||
|
||||
class BaseCacheEntry{constructor({entryID:a,revision:b,request:c,cacheBust:d}){this.entryID=a,this.revision=b,this.request=c,this.cacheBust=d;}getNetworkRequest(){if(!0!==this.cacheBust)return this.request;let a=this.request.url;const b={};if(!0===this.cacheBust)if('cache'in Request.prototype)b.cache='reload';else{const b=new URL(a,location);b.search+=(b.search?'&':'')+encodeURIComponent(cacheBustParamName)+'='+encodeURIComponent(this.revision),a=b.toString();}return new Request(a,b)}}
|
||||
|
||||
class StringCacheEntry extends BaseCacheEntry{constructor(a){if(isType({url:a},'string'),0===a.length)throw new WorkboxError('invalid-string-entry',{url:a});super({entryID:a,revision:a,request:new Request(a),cacheBust:!1});}}
|
||||
|
||||
class ObjectCacheEntry extends BaseCacheEntry{constructor({entryID:a,revision:b,url:c,cacheBust:d}){if('undefined'!=typeof b&&(isType({revision:b},'string'),0===b.length))throw new WorkboxError('invalid-object-entry',{problemParam:'revision',problemValue:b});if('undefined'==typeof d&&(d=!!b),isType({cacheBust:d},'boolean'),isType({url:c},'string'),0===c.length)throw new WorkboxError('invalid-object-entry',{problemParam:'url',problemValue:c});if('undefined'==typeof a)a=new URL(c,location).toString();else if(0===a.length)throw new WorkboxError('invalid-object-entry',{problemParam:'entryID',problemValue:a});super({entryID:a,revision:b||c,request:new Request(c),cacheBust:d});}}
|
||||
|
||||
class RevisionedCacheManager extends BaseCacheManager{constructor(a={}){a.cacheName=a.cacheName||defaultRevisionedCacheName,super(a),this._revisionDetailsModel=new RevisionDetailsModel;}addToCacheList({revisionedFiles:a}={}){isInstance({revisionedFiles:a},Array),super._addEntries(a);const b=a.filter((a)=>'string'==typeof a||!a.revision);0<b.length&&logHelper.debug({that:this,message:`Some precache entries are URLs without separate revision
|
||||
fields. If the URLs themselves do not contain revisioning info,
|
||||
like a hash or a version number, your users won't receive updates.`,data:{"URLs without revision fields":JSON.stringify(b),"Examples of safe, versioned URLs":`'/path/file.abcd1234.css' or '/v1.0.0/file.js'`,"Examples of dangerous, unversioned URLs":`'index.html' or '/path/file.css' or '/latest/file.js'`}});}_parseEntry(a){if(null===a)throw new WorkboxError('unexpected-precache-entry',{input:a});let b;switch(typeof a){case'string':b=new StringCacheEntry(a);break;case'object':b=new ObjectCacheEntry(a);break;default:throw new WorkboxError('unexpected-precache-entry',{input:a});}return b}_onDuplicateInstallEntryFound(a,b){if(b.revision!==a.revision)throw new WorkboxError('duplicate-entry-diff-revisions',{firstEntry:{url:b.request.url,revision:b.revision},secondEntry:{url:a.request.url,revision:a.revision}})}_isAlreadyCached(a){var b=this;return asyncToGenerator(function*(){const c=yield b._revisionDetailsModel.get(a.entryID);if(c!==a.revision)return!1;const d=yield b._getCache(),e=yield d.match(a.request);return!!e})()}_onEntryCached(a){var b=this;return asyncToGenerator(function*(){yield b._revisionDetailsModel.put(a.entryID,a.revision);})()}_onEntryDeleted(a){var b=this;return asyncToGenerator(function*(){yield b._revisionDetailsModel.delete(a);})()}_close(){this._revisionDetailsModel._close();}cleanup(){return super.cleanup().then(()=>this._close())}_createLogFriendlyString(a){let b=`\n`;return a.forEach((a)=>{b+=` URL: '${a.url}' Revision: `+`'${a.revision}'\n`;}),b}install(){return super.install().then((a)=>{const b=[],c=[];a.forEach((a)=>{a.wasUpdated?b.push({url:a.url,revision:a.revision}):c.push({url:a.url,revision:a.revision});});const d={};return 0<b.length&&(d['New / Updated Precache URL\'s']=this._createLogFriendlyString(b)),0<c.length&&(d['Up-to-date Precache URL\'s']=this._createLogFriendlyString(c)),logHelper.log({message:`Precache Details: ${b.length} requests `+`were added or updated and `+`${c.length} request are already `+`cached and up-to-date.`,data:d}),a})}}
|
||||
|
||||
if(!isServiceWorkerGlobalScope())throw new WorkboxError('not-in-sw');
|
||||
|
||||
class WorkboxSW$1{constructor({cacheId:a,skipWaiting:b,clientsClaim:c,handleFetch:d=!0,directoryIndex:e='index.html',precacheChannelName:f='precache-updates',ignoreUrlParametersMatching:g=[/^utm_/]}={}){if(!isServiceWorkerGlobalScope())throw ErrorFactory.createError('not-in-sw');if(isDevBuild()&&(isLocalhost()?logHelper.debug({message:'Welcome to Workbox!',data:{"📖":'Read the guides and documentation\nhttps://workboxjs.org/',"❓":'Use the [workbox] tag on StackOverflow to ask questions\nhttps://stackoverflow.com/questions/ask?tags=workbox',"🐛":'Found a bug? Report it on GitHub\nhttps://github.com/GoogleChrome/workbox/issues/new'}}):logHelper.warn(`This appears to be a production server. Please switch
|
||||
to the smaller, optimized production build of Workbox.`)),a&&('string'!=typeof a||0===a.length))throw ErrorFactory.createError('bad-cache-id');if(b&&'boolean'!=typeof b)throw ErrorFactory.createError('bad-skip-waiting');if(c&&'boolean'!=typeof c)throw ErrorFactory.createError('bad-clients-claim');if('undefined'!=typeof e)if(!1===e||null===e)e=!1;else if('string'!=typeof e||0===e.length)throw ErrorFactory.createError('bad-directory-index');const h=[];f&&h.push(new BroadcastCacheUpdatePlugin({channelName:f,source:registration&®istration.scope?registration.scope:location})),this._runtimeCacheName=getDefaultCacheName({cacheId:a}),this._revisionedCacheManager=new RevisionedCacheManager({cacheId:a,plugins:h}),this._strategies=new Strategies({cacheId:a}),this._precacheRouter=new Router$$1(this._revisionedCacheManager.getCacheName()),this._router=new Router$$1(this._revisionedCacheManager.getCacheName()),d&&(this._precacheRouter.addFetchListener(),this._router.addFetchListener()),this._registerInstallActivateEvents(b,c),this._registerDefaultRoutes(g,e);}precache(a){if(!Array.isArray(a))throw ErrorFactory.createError('bad-revisioned-cache-list');this._revisionedCacheManager.addToCacheList({revisionedFiles:a});}get router(){return this._router}get strategies(){return this._strategies}get runtimeCacheName(){return this._runtimeCacheName}_registerInstallActivateEvents(a,b){self.addEventListener('install',(b)=>{const c=this._revisionedCacheManager.getCachedUrls();0<c.length&&logHelper.debug({that:this,message:`The precached URLs will automatically be served using a
|
||||
cache-first strategy.`,data:{"Precached URLs":JSON.stringify(c)}}),b.waitUntil(this._revisionedCacheManager.install().then(()=>{if(a)return self.skipWaiting()}));}),self.addEventListener('activate',(a)=>{a.waitUntil(this._revisionedCacheManager.cleanup().then(()=>{if(b)return self.clients.claim()}));});}_registerDefaultRoutes(a,b){const c=[];(a||b)&&c.push(this._getCacheMatchPlugin(a,b));const d=this.strategies.cacheFirst({cacheName:this._revisionedCacheManager.getCacheName(),plugins:c,excludeCacheId:!0});this._precacheRouter.registerRoute(({url:c})=>{c.hash='';const d=this._revisionedCacheManager.getCachedUrls();if(-1!==d.indexOf(c.href))return!0;let e=this._removeIgnoreUrlParams(c.href,a);return-1!==d.indexOf(e.href)||b&&e.pathname.endsWith('/')&&(e.pathname+=b,-1!==d.indexOf(e.href))},d);}_getCacheMatchPlugin(a,b){var c=this;const d=(()=>{var d=asyncToGenerator(function*({request:d,cache:e,cachedResponse:f,matchOptions:g}){if(f)return f;let h=c._removeIgnoreUrlParams(d.url,a);return e.match(h.toString(),g).then(function(a){return!a&&h.pathname.endsWith('/')?(h.pathname+=b,e.match(h.toString(),g)):a})});return function(){return d.apply(this,arguments)}})();return{cachedResponseWillBeUsed:d}}_removeIgnoreUrlParams(a,b){const c=new URL(a),d=c.search.slice(1),e=d.split('&'),f=e.map((a)=>a.split('=')),g=f.filter((a)=>b.every((b)=>!b.test(a[0]))),h=g.map((a)=>a.join('='));return c.search=h.join('&'),c}}
|
||||
|
||||
return WorkboxSW$1;
|
||||
|
||||
}());
|
||||
//# sourceMappingURL=workbox-sw.prod.v2.1.0.js.map
|
File diff suppressed because one or more lines are too long
187
docs/4.0/assets/js/vendor/workbox-sw.prod.v2.1.2.js
vendored
187
docs/4.0/assets/js/vendor/workbox-sw.prod.v2.1.2.js
vendored
@ -1,187 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
var WorkboxSW = (function () {
|
||||
'use strict';
|
||||
|
||||
class ErrorFactory$1{constructor(a){this._errors=a;}createError(a,b){if(!(a in this._errors))throw new Error(`Unable to generate error '${a}'.`);let c=this._errors[a].replace(/\s+/g,' '),d=null;b&&(c+=` [${b.message}]`,d=b.stack);const e=new Error;return e.name=a,e.message=c,e.stack=d,e}}
|
||||
|
||||
const errors={"not-in-sw":'workbox-sw must be loaded in your service worker file.',"unsupported-route-type":'The first parameter to registerRoute() should be either an Express-style path string, a RegExp, or a function.',"empty-express-string":'The Express style route string must have some characters, an empty string is invalid.',"bad-revisioned-cache-list":`The 'precache()' method expects`+`an array of revisioned urls like so: ['/example/hello.1234.txt', `+`{path: 'hello.txt', revision: '1234'}]`,"navigation-route-url-string":`The registerNavigationRoute() method `+`expects a URL string as its first parameter.`,"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character`,"bad-skip-waiting":`The 'skipWaiting' parameter must be a boolean.`,"bad-clients-claim":`The 'clientsClaim' parameter must be a boolean.`,"bad-directory-index":`The 'directoryIndex' parameter must be a boolean.`};var ErrorFactory = new ErrorFactory$1(errors);
|
||||
|
||||
class LogGroup{constructor(){this._logs=[],this._childGroups=[],this._isFallbackMode=!1;const a=/Firefox\/(\d*)\.\d*/.exec(navigator.userAgent);if(a)try{const b=parseInt(a[1],10);55>b&&(this._isFallbackMode=!0);}catch(a){this._isFallbackMode=!0;}/Edge\/\d*\.\d*/.exec(navigator.userAgent)&&(this._isFallbackMode=!0);}addPrimaryLog(a){this._primaryLog=a;}addLog(a){this._logs.push(a);}addChildGroup(a){0===a._logs.length||this._childGroups.push(a);}print(){return 0===this._logs.length&&0===this._childGroups.length?void this._printLogDetails(this._primaryLog):void(this._primaryLog&&(this._isFallbackMode?this._printLogDetails(this._primaryLog):console.groupCollapsed(...this._getLogContent(this._primaryLog))),this._logs.forEach((a)=>{this._printLogDetails(a);}),this._childGroups.forEach((a)=>{a.print();}),this._primaryLog&&!this._isFallbackMode&&console.groupEnd())}_printLogDetails(a){const b=a.logFunc?a.logFunc:console.log;b(...this._getLogContent(a));}_getLogContent(a){let b=a.message;this._isFallbackMode&&'string'==typeof b&&(b=b.replace(/%c/g,''));let c=[b];return!this._isFallbackMode&&a.colors&&(c=c.concat(a.colors)),a.args&&(c=c.concat(a.args)),c}}
|
||||
|
||||
function isServiceWorkerGlobalScope(){return'ServiceWorkerGlobalScope'in self&&self instanceof ServiceWorkerGlobalScope}function isDevBuild(){return`dev`==`prod`}function isLocalhost(){return!!('localhost'===location.hostname||'[::1]'===location.hostname||location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))}
|
||||
|
||||
self.workbox=self.workbox||{},self.workbox.LOG_LEVEL=self.workbox.LOG_LEVEL||{none:-1,verbose:0,debug:1,warn:2,error:3};const LIGHT_GREY=`#bdc3c7`; const DARK_GREY=`#7f8c8d`; const LIGHT_GREEN=`#2ecc71`; const LIGHT_YELLOW=`#f1c40f`; const LIGHT_RED=`#e74c3c`; const LIGHT_BLUE=`#3498db`;class LogHelper{constructor(){this._defaultLogLevel=isDevBuild()?self.workbox.LOG_LEVEL.debug:self.workbox.LOG_LEVEL.warn;}log(a){this._printMessage(self.workbox.LOG_LEVEL.verbose,a);}debug(a){this._printMessage(self.workbox.LOG_LEVEL.debug,a);}warn(a){this._printMessage(self.workbox.LOG_LEVEL.warn,a);}error(a){this._printMessage(self.workbox.LOG_LEVEL.error,a);}_printMessage(a,b){if(this._shouldLogMessage(a,b)){const c=this._getAllLogGroups(a,b);c.print();}}_getAllLogGroups(a,b){const c=new LogGroup,d=this._getPrimaryMessageDetails(a,b);if(c.addPrimaryLog(d),b.error){const a={message:b.error,logFunc:console.error};c.addLog(a);}const e=new LogGroup;if(b.that&&b.that.constructor&&b.that.constructor.name){const a=b.that.constructor.name;e.addLog(this._getKeyValueDetails('class',a));}return b.data&&('object'!=typeof b.data||b.data instanceof Array?e.addLog(this._getKeyValueDetails('additionalData',b.data)):Object.keys(b.data).forEach((a)=>{e.addLog(this._getKeyValueDetails(a,b.data[a]));})),c.addChildGroup(e),c}_getKeyValueDetails(a,b){return{message:`%c${a}: `,colors:[`color: ${LIGHT_BLUE}`],args:b}}_getPrimaryMessageDetails(a,b){let c,d;a===self.workbox.LOG_LEVEL.verbose?(c='Info',d=LIGHT_GREY):a===self.workbox.LOG_LEVEL.debug?(c='Debug',d=LIGHT_GREEN):a===self.workbox.LOG_LEVEL.warn?(c='Warn',d=LIGHT_YELLOW):a===self.workbox.LOG_LEVEL.error?(c='Error',d=LIGHT_RED):void 0;let e=`%c🔧 %c[${c}]`;const f=[`color: ${LIGHT_GREY}`,`color: ${d}`];let g;return'string'==typeof b?g=b:b.message&&(g=b.message),g&&(g=g.replace(/\s+/g,' '),e+=`%c ${g}`,f.push(`color: ${DARK_GREY}; font-weight: normal`)),{message:e,colors:f}}_shouldLogMessage(a,b){if(!b)return!1;let c=this._defaultLogLevel;return self&&self.workbox&&'number'==typeof self.workbox.logLevel&&(c=self.workbox.logLevel),c===self.workbox.LOG_LEVEL.none||a<c?!1:!0}}var logHelper = new LogHelper;
|
||||
|
||||
const errors$1={"express-route-invalid-path":`When using ExpressRoute, you must
|
||||
provide a path that starts with a '/' character (to match same-origin
|
||||
requests) or that starts with 'http' (to match cross-origin requests)`};var ErrorFactory$3 = new ErrorFactory$1(errors$1);
|
||||
|
||||
var ErrorStackParser = {parse:()=>[]};
|
||||
|
||||
function atLeastOne(a){const b=Object.keys(a);b.some((b)=>a[b]!==void 0)||throwError('Please set at least one of the following parameters: '+b.map((a)=>`'${a}'`).join(', '));}function hasMethod(a,b){const c=Object.keys(a).pop(),d=typeof a[c][b];'function'!=d&&throwError(`The '${c}' parameter must be an object that exposes a
|
||||
'${b}' method.`);}function isInstance(a,b){const c=Object.keys(a).pop();a[c]instanceof b||throwError(`The '${c}' parameter must be an instance of
|
||||
'${b.name}'`);}function isOneOf(a,b){const c=Object.keys(a).pop();b.includes(a[c])||throwError(`The '${c}' parameter must be set to one of the
|
||||
following: ${b}`);}function isType(a,b){const c=Object.keys(a).pop(),d=typeof a[c];d!==b&&throwError(`The '${c}' parameter has the wrong type. (Expected:
|
||||
${b}, actual: ${d})`);}function isArrayOfType(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing
|
||||
one or more '${b}' elements.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])typeof e!==b&&throwError(d);}function isArrayOfClass(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing
|
||||
one or more '${b.name}' instances.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])e instanceof b||throwError(d);}function throwError(a){a=a.replace(/\s+/g,' ');const b=new Error(a);b.name='assertion-failed';const c=ErrorStackParser.parse(b);throw 3<=c.length&&(b.message=`Invalid call to ${c[2].functionName}() — `+a),b}
|
||||
|
||||
function normalizeHandler(a){return'object'==typeof a?(hasMethod({handler:a},'handle'),a):(isType({handler:a},'function'),{handle:a})}
|
||||
|
||||
const defaultMethod='GET';const validMethods=['DELETE','GET','HEAD','POST','PUT'];
|
||||
|
||||
class Route{constructor({match:a,handler:b,method:c}={}){this.handler=normalizeHandler(b),isType({match:a},'function'),this.match=a,c?(isOneOf({method:c},validMethods),this.method=c):this.method=defaultMethod;}}
|
||||
|
||||
var index$1=Array.isArray||function(a){return'[object Array]'==Object.prototype.toString.call(a)};
|
||||
|
||||
var index=pathToRegexp; var parse_1=parse; var compile_1=compile; var tokensToFunction_1=tokensToFunction; var tokensToRegExp_1=tokensToRegExp; var PATH_REGEXP=new RegExp('(\\\\.)|([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))','g');function parse(a,b){for(var c,d=[],e=0,f=0,g='',h=b&&b.delimiter||'/';null!=(c=PATH_REGEXP.exec(a));){var i=c[0],j=c[1],k=c.index;if(g+=a.slice(f,k),f=k+i.length,j){g+=j[1];continue}var l=a[f],m=c[2],n=c[3],o=c[4],p=c[5],q=c[6],r=c[7];g&&(d.push(g),g='');var s=c[2]||h,t=o||p;d.push({name:n||e++,prefix:m||'',delimiter:s,optional:'?'===q||'*'===q,repeat:'+'===q||'*'===q,partial:null!=m&&null!=l&&l!==m,asterisk:!!r,pattern:t?escapeGroup(t):r?'.*':'[^'+escapeString(s)+']+?'});}return f<a.length&&(g+=a.substr(f)),g&&d.push(g),d}function compile(a,b){return tokensToFunction(parse(a,b))}function encodeURIComponentPretty(a){return encodeURI(a).replace(/[\/?#]/g,function(a){return'%'+a.charCodeAt(0).toString(16).toUpperCase()})}function encodeAsterisk(a){return encodeURI(a).replace(/[?#]/g,function(a){return'%'+a.charCodeAt(0).toString(16).toUpperCase()})}function tokensToFunction(a){for(var b=Array(a.length),c=0;c<a.length;c++)'object'==typeof a[c]&&(b[c]=new RegExp('^(?:'+a[c].pattern+')$'));return function(c,d){for(var e,f='',g=c||{},h=d||{},k=h.pretty?encodeURIComponentPretty:encodeURIComponent,l=0;l<a.length;l++){if(e=a[l],'string'==typeof e){f+=e;continue}var i,m=g[e.name];if(null==m)if(e.optional){e.partial&&(f+=e.prefix);continue}else throw new TypeError('Expected "'+e.name+'" to be defined');if(index$1(m)){if(!e.repeat)throw new TypeError('Expected "'+e.name+'" to not repeat, but received `'+JSON.stringify(m)+'`');if(0===m.length)if(e.optional)continue;else throw new TypeError('Expected "'+e.name+'" to not be empty');for(var n=0;n<m.length;n++){if(i=k(m[n]),!b[l].test(i))throw new TypeError('Expected all "'+e.name+'" to match "'+e.pattern+'", but received `'+JSON.stringify(i)+'`');f+=(0===n?e.prefix:e.delimiter)+i;}continue}if(i=e.asterisk?encodeAsterisk(m):k(m),!b[l].test(i))throw new TypeError('Expected "'+e.name+'" to match "'+e.pattern+'", but received "'+i+'"');f+=e.prefix+i;}return f}}function escapeString(a){return a.replace(/([.+*?=^!:${}()[\]|\/\\])/g,'\\$1')}function escapeGroup(a){return a.replace(/([=!:$\/()])/g,'\\$1')}function attachKeys(a,b){return a.keys=b,a}function flags(a){return a.sensitive?'':'i'}function regexpToRegexp(a,b){var c=a.source.match(/\((?!\?)/g);if(c)for(var d=0;d<c.length;d++)b.push({name:d,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return attachKeys(a,b)}function arrayToRegexp(a,b,c){for(var d=[],e=0;e<a.length;e++)d.push(pathToRegexp(a[e],b,c).source);var f=new RegExp('(?:'+d.join('|')+')',flags(c));return attachKeys(f,b)}function stringToRegexp(a,b,c){return tokensToRegExp(parse(a,c),b,c)}function tokensToRegExp(a,b,c){index$1(b)||(c=b||c,b=[]),c=c||{};for(var d,e=c.strict,f=!1!==c.end,g='',h=0;h<a.length;h++)if(d=a[h],'string'==typeof d)g+=escapeString(d);else{var i=escapeString(d.prefix),j='(?:'+d.pattern+')';b.push(d),d.repeat&&(j+='(?:'+i+j+')*'),j=d.optional?d.partial?i+'('+j+')?':'(?:'+i+'('+j+'))?':i+'('+j+')',g+=j;}var k=escapeString(c.delimiter||'/'),l=g.slice(-k.length)===k;return e||(g=(l?g.slice(0,-k.length):g)+'(?:'+k+'(?=$))?'),g+=f?'$':e&&l?'':'(?='+k+'|$)',attachKeys(new RegExp('^'+g,flags(c)),b)}function pathToRegexp(a,b,c){return index$1(b)||(c=b||c,b=[]),c=c||{},a instanceof RegExp?regexpToRegexp(a,b):index$1(a)?arrayToRegexp(a,b,c):stringToRegexp(a,b,c)}index.parse=parse_1,index.compile=compile_1,index.tokensToFunction=tokensToFunction_1,index.tokensToRegExp=tokensToRegExp_1;
|
||||
|
||||
class ExpressRoute extends Route{constructor({path:a,handler:b,method:c}){if(!(a.startsWith('/')||a.startsWith('http')))throw ErrorFactory$3.createError('express-route-invalid-path');let d=[];const e=index(a,d);super({match:({url:b})=>{if(a.startsWith('/')&&b.origin!==location.origin)return null;const c=a.startsWith('/')?b.pathname:b.href,f=c.match(e);if(!f)return null;const g={};return d.forEach((a,b)=>{g[a.name]=f[b+1];}),g},handler:b,method:c});}}
|
||||
|
||||
class NavigationRoute extends Route{constructor({whitelist:a,blacklist:b,handler:c}={}){isArrayOfClass({whitelist:a},RegExp),b?isArrayOfClass({blacklist:b},RegExp):b=[];super({match:({event:d,url:e})=>{let f,g=!1;if('navigate'===d.request.mode){const d=e.pathname+e.search;a.some((a)=>a.test(d))?b.some((a)=>a.test(d))?f=`The navigation route is not being used, since the `+`request URL matches both the whitelist and blacklist.`:(f=`The navigation route is being used.`,g=!0):f=`The navigation route is not being used, since the `+`URL being navigated to doesn't match the whitelist.`,logHelper.debug({that:this,message:f,data:{"request-url":e.href,whitelist:a,blacklist:b,handler:c}});}return g},handler:c,method:'GET'});}}
|
||||
|
||||
class RegExpRoute extends Route{constructor({regExp:a,handler:b,method:c}){isInstance({regExp:a},RegExp);super({match:({url:b})=>{const c=a.exec(b.href);return c?b.origin!==location.origin&&0!==c.index?(logHelper.debug({that:this,message:`Skipping route, because the RegExp match didn't occur `+`at the start of the URL.`,data:{url:b.href,regExp:a}}),null):c.slice(1):null},handler:b,method:c});}}
|
||||
|
||||
class Router$2{constructor(){this._routes=new Map,this._isListenerRegistered=!1;}addFetchListener(){return this._isListenerRegistered?(logHelper.warn({that:this,message:`addFetchListener() has already been called for this Router.`}),!1):(this._isListenerRegistered=!0,self.addEventListener('fetch',(a)=>{const b=this.handleRequest({event:a});b&&a.respondWith(b);}),!0)}handleRequest({event:a}){isInstance({event:a},FetchEvent);const b=new URL(a.request.url);if(!b.protocol.startsWith('http'))return void logHelper.log({that:this,message:`The URL does not start with HTTP, so it can't be handled.`,data:{request:a.request}});let{handler:c,params:d}=this._findHandlerAndParams({event:a,url:b});if(!c&&this.defaultHandler&&(c=this.defaultHandler),c){let e=c.handle({url:b,event:a,params:d});return this.catchHandler&&(e=e.catch((c)=>this.catchHandler.handle({url:b,event:a,error:c}))),e}}_findHandlerAndParams({event:a,url:b}){const c=this._routes.get(a.request.method)||[];for(const d of c){let c=d.match({url:b,event:a});if(c)return logHelper.log({that:this,message:'The router found a matching route.',data:{route:d,request:a.request}}),Array.isArray(c)&&0===c.length?c=void 0:c.constructor===Object&&0===Object.keys(c).length&&(c=void 0),{params:c,handler:d.handler}}return{handler:void 0,params:void 0}}setDefaultHandler({handler:a}={}){this.defaultHandler=normalizeHandler(a);}setCatchHandler({handler:a}={}){this.catchHandler=normalizeHandler(a);}registerRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a)this._routes.has(b.method)||this._routes.set(b.method,[]),this._routes.get(b.method).unshift(b);}registerRoute({route:a}={}){isInstance({route:a},Route),this.registerRoutes({routes:[a]});}unregisterRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a){this._routes.has(b.method)||logHelper.error({that:this,message:`Can't unregister route; there are no ${b.method}
|
||||
routes registered.`,data:{route:b}});const a=this._routes.get(b.method).indexOf(b);-1<a?this._routes.get(b.method).splice(a,1):logHelper.error({that:this,message:`Can't unregister route; the route wasn't previously
|
||||
registered.`,data:{route:b}});}}unregisterRoute({route:a}={}){isInstance({route:a},Route),this.unregisterRoutes({routes:[a]});}}
|
||||
|
||||
class Router$$1 extends Router$2{constructor(a,b){super({handleFetch:b}),this._revisionedCacheName=a;}registerRoute(a,b,c='GET'){'function'==typeof b&&(b={handle:b});let d;if('string'==typeof a){if(0===a.length)throw ErrorFactory.createError('empty-express-string');const e=a.startsWith('http')?new URL(a,location).pathname:a,f=e.match(/[*:?+]/);f&&logHelper.warn({message:`registerRoute() was called with a string containing an `+`Express-style wildcard character. In the next version of `+`Workbox, Express-style wildcards won't be supported, and `+`strings will be treated a exact matches. Please switch to `+`regular expressions for equivalent behavior.`,data:{"Path String":a,"Wildcard Character":f[0],"Learn More":'https://goo.gl/xZMKEV'}}),d=new ExpressRoute({path:a,handler:b,method:c});}else if(a instanceof RegExp)d=new RegExpRoute({regExp:a,handler:b,method:c});else if('function'==typeof a)d=new Route({match:a,handler:b,method:c});else throw ErrorFactory.createError('unsupported-route-type');return super.registerRoute({route:d}),d}registerNavigationRoute(a,b={}){if('string'!=typeof a)throw ErrorFactory.createError('navigation-route-url-string');const c='cacheName'in b?b.cacheName:this._revisionedCacheName;super.registerRoute({route:new NavigationRoute({handler:()=>caches.match(a,{cacheName:c}),whitelist:b.whitelist||[/./],blacklist:b.blacklist||[]})});}}
|
||||
|
||||
const errors$2={"multiple-cache-will-update-plugins":'You cannot register more than one plugin that implements cacheWillUpdate.',"multiple-cached-response-will-be-used-plugins":'You cannot register more than one plugin that implements cachedResponseWillBeUsed.',"invalid-response-for-caching":'The fetched response could not be cached due to an invalid response code.',"no-response-received":'No response received; falling back to cache.',"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character.`};var ErrorFactory$4 = new ErrorFactory$1(errors$2);
|
||||
|
||||
class CacheableResponse{constructor({statuses:a,headers:b}={}){atLeastOne({statuses:a,headers:b}),a!==void 0&&isArrayOfType({statuses:a},'number'),b!==void 0&&isType({headers:b},'object'),this.statuses=a,this.headers=b;}isResponseCacheable({request:a,response:b}={}){isInstance({response:b},Response);let c=!0;if(this.statuses&&(c=this.statuses.includes(b.status)),this.headers&&c&&(c=Object.keys(this.headers).some((a)=>b.headers.get(a)===this.headers[a])),!c){const c={response:b};this.statuses&&(c['valid-status-codes']=JSON.stringify(this.statuses)),this.headers&&(c['valid-headers']=JSON.stringify(this.headers)),a&&(c.request=a),logHelper.debug({message:`The response does not meet the criteria for being added to the
|
||||
cache.`,data:c});}return c}}
|
||||
|
||||
class CacheableResponsePlugin extends CacheableResponse{cacheWillUpdate({request:a,response:b}={}){return this.isResponseCacheable({request:a,response:b})}}
|
||||
|
||||
const getDefaultCacheName=({cacheId:a}={})=>{let b=`workbox-runtime-caching`;return a&&(b=`${a}-${b}`),self&&self.registration&&(b+=`-${self.registration.scope}`),b};
|
||||
const pluginCallbacks=['cacheDidUpdate','cachedResponseWillBeUsed','cacheWillUpdate','fetchDidFail','requestWillFetch'];
|
||||
|
||||
var cleanResponseCopy = (({response:a})=>{isInstance({response:a},Response);const b=a.clone(),c='body'in b?Promise.resolve(b.body):b.blob();return c.then((a)=>new Response(a,{headers:b.headers,status:b.status,statusText:b.statusText}))});
|
||||
|
||||
var asyncToGenerator = function (fn) {
|
||||
return function () {
|
||||
var gen = fn.apply(this, arguments);
|
||||
return new Promise(function (resolve, reject) {
|
||||
function step(key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
return Promise.resolve(value).then(function (value) {
|
||||
step("next", value);
|
||||
}, function (err) {
|
||||
step("throw", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return step("next");
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
class RequestWrapper{constructor({cacheName:a,cacheId:b,plugins:c,fetchOptions:d,matchOptions:e}={}){if(b&&('string'!=typeof b||0===b.length))throw ErrorFactory$4.createError('bad-cache-id');a?(isType({cacheName:a},'string'),this.cacheName=a,b&&(this.cacheName=`${b}-${this.cacheName}`)):this.cacheName=getDefaultCacheName({cacheId:b}),d&&(isType({fetchOptions:d},'object'),this.fetchOptions=d),e&&(isType({matchOptions:e},'object'),this.matchOptions=e),this.plugins=new Map,c&&(isArrayOfType({plugins:c},'object'),c.forEach((a)=>{for(let b of pluginCallbacks)if('function'==typeof a[b]){if(!this.plugins.has(b))this.plugins.set(b,[]);else if('cacheWillUpdate'===b)throw ErrorFactory$4.createError('multiple-cache-will-update-plugins');else if('cachedResponseWillBeUsed'===b)throw ErrorFactory$4.createError('multiple-cached-response-will-be-used-plugins');this.plugins.get(b).push(a);}})),this.plugins.has('cacheWillUpdate')&&(this._userSpecifiedCachableResponsePlugin=this.plugins.get('cacheWillUpdate')[0]);}getDefaultCacheableResponsePlugin(){return this._defaultCacheableResponsePlugin||(this._defaultCacheableResponsePlugin=new CacheableResponsePlugin({statuses:[200]})),this._defaultCacheableResponsePlugin}getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.cacheName)),a._cache})()}match({request:a}){var b=this;return asyncToGenerator(function*(){atLeastOne({request:a});const c=yield b.getCache();let d=yield c.match(a,b.matchOptions);if(b.plugins.has('cachedResponseWillBeUsed')){const e=b.plugins.get('cachedResponseWillBeUsed')[0];d=yield e.cachedResponseWillBeUsed({request:a,cache:c,cachedResponse:d,matchOptions:b.matchOptions,cacheName:b.cacheName});}return d})()}fetch({request:a}){var b=this;return asyncToGenerator(function*(){'string'==typeof a?a=new Request(a):isInstance({request:a},Request);const c=b.plugins.has('fetchDidFail')?a.clone():null;if(b.plugins.has('requestWillFetch'))for(let c of b.plugins.get('requestWillFetch')){const b=yield c.requestWillFetch({request:a});isInstance({returnedRequest:b},Request),a=b;}try{return yield fetch(a,b.fetchOptions)}catch(a){if(b.plugins.has('fetchDidFail'))for(let a of b.plugins.get('fetchDidFail'))yield a.fetchDidFail({request:c.clone()});throw a}})()}fetchAndCache({request:a,waitOnCache:b,cacheKey:c,cacheResponsePlugin:d,cleanRedirects:e}){var f=this;return asyncToGenerator(function*(){atLeastOne({request:a});let g;const h=yield f.fetch({request:a}),i=f._userSpecifiedCachableResponsePlugin||d||f.getDefaultCacheableResponsePlugin(),j=yield i.cacheWillUpdate({request:a,response:h});if(j){const b=e&&h.redirected?yield cleanResponseCopy({response:h}):h.clone();g=f.getCache().then((()=>{var d=asyncToGenerator(function*(d){let e;const g=c||a;if('opaque'!==h.type&&f.plugins.has('cacheDidUpdate')&&(e=yield f.match({request:g})),yield d.put(g,b),f.plugins.has('cacheDidUpdate'))for(let a of f.plugins.get('cacheDidUpdate'))yield a.cacheDidUpdate({cacheName:f.cacheName,oldResponse:e,newResponse:b,url:'url'in g?g.url:g});});return function(){return d.apply(this,arguments)}})());}else if(!j&&b)throw ErrorFactory$4.createError('invalid-response-for-caching');return b&&g&&(yield g),h})()}}
|
||||
|
||||
class Handler{constructor({requestWrapper:a,waitOnCache:b}={}){this.requestWrapper=a?a:new RequestWrapper,this.waitOnCache=!!b;}handle({event:a,params:b}={}){throw Error('This abstract method must be implemented in a subclass.')}}
|
||||
|
||||
class CacheFirst extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=yield b.requestWrapper.match({request:a.request});return c||(yield b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache}))})()}}
|
||||
|
||||
class CacheOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.match({request:a.request})})()}}
|
||||
|
||||
class NetworkFirst extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});const{networkTimeoutSeconds:b}=a;b&&(isType({networkTimeoutSeconds:b},'number'),this.networkTimeoutSeconds=b);}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=[];let d;b.networkTimeoutSeconds&&c.push(new Promise(function(c){d=setTimeout(function(){c(b.requestWrapper.match({request:a.request}));},1e3*b.networkTimeoutSeconds);}));const e=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).then(function(a){return d&&clearTimeout(d),a?a:Promise.reject(ErrorFactory$4.createError('no-response-received'))}).catch(function(){return b.requestWrapper.match({request:a.request})});return c.push(e),Promise.race(c)})()}}
|
||||
|
||||
class NetworkOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.fetch({request:a.request})})()}}
|
||||
|
||||
class StaleWhileRevalidate extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).catch(function(){return Response.error()}),d=yield b.requestWrapper.match({request:a.request});return d||(yield c)})()}}
|
||||
|
||||
let tmpIdbName=`workbox-cache-expiration`;self&&self.registration&&(tmpIdbName+=`-${self.registration.scope}`);const idbName=tmpIdbName;const idbVersion=1;const urlPropertyName='url';const timestampPropertyName='timestamp';
|
||||
|
||||
function createCommonjsModule(fn, module) {
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
var idb=createCommonjsModule(function(a){'use strict';(function(){function b(a){return Array.prototype.slice.call(a)}function c(a){return new Promise(function(b,c){a.onsuccess=function(){b(a.result);},a.onerror=function(){c(a.error);};})}function d(a,b,d){var e,f=new Promise(function(f,g){e=a[b].apply(a,d),c(e).then(f,g);});return f.request=e,f}function e(a,b,c){var e=d(a,b,c);return e.then(function(a){return a?new k(a,e.request):void 0})}function f(a,b,c){c.forEach(function(c){Object.defineProperty(a.prototype,c,{get:function(){return this[b][c]},set:function(a){this[b][c]=a;}});});}function g(a,b,c,e){e.forEach(function(e){e in c.prototype&&(a.prototype[e]=function(){return d(this[b],e,arguments)});});}function h(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return this[b][d].apply(this[b],arguments)});});}function i(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return e(this[b],d,arguments)});});}function j(a){this._index=a;}function k(a,b){this._cursor=a,this._request=b;}function l(a){this._store=a;}function m(a){this._tx=a,this.complete=new Promise(function(b,c){a.oncomplete=function(){b();},a.onerror=function(){c(a.error);},a.onabort=function(){c(a.error);};});}function n(a,b,c){this._db=a,this.oldVersion=b,this.transaction=new m(c);}function o(a){this._db=a;}f(j,'_index',['name','keyPath','multiEntry','unique']),g(j,'_index',IDBIndex,['get','getKey','getAll','getAllKeys','count']),i(j,'_index',IDBIndex,['openCursor','openKeyCursor']),f(k,'_cursor',['direction','key','primaryKey','value']),g(k,'_cursor',IDBCursor,['update','delete']),['advance','continue','continuePrimaryKey'].forEach(function(a){a in IDBCursor.prototype&&(k.prototype[a]=function(){var b=this,d=arguments;return Promise.resolve().then(function(){return b._cursor[a].apply(b._cursor,d),c(b._request).then(function(a){return a?new k(a,b._request):void 0})})});}),l.prototype.createIndex=function(){return new j(this._store.createIndex.apply(this._store,arguments))},l.prototype.index=function(){return new j(this._store.index.apply(this._store,arguments))},f(l,'_store',['name','keyPath','indexNames','autoIncrement']),g(l,'_store',IDBObjectStore,['put','add','delete','clear','get','getAll','getKey','getAllKeys','count']),i(l,'_store',IDBObjectStore,['openCursor','openKeyCursor']),h(l,'_store',IDBObjectStore,['deleteIndex']),m.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))},f(m,'_tx',['objectStoreNames','mode']),h(m,'_tx',IDBTransaction,['abort']),n.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))},f(n,'_db',['name','version','objectStoreNames']),h(n,'_db',IDBDatabase,['deleteObjectStore','close']),o.prototype.transaction=function(){return new m(this._db.transaction.apply(this._db,arguments))},f(o,'_db',['name','version','objectStoreNames']),h(o,'_db',IDBDatabase,['close']),['openCursor','openKeyCursor'].forEach(function(a){[l,j].forEach(function(c){c.prototype[a.replace('open','iterate')]=function(){var c=b(arguments),d=c[c.length-1],e=this._store||this._index,f=e[a].apply(e,c.slice(0,-1));f.onsuccess=function(){d(f.result);};};});}),[j,l].forEach(function(a){a.prototype.getAll||(a.prototype.getAll=function(a,b){var c=this,d=[];return new Promise(function(e){c.iterateCursor(a,function(a){return a?(d.push(a.value),void 0!==b&&d.length==b?void e(d):void a.continue()):void e(d)});})});});var p={open:function(a,b,c){var e=d(indexedDB,'open',[a,b]),f=e.request;return f.onupgradeneeded=function(a){c&&c(new n(f.result,a.oldVersion,f.transaction));},e.then(function(a){return new o(a)})},delete:function(a){return d(indexedDB,'deleteDatabase',[a])}};a.exports=p,a.exports.default=a.exports;})();});
|
||||
|
||||
const errors$3={"max-entries-or-age-required":`Either the maxEntries or maxAgeSeconds
|
||||
parameters (or both) are required when constructing Plugin.`,"max-entries-must-be-number":`The maxEntries parameter to the Plugin
|
||||
constructor must either be a number or undefined.`,"max-age-seconds-must-be-number":`The maxAgeSeconds parameter to the Plugin
|
||||
constructor must either be a number or undefined.`};var ErrorFactory$5 = new ErrorFactory$1(errors$3);
|
||||
|
||||
class CacheExpiration{constructor({maxEntries:a,maxAgeSeconds:b}={}){if(!(a||b))throw ErrorFactory$5.createError('max-entries-or-age-required');if(a&&'number'!=typeof a)throw ErrorFactory$5.createError('max-entries-must-be-number');if(b&&'number'!=typeof b)throw ErrorFactory$5.createError('max-age-seconds-must-be-number');this.maxEntries=a,this.maxAgeSeconds=b,this._dbs=new Map,this._caches=new Map,this._expirationMutex=!1,this._timestampForNextRun=null;}getDB({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=`${idbName}-${a}`;if(!b._dbs.has(c)){const d=yield idb.open(c,idbVersion,function(b){const c=b.createObjectStore(a,{keyPath:urlPropertyName});c.createIndex(timestampPropertyName,timestampPropertyName,{unique:!1});});b._dbs.set(c,d);}return b._dbs.get(c)})()}getCache({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),!b._caches.has(a)){const c=yield caches.open(a);b._caches.set(a,c);}return b._caches.get(a)})()}isResponseFresh({cacheName:a,cachedResponse:b,now:c}={}){if(b&&this.maxAgeSeconds){isInstance({cachedResponse:b},Response);const d=b.headers.get('date');if(d){'undefined'==typeof c&&(c=Date.now());const a=new Date(d),b=a.getTime();return!!isNaN(b)||b+1e3*this.maxAgeSeconds>c}return this.expireEntries({cacheName:a,now:c}),!0}return!0}updateTimestamp({cacheName:a,url:b,now:c}={}){var d=this;return asyncToGenerator(function*(){isType({url:b},'string'),isType({cacheName:a},'string');const e=new URL(b,location);e.hash='','undefined'==typeof c&&(c=Date.now());const f=yield d.getDB({cacheName:a}),g=f.transaction(a,'readwrite');g.objectStore(a).put({[timestampPropertyName]:c,[urlPropertyName]:e.href}),yield g.complete;})()}expireEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){if(c._expirationMutex)return void(c._timestampForNextRun=b);c._expirationMutex=!0,isType({cacheName:a},'string'),'undefined'==typeof b&&(b=Date.now());const d=c.maxAgeSeconds?yield c.findOldEntries({cacheName:a,now:b}):[],e=c.maxEntries?yield c.findExtraEntries({cacheName:a}):[],f=[...new Set(d.concat(e))];if(yield c.deleteFromCacheAndIDB({cacheName:a,urls:f}),0<f.length&&logHelper.debug({that:c,message:'Expired entries have been removed from the cache.',data:{cacheName:a,urls:f}}),c._expirationMutex=!1,c._timestampForNextRun){const b=c._timestampForNextRun;return c._timestampForNextRun=null,c.expireEntries({cacheName:a,now:b})}})()}findOldEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){isType({cacheName:a},'string'),isType({now:b},'number');const d=b-1e3*c.maxAgeSeconds,e=[],f=yield c.getDB({cacheName:a}),g=f.transaction(a,'readonly'),h=g.objectStore(a),i=h.index(timestampPropertyName);return i.iterateCursor(function(a){a&&(a.value[timestampPropertyName]<d&&e.push(a.value[urlPropertyName]),a.continue());}),yield g.complete,e})()}findExtraEntries({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=[],d=yield b.getDB({cacheName:a});let e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName);const h=yield g.count();return h>b.maxEntries&&(e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName),g.iterateCursor(function(a){a&&(c.push(a.value[urlPropertyName]),h-c.length>b.maxEntries&&a.continue());})),yield e.complete,c})()}deleteFromCacheAndIDB({cacheName:a,urls:b}={}){var c=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),isArrayOfType({urls:b},'string'),0<b.length){const d=yield c.getCache({cacheName:a}),e=yield c.getDB({cacheName:a});for(let c of b){yield d.delete(c);const b=e.transaction(a,'readwrite'),f=b.objectStore(a);f.delete(c),yield b.complete;}}})()}}
|
||||
|
||||
class CacheExpirationPlugin extends CacheExpiration{cachedResponseWillBeUsed({cacheName:a,cachedResponse:b,now:c}={}){return this.isResponseFresh({cacheName:a,cachedResponse:b,now:c})?b:null}cacheDidUpdate({cacheName:a,newResponse:b,url:c,now:d}={}){var e=this;return asyncToGenerator(function*(){isType({cacheName:a},'string'),isInstance({newResponse:b},Response),'undefined'==typeof d&&(d=Date.now()),yield e.updateTimestamp({cacheName:a,url:c,now:d}),yield e.expireEntries({cacheName:a,now:d});})()}}
|
||||
|
||||
const errors$4={"channel-name-required":`The channelName parameter is required when
|
||||
constructing a new BroadcastCacheUpdate instance.`,"responses-are-same-parameters-required":`The first, second, and
|
||||
headersToCheck parameters must be valid when calling responsesAreSame()`};var ErrorFactory$6 = new ErrorFactory$1(errors$4);
|
||||
|
||||
const cacheUpdatedMessageType='CACHE_UPDATED';
|
||||
const defaultHeadersToCheck=['content-length','etag','last-modified'];
|
||||
const defaultSource='workbox-broadcast-cache-update';
|
||||
|
||||
function broadcastUpdate({channel:a,cacheName:b,url:c,source:d}={}){isInstance({channel:a},BroadcastChannel),isType({cacheName:b},'string'),isType({source:d},'string'),isType({url:c},'string'),a.postMessage({type:cacheUpdatedMessageType,meta:d,payload:{cacheName:b,updatedUrl:c}});}
|
||||
|
||||
function responsesAreSame({first:a,second:b,headersToCheck:c}={}){if(!(a instanceof Response&&b instanceof Response&&c instanceof Array))throw ErrorFactory$6.createError('responses-are-same-parameters-required');const d=c.some((c)=>a.headers.has(c)&&b.headers.has(c));return d?c.every((c)=>a.headers.has(c)===b.headers.has(c)&&a.headers.get(c)===b.headers.get(c)):(logHelper.log({message:`Unable to determine whether the response has been updated
|
||||
because none of the headers that would be checked are present.`,data:{"First Response":a,"Second Response":b,"Headers To Check":JSON.stringify(c)}}),!0)}
|
||||
|
||||
class BroadcastCacheUpdate{constructor({channelName:a,headersToCheck:b,source:c}={}){if('string'!=typeof a||0===a.length)throw ErrorFactory$6.createError('channel-name-required');this.channelName=a,this.headersToCheck=b||defaultHeadersToCheck,this.source=c||defaultSource;}get channel(){return this._channel||(this._channel=new BroadcastChannel(this.channelName)),this._channel}notifyIfUpdated({first:a,second:b,cacheName:c,url:d}){isType({cacheName:c},'string'),responsesAreSame({first:a,second:b,headersToCheck:this.headersToCheck})||broadcastUpdate({cacheName:c,url:d,channel:this.channel,source:this.source});}}
|
||||
|
||||
class BroadcastCacheUpdatePlugin extends BroadcastCacheUpdate{cacheDidUpdate({cacheName:a,oldResponse:b,newResponse:c,url:d}){isType({cacheName:a},'string'),isInstance({newResponse:c},Response),b&&this.notifyIfUpdated({cacheName:a,first:b,second:c,url:d});}}
|
||||
|
||||
class Strategies{constructor({cacheId:a}={}){this._cacheId=a;}cacheFirst(a){return this._getCachingMechanism(CacheFirst,a)}cacheOnly(a){return this._getCachingMechanism(CacheOnly,a)}networkFirst(a){return this._getCachingMechanism(NetworkFirst,a)}networkOnly(a){return this._getCachingMechanism(NetworkOnly,a)}staleWhileRevalidate(a){return this._getCachingMechanism(StaleWhileRevalidate,a)}_getCachingMechanism(a,b={}){const c={cacheExpiration:CacheExpirationPlugin,broadcastCacheUpdate:BroadcastCacheUpdatePlugin,cacheableResponse:CacheableResponsePlugin},d={plugins:[]};b.excludeCacheId||(d.cacheId=this._cacheId),b.cacheName&&(d.cacheName=b.cacheName);const e=Object.keys(c);return e.forEach((a)=>{if(b[a]){const e=c[a],f=b[a];d.plugins.push(new e(f));}}),b.plugins&&b.plugins.forEach((a)=>{d.plugins.push(a);}),b.requestWrapper=new RequestWrapper(d),new a(b)}}
|
||||
|
||||
const errorMessageFactory=(a,b)=>{let c=`An error was thrown by workbox with error code: `+`;'${a}'`;return b&&(c+=` with extras: '${JSON.stringify(b)}'`),c};
|
||||
|
||||
class WorkboxError extends Error{constructor(a,b){super(),this.name=a,this.message=errorMessageFactory(a,b),b&&(this.extras=b);}}
|
||||
|
||||
class BaseCacheManager{constructor({cacheName:a,cacheId:b,plugins:c}={}){if(b&&('string'!=typeof b||0===b.length))throw new WorkboxError('bad-cache-id',{cacheId:b});this._entriesToCache=new Map,this._requestWrapper=new RequestWrapper({cacheName:a,cacheId:b,plugins:c,fetchOptions:{credentials:'same-origin'}});}_addEntries(a){this._parsedCacheUrls=null,a.forEach((a)=>{this._addEntryToInstallList(this._parseEntry(a));});}getCacheName(){return this._requestWrapper.cacheName}getCachedUrls(){return this._parsedCacheUrls||(this._parsedCacheUrls=Array.from(this._entriesToCache.keys()).map((a)=>new URL(a,location).href)),this._parsedCacheUrls}_addEntryToInstallList(a){const b=a.entryID,c=this._entriesToCache.get(a.entryID);return c?void this._onDuplicateInstallEntryFound(a,c):void this._entriesToCache.set(b,a)}install(){var a=this;return asyncToGenerator(function*(){if(0===a._entriesToCache.size)return[];const b=[];return a._entriesToCache.forEach(function(c){b.push(a._cacheEntry(c));}),Promise.all(b)})()}_cacheEntry(a){var b=this;return asyncToGenerator(function*(){const c=yield b._isAlreadyCached(a),d={url:a.request.url,revision:a.revision,wasUpdated:!c};if(c)return d;try{return yield b._requestWrapper.fetchAndCache({request:a.getNetworkRequest(),waitOnCache:!0,cacheKey:a.request,cleanRedirects:!0}),yield b._onEntryCached(a),d}catch(b){throw new WorkboxError('request-not-cached',{url:a.request.url,error:b})}})()}cleanup(){var a=this;return asyncToGenerator(function*(){if(!(yield caches.has(a.getCacheName())))return;const b=[];a._entriesToCache.forEach(function(a){b.push(a.request.url);});const c=yield a._getCache(),d=yield c.keys(),e=d.filter(function(a){return!b.includes(a.url)});return Promise.all(e.map((()=>{var b=asyncToGenerator(function*(b){yield c.delete(b),yield a._onEntryDeleted(b.url);});return function(){return b.apply(this,arguments)}})()))})()}_getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.getCacheName())),a._cache})()}_parseEntry(){throw new WorkboxError('requires-overriding')}_onDuplicateEntryFound(){throw new WorkboxError('requires-overriding')}_isAlreadyCached(){throw new WorkboxError('requires-overriding')}_onEntryCached(){throw new WorkboxError('requires-overriding')}_onEntryDeleted(){throw new WorkboxError('requires-overriding')}}
|
||||
|
||||
class IDBHelper{constructor(a,b,c){if(a==void 0||b==void 0||c==void 0)throw Error('name, version, storeName must be passed to the constructor.');this._name=a,this._version=b,this._storeName=c;}_getDb(){return this._dbPromise?this._dbPromise:(this._dbPromise=idb.open(this._name,this._version,(a)=>{a.createObjectStore(this._storeName);}).then((a)=>a),this._dbPromise)}close(){return this._dbPromise?this._dbPromise.then((a)=>{a.close(),this._dbPromise=null;}):void 0}put(a,b){return this._getDb().then((c)=>{const d=c.transaction(this._storeName,'readwrite'),e=d.objectStore(this._storeName);return e.put(b,a),d.complete})}delete(a){return this._getDb().then((b)=>{const c=b.transaction(this._storeName,'readwrite'),d=c.objectStore(this._storeName);return d.delete(a),c.complete})}get(a){return this._getDb().then((b)=>b.transaction(this._storeName).objectStore(this._storeName).get(a))}getAllValues(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAll())}getAllKeys(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAllKeys())}}
|
||||
|
||||
const cacheBustParamName='_workbox-precaching';const version='v1';const dbName='workbox-precaching';const dbVersion='1';const dbStorename='asset-revisions';let tmpRevisionedCacheName=`workbox-precaching-revisioned-${version}`;self&&self.registration&&(tmpRevisionedCacheName+=`-${self.registration.scope}`);const defaultRevisionedCacheName=tmpRevisionedCacheName;
|
||||
|
||||
class RevisionDetailsModel{constructor(){this._idbHelper=new IDBHelper(dbName,dbVersion,dbStorename);}get(a){return this._idbHelper.get(a)}put(a,b){return this._idbHelper.put(a,b)}delete(a){return this._idbHelper.delete(a)}_close(){this._idbHelper.close();}}
|
||||
|
||||
class BaseCacheEntry{constructor({entryID:a,revision:b,request:c,cacheBust:d}){this.entryID=a,this.revision=b,this.request=c,this.cacheBust=d;}getNetworkRequest(){if(!0!==this.cacheBust)return this.request;let a=this.request.url;const b={};if(!0===this.cacheBust)if('cache'in Request.prototype)b.cache='reload';else{const b=new URL(a,location);b.search+=(b.search?'&':'')+encodeURIComponent(cacheBustParamName)+'='+encodeURIComponent(this.revision),a=b.toString();}return new Request(a,b)}}
|
||||
|
||||
class StringCacheEntry extends BaseCacheEntry{constructor(a){if(isType({url:a},'string'),0===a.length)throw new WorkboxError('invalid-string-entry',{url:a});super({entryID:a,revision:a,request:new Request(a),cacheBust:!1});}}
|
||||
|
||||
class ObjectCacheEntry extends BaseCacheEntry{constructor({entryID:a,revision:b,url:c,cacheBust:d}){if('undefined'!=typeof b&&(isType({revision:b},'string'),0===b.length))throw new WorkboxError('invalid-object-entry',{problemParam:'revision',problemValue:b});if('undefined'==typeof d&&(d=!!b),isType({cacheBust:d},'boolean'),isType({url:c},'string'),0===c.length)throw new WorkboxError('invalid-object-entry',{problemParam:'url',problemValue:c});if('undefined'==typeof a)a=new URL(c,location).toString();else if(0===a.length)throw new WorkboxError('invalid-object-entry',{problemParam:'entryID',problemValue:a});super({entryID:a,revision:b||c,request:new Request(c),cacheBust:d});}}
|
||||
|
||||
class RevisionedCacheManager extends BaseCacheManager{constructor(a={}){a.cacheName=a.cacheName||defaultRevisionedCacheName,super(a),this._revisionDetailsModel=new RevisionDetailsModel;}addToCacheList({revisionedFiles:a}={}){isInstance({revisionedFiles:a},Array),super._addEntries(a);const b=a.filter((a)=>'string'==typeof a||!a.revision);0<b.length&&logHelper.debug({that:this,message:`Some precache entries are URLs without separate revision
|
||||
fields. If the URLs themselves do not contain revisioning info,
|
||||
like a hash or a version number, your users won't receive updates.`,data:{"URLs without revision fields":JSON.stringify(b),"Examples of safe, versioned URLs":`'/path/file.abcd1234.css' or '/v1.0.0/file.js'`,"Examples of dangerous, unversioned URLs":`'index.html' or '/path/file.css' or '/latest/file.js'`}});}_parseEntry(a){if(null===a)throw new WorkboxError('unexpected-precache-entry',{input:a});let b;switch(typeof a){case'string':b=new StringCacheEntry(a);break;case'object':b=new ObjectCacheEntry(a);break;default:throw new WorkboxError('unexpected-precache-entry',{input:a});}return b}_onDuplicateInstallEntryFound(a,b){if(b.revision!==a.revision)throw new WorkboxError('duplicate-entry-diff-revisions',{firstEntry:{url:b.request.url,revision:b.revision},secondEntry:{url:a.request.url,revision:a.revision}})}_isAlreadyCached(a){var b=this;return asyncToGenerator(function*(){const c=yield b._revisionDetailsModel.get(a.entryID);if(c!==a.revision)return!1;const d=yield b._getCache(),e=yield d.match(a.request);return!!e})()}_onEntryCached(a){var b=this;return asyncToGenerator(function*(){yield b._revisionDetailsModel.put(a.entryID,a.revision);})()}_onEntryDeleted(a){var b=this;return asyncToGenerator(function*(){yield b._revisionDetailsModel.delete(a);})()}_close(){this._revisionDetailsModel._close();}cleanup(){return super.cleanup().then(()=>this._close())}_createLogFriendlyString(a){let b=`\n`;return a.forEach((a)=>{b+=` URL: '${a.url}' Revision: `+`'${a.revision}'\n`;}),b}install(){return super.install().then((a)=>{const b=[],c=[];a.forEach((a)=>{a.wasUpdated?b.push({url:a.url,revision:a.revision}):c.push({url:a.url,revision:a.revision});});const d={};return 0<b.length&&(d['New / Updated Precache URL\'s']=this._createLogFriendlyString(b)),0<c.length&&(d['Up-to-date Precache URL\'s']=this._createLogFriendlyString(c)),logHelper.log({message:`Precache Details: ${b.length} requests `+`were added or updated and `+`${c.length} request are already `+`cached and up-to-date.`,data:d}),a})}}
|
||||
|
||||
if(!isServiceWorkerGlobalScope())throw new WorkboxError('not-in-sw');
|
||||
|
||||
class WorkboxSW$1{constructor({cacheId:a,skipWaiting:b,clientsClaim:c,handleFetch:d=!0,directoryIndex:e='index.html',precacheChannelName:f='precache-updates',ignoreUrlParametersMatching:g=[/^utm_/]}={}){if(!isServiceWorkerGlobalScope())throw ErrorFactory.createError('not-in-sw');if(isDevBuild()&&(isLocalhost()?logHelper.debug({message:'Welcome to Workbox!',data:{"📖":'Read the guides and documentation\nhttps://workboxjs.org/',"❓":'Use the [workbox] tag on StackOverflow to ask questions\nhttps://stackoverflow.com/questions/ask?tags=workbox',"🐛":'Found a bug? Report it on GitHub\nhttps://github.com/GoogleChrome/workbox/issues/new'}}):logHelper.warn(`This appears to be a production server. Please switch
|
||||
to the smaller, optimized production build of Workbox.`)),a&&('string'!=typeof a||0===a.length))throw ErrorFactory.createError('bad-cache-id');if(b&&'boolean'!=typeof b)throw ErrorFactory.createError('bad-skip-waiting');if(c&&'boolean'!=typeof c)throw ErrorFactory.createError('bad-clients-claim');if('undefined'!=typeof e)if(!1===e||null===e)e=!1;else if('string'!=typeof e||0===e.length)throw ErrorFactory.createError('bad-directory-index');const h=[];f&&h.push(new BroadcastCacheUpdatePlugin({channelName:f,source:registration&®istration.scope?registration.scope:location})),this._runtimeCacheName=getDefaultCacheName({cacheId:a}),this._revisionedCacheManager=new RevisionedCacheManager({cacheId:a,plugins:h}),this._strategies=new Strategies({cacheId:a}),this._precacheRouter=new Router$$1(this._revisionedCacheManager.getCacheName()),this._router=new Router$$1(this._revisionedCacheManager.getCacheName()),d&&(this._precacheRouter.addFetchListener(),this._router.addFetchListener()),this._registerInstallActivateEvents(b,c),this._registerDefaultRoutes(g,e);}precache(a){if(!Array.isArray(a))throw ErrorFactory.createError('bad-revisioned-cache-list');this._revisionedCacheManager.addToCacheList({revisionedFiles:a});}get router(){return this._router}get strategies(){return this._strategies}get runtimeCacheName(){return this._runtimeCacheName}_registerInstallActivateEvents(a,b){self.addEventListener('install',(b)=>{const c=this._revisionedCacheManager.getCachedUrls();0<c.length&&logHelper.debug({that:this,message:`The precached URLs will automatically be served using a
|
||||
cache-first strategy.`,data:{"Precached URLs":JSON.stringify(c)}}),b.waitUntil(this._revisionedCacheManager.install().then(()=>{if(a)return self.skipWaiting()}));}),self.addEventListener('activate',(a)=>{a.waitUntil(this._revisionedCacheManager.cleanup().then(()=>{if(b)return self.clients.claim()}));});}_registerDefaultRoutes(a,b){const c=[];(a||b)&&c.push(this._getCacheMatchPlugin(a,b));const d=this.strategies.cacheFirst({cacheName:this._revisionedCacheManager.getCacheName(),plugins:c,excludeCacheId:!0});this._precacheRouter.registerRoute(({url:c})=>{c.hash='';const d=this._revisionedCacheManager.getCachedUrls();if(-1!==d.indexOf(c.href))return!0;let e=this._removeIgnoreUrlParams(c.href,a);return-1!==d.indexOf(e.href)||b&&e.pathname.endsWith('/')&&(e.pathname+=b,-1!==d.indexOf(e.href))},d);}_getCacheMatchPlugin(a,b){var c=this;const d=(()=>{var d=asyncToGenerator(function*({request:d,cache:e,cachedResponse:f,matchOptions:g}){if(f)return f;let h=c._removeIgnoreUrlParams(d.url,a);return e.match(h.toString(),g).then(function(a){return!a&&h.pathname.endsWith('/')?(h.pathname+=b,e.match(h.toString(),g)):a})});return function(){return d.apply(this,arguments)}})();return{cachedResponseWillBeUsed:d}}_removeIgnoreUrlParams(a,b){const c=new URL(a),d=c.search.slice(1),e=d.split('&'),f=e.map((a)=>a.split('=')),g=f.filter((a)=>b.every((b)=>!b.test(a[0]))),h=g.map((a)=>a.join('='));return c.search=h.join('&'),c}}
|
||||
|
||||
return WorkboxSW$1;
|
||||
|
||||
}());
|
||||
//# sourceMappingURL=workbox-sw.prod.v2.1.2.js.map
|
File diff suppressed because one or more lines are too long
4
docs/4.1/assets/js/docs.min.js
vendored
4
docs/4.1/assets/js/docs.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,52 +0,0 @@
|
||||
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||
// IT'S JUST JUNK FOR OUR DOCS!
|
||||
// ++++++++++++++++++++++++++++++++++++++++++
|
||||
/*!
|
||||
* Copyright 2014-2015 The Bootstrap Authors
|
||||
* Copyright 2014-2015 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see https://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
// Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes.
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
function emulatedIEMajorVersion() {
|
||||
var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
|
||||
if (groups === null) {
|
||||
return null
|
||||
}
|
||||
var ieVersionNum = parseInt(groups[1], 10)
|
||||
var ieMajorVersion = Math.floor(ieVersionNum)
|
||||
return ieMajorVersion
|
||||
}
|
||||
|
||||
function actualNonEmulatedIEMajorVersion() {
|
||||
// Detects the actual version of IE in use, even if it's in an older-IE emulation mode.
|
||||
// IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx
|
||||
// @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx
|
||||
var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // eslint-disable-line no-new-func
|
||||
if (typeof jscriptVersion === 'undefined') {
|
||||
return 11 // IE11+ not in emulation mode
|
||||
}
|
||||
if (jscriptVersion < 9) {
|
||||
return 8 // IE8 (or lower; haven't tested on IE<8)
|
||||
}
|
||||
return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode
|
||||
}
|
||||
|
||||
var ua = window.navigator.userAgent
|
||||
if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
|
||||
return // Opera, which might pretend to be IE
|
||||
}
|
||||
var emulated = emulatedIEMajorVersion()
|
||||
if (emulated === null) {
|
||||
return // Not IE
|
||||
}
|
||||
var nonEmulated = actualNonEmulatedIEMajorVersion()
|
||||
|
||||
if (emulated !== nonEmulated) {
|
||||
window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
|
||||
}
|
||||
}())
|
@ -1,24 +0,0 @@
|
||||
/*!
|
||||
* IE10 viewport hack for Surface/desktop Windows 8 bug
|
||||
* Copyright 2014-2017 The Bootstrap Authors
|
||||
* Copyright 2014-2017 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
// See the Getting Started docs for more information:
|
||||
// https://getbootstrap.com/getting-started/#support-ie10-width
|
||||
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
|
||||
var msViewportStyle = document.createElement('style')
|
||||
msViewportStyle.appendChild(
|
||||
document.createTextNode(
|
||||
'@-ms-viewport{width:auto!important}'
|
||||
)
|
||||
)
|
||||
document.head.appendChild(msViewportStyle)
|
||||
}
|
||||
|
||||
}())
|
@ -1,21 +0,0 @@
|
||||
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
||||
// ++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
/* eslint no-console:off */
|
||||
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function () {
|
||||
navigator.serviceWorker.register('/sw.js').then(function (registration) { // eslint-disable-line compat/compat
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope)
|
||||
}).catch(function (err) {
|
||||
console.log('ServiceWorker registration failed: ', err)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
console.log('Service workers are not supported.')
|
||||
}
|
||||
}())
|
3
docs/4.1/assets/js/vendor/workbox-sw.js
vendored
3
docs/4.1/assets/js/vendor/workbox-sw.js
vendored
@ -1,3 +0,0 @@
|
||||
var workbox=function(){"use strict";try{self.workbox.v["workbox:sw:3.3.1"]=1}catch(t){}const t="https://storage.googleapis.com/workbox-cdn/releases/3.3.1",e={backgroundSync:"background-sync",broadcastUpdate:"broadcast-cache-update",cacheableResponse:"cacheable-response",core:"core",expiration:"cache-expiration",googleAnalytics:"google-analytics",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};return new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?"dev":"prod",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.e=this.t.debug?"dev":"prod"}skipWaiting(){self.addEventListener("install",()=>self.skipWaiting())}clientsClaim(){self.addEventListener("activate",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&""===(s=r.split("/"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join("/")}}}();
|
||||
|
||||
//# sourceMappingURL=workbox-sw.js.map
|
1
docs/4.1/assets/js/vendor/workbox-sw.js.map
vendored
1
docs/4.1/assets/js/vendor/workbox-sw.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"names":[],"mappings":"","sources":["packages/workbox-sw/browser.mjs"],"sourcesContent":["var workbox=function(){\"use strict\";try{self.workbox.v[\"workbox:sw:3.3.1\"]=1}catch(t){}const t=\"https://storage.googleapis.com/workbox-cdn/releases/3.3.1\",e={backgroundSync:\"background-sync\",broadcastUpdate:\"broadcast-cache-update\",cacheableResponse:\"cacheable-response\",core:\"core\",expiration:\"cache-expiration\",googleAnalytics:\"google-analytics\",precaching:\"precaching\",rangeRequests:\"range-requests\",routing:\"routing\",strategies:\"strategies\",streams:\"streams\"};return new class{constructor(){return this.v={},this.t={debug:\"localhost\"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?\"dev\":\"prod\",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error(\"Config must be set before accessing workbox.* modules\");Object.assign(this.t,t),this.e=this.t.debug?\"dev\":\"prod\"}skipWaiting(){self.addEventListener(\"install\",()=>self.skipWaiting())}clientsClaim(){self.addEventListener(\"activate\",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&\"\"===(s=r.split(\"/\"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join(\"/\")}}}();\n"],"file":"workbox-sw.js"}
|
187
docs/4.1/assets/js/vendor/workbox-sw.prod.v2.1.0.js
vendored
187
docs/4.1/assets/js/vendor/workbox-sw.prod.v2.1.0.js
vendored
@ -1,187 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
var WorkboxSW = (function () {
|
||||
'use strict';
|
||||
|
||||
class ErrorFactory$1{constructor(a){this._errors=a;}createError(a,b){if(!(a in this._errors))throw new Error(`Unable to generate error '${a}'.`);let c=this._errors[a].replace(/\s+/g,' '),d=null;b&&(c+=` [${b.message}]`,d=b.stack);const e=new Error;return e.name=a,e.message=c,e.stack=d,e}}
|
||||
|
||||
const errors={"not-in-sw":'workbox-sw must be loaded in your service worker file.',"unsupported-route-type":'The first parameter to registerRoute() should be either an Express-style path string, a RegExp, or a function.',"empty-express-string":'The Express style route string must have some characters, an empty string is invalid.',"bad-revisioned-cache-list":`The 'precache()' method expects`+`an array of revisioned urls like so: ['/example/hello.1234.txt', `+`{path: 'hello.txt', revision: '1234'}]`,"navigation-route-url-string":`The registerNavigationRoute() method `+`expects a URL string as its first parameter.`,"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character`,"bad-skip-waiting":`The 'skipWaiting' parameter must be a boolean.`,"bad-clients-claim":`The 'clientsClaim' parameter must be a boolean.`,"bad-directory-index":`The 'directoryIndex' parameter must be a boolean.`};var ErrorFactory = new ErrorFactory$1(errors);
|
||||
|
||||
const errors$1={"express-route-invalid-path":`When using ExpressRoute, you must
|
||||
provide a path that starts with a '/' character (to match same-origin
|
||||
requests) or that starts with 'http' (to match cross-origin requests)`};var ErrorFactory$3 = new ErrorFactory$1(errors$1);
|
||||
|
||||
var ErrorStackParser = {parse:()=>[]};
|
||||
|
||||
function atLeastOne(a){const b=Object.keys(a);b.some((b)=>a[b]!==void 0)||throwError('Please set at least one of the following parameters: '+b.map((a)=>`'${a}'`).join(', '));}function hasMethod(a,b){const c=Object.keys(a).pop(),d=typeof a[c][b];'function'!=d&&throwError(`The '${c}' parameter must be an object that exposes a
|
||||
'${b}' method.`);}function isInstance(a,b){const c=Object.keys(a).pop();a[c]instanceof b||throwError(`The '${c}' parameter must be an instance of
|
||||
'${b.name}'`);}function isOneOf(a,b){const c=Object.keys(a).pop();b.includes(a[c])||throwError(`The '${c}' parameter must be set to one of the
|
||||
following: ${b}`);}function isType(a,b){const c=Object.keys(a).pop(),d=typeof a[c];d!==b&&throwError(`The '${c}' parameter has the wrong type. (Expected:
|
||||
${b}, actual: ${d})`);}function isArrayOfType(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing
|
||||
one or more '${b}' elements.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])typeof e!==b&&throwError(d);}function isArrayOfClass(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing
|
||||
one or more '${b.name}' instances.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])e instanceof b||throwError(d);}function throwError(a){a=a.replace(/\s+/g,' ');const b=new Error(a);b.name='assertion-failed';const c=ErrorStackParser.parse(b);throw 3<=c.length&&(b.message=`Invalid call to ${c[2].functionName}() — `+a),b}
|
||||
|
||||
function normalizeHandler(a){return'object'==typeof a?(hasMethod({handler:a},'handle'),a):(isType({handler:a},'function'),{handle:a})}
|
||||
|
||||
const defaultMethod='GET';const validMethods=['DELETE','GET','HEAD','POST','PUT'];
|
||||
|
||||
class Route{constructor({match:a,handler:b,method:c}={}){this.handler=normalizeHandler(b),isType({match:a},'function'),this.match=a,c?(isOneOf({method:c},validMethods),this.method=c):this.method=defaultMethod;}}
|
||||
|
||||
var index$1=Array.isArray||function(a){return'[object Array]'==Object.prototype.toString.call(a)};
|
||||
|
||||
var index=pathToRegexp; var parse_1=parse; var compile_1=compile; var tokensToFunction_1=tokensToFunction; var tokensToRegExp_1=tokensToRegExp; var PATH_REGEXP=new RegExp('(\\\\.)|([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))','g');function parse(a,b){for(var c,d=[],e=0,f=0,g='',h=b&&b.delimiter||'/';null!=(c=PATH_REGEXP.exec(a));){var i=c[0],j=c[1],k=c.index;if(g+=a.slice(f,k),f=k+i.length,j){g+=j[1];continue}var l=a[f],m=c[2],n=c[3],o=c[4],p=c[5],q=c[6],r=c[7];g&&(d.push(g),g='');var s=c[2]||h,t=o||p;d.push({name:n||e++,prefix:m||'',delimiter:s,optional:'?'===q||'*'===q,repeat:'+'===q||'*'===q,partial:null!=m&&null!=l&&l!==m,asterisk:!!r,pattern:t?escapeGroup(t):r?'.*':'[^'+escapeString(s)+']+?'});}return f<a.length&&(g+=a.substr(f)),g&&d.push(g),d}function compile(a,b){return tokensToFunction(parse(a,b))}function encodeURIComponentPretty(a){return encodeURI(a).replace(/[\/?#]/g,function(a){return'%'+a.charCodeAt(0).toString(16).toUpperCase()})}function encodeAsterisk(a){return encodeURI(a).replace(/[?#]/g,function(a){return'%'+a.charCodeAt(0).toString(16).toUpperCase()})}function tokensToFunction(a){for(var b=Array(a.length),c=0;c<a.length;c++)'object'==typeof a[c]&&(b[c]=new RegExp('^(?:'+a[c].pattern+')$'));return function(c,d){for(var e,f='',g=c||{},h=d||{},k=h.pretty?encodeURIComponentPretty:encodeURIComponent,l=0;l<a.length;l++){if(e=a[l],'string'==typeof e){f+=e;continue}var i,m=g[e.name];if(null==m)if(e.optional){e.partial&&(f+=e.prefix);continue}else throw new TypeError('Expected "'+e.name+'" to be defined');if(index$1(m)){if(!e.repeat)throw new TypeError('Expected "'+e.name+'" to not repeat, but received `'+JSON.stringify(m)+'`');if(0===m.length)if(e.optional)continue;else throw new TypeError('Expected "'+e.name+'" to not be empty');for(var n=0;n<m.length;n++){if(i=k(m[n]),!b[l].test(i))throw new TypeError('Expected all "'+e.name+'" to match "'+e.pattern+'", but received `'+JSON.stringify(i)+'`');f+=(0===n?e.prefix:e.delimiter)+i;}continue}if(i=e.asterisk?encodeAsterisk(m):k(m),!b[l].test(i))throw new TypeError('Expected "'+e.name+'" to match "'+e.pattern+'", but received "'+i+'"');f+=e.prefix+i;}return f}}function escapeString(a){return a.replace(/([.+*?=^!:${}()[\]|\/\\])/g,'\\$1')}function escapeGroup(a){return a.replace(/([=!:$\/()])/g,'\\$1')}function attachKeys(a,b){return a.keys=b,a}function flags(a){return a.sensitive?'':'i'}function regexpToRegexp(a,b){var c=a.source.match(/\((?!\?)/g);if(c)for(var d=0;d<c.length;d++)b.push({name:d,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return attachKeys(a,b)}function arrayToRegexp(a,b,c){for(var d=[],e=0;e<a.length;e++)d.push(pathToRegexp(a[e],b,c).source);var f=new RegExp('(?:'+d.join('|')+')',flags(c));return attachKeys(f,b)}function stringToRegexp(a,b,c){return tokensToRegExp(parse(a,c),b,c)}function tokensToRegExp(a,b,c){index$1(b)||(c=b||c,b=[]),c=c||{};for(var d,e=c.strict,f=!1!==c.end,g='',h=0;h<a.length;h++)if(d=a[h],'string'==typeof d)g+=escapeString(d);else{var i=escapeString(d.prefix),j='(?:'+d.pattern+')';b.push(d),d.repeat&&(j+='(?:'+i+j+')*'),j=d.optional?d.partial?i+'('+j+')?':'(?:'+i+'('+j+'))?':i+'('+j+')',g+=j;}var k=escapeString(c.delimiter||'/'),l=g.slice(-k.length)===k;return e||(g=(l?g.slice(0,-k.length):g)+'(?:'+k+'(?=$))?'),g+=f?'$':e&&l?'':'(?='+k+'|$)',attachKeys(new RegExp('^'+g,flags(c)),b)}function pathToRegexp(a,b,c){return index$1(b)||(c=b||c,b=[]),c=c||{},a instanceof RegExp?regexpToRegexp(a,b):index$1(a)?arrayToRegexp(a,b,c):stringToRegexp(a,b,c)}index.parse=parse_1,index.compile=compile_1,index.tokensToFunction=tokensToFunction_1,index.tokensToRegExp=tokensToRegExp_1;
|
||||
|
||||
class ExpressRoute extends Route{constructor({path:a,handler:b,method:c}){if(!(a.startsWith('/')||a.startsWith('http')))throw ErrorFactory$3.createError('express-route-invalid-path');let d=[];const e=index(a,d);super({match:({url:b})=>{if(a.startsWith('/')&&b.origin!==location.origin)return null;const c=a.startsWith('/')?b.pathname:b.href,f=c.match(e);if(!f)return null;const g={};return d.forEach((a,b)=>{g[a.name]=f[b+1];}),g},handler:b,method:c});}}
|
||||
|
||||
class LogGroup{constructor(){this._logs=[],this._childGroups=[],this._isFallbackMode=!1;const a=/Firefox\/(\d*)\.\d*/.exec(navigator.userAgent);if(a)try{const b=parseInt(a[1],10);55>b&&(this._isFallbackMode=!0);}catch(a){this._isFallbackMode=!0;}/Edge\/\d*\.\d*/.exec(navigator.userAgent)&&(this._isFallbackMode=!0);}addPrimaryLog(a){this._primaryLog=a;}addLog(a){this._logs.push(a);}addChildGroup(a){0===a._logs.length||this._childGroups.push(a);}print(){return 0===this._logs.length&&0===this._childGroups.length?void this._printLogDetails(this._primaryLog):void(this._primaryLog&&(this._isFallbackMode?this._printLogDetails(this._primaryLog):console.groupCollapsed(...this._getLogContent(this._primaryLog))),this._logs.forEach((a)=>{this._printLogDetails(a);}),this._childGroups.forEach((a)=>{a.print();}),this._primaryLog&&!this._isFallbackMode&&console.groupEnd())}_printLogDetails(a){const b=a.logFunc?a.logFunc:console.log;b(...this._getLogContent(a));}_getLogContent(a){let b=a.message;this._isFallbackMode&&'string'==typeof b&&(b=b.replace(/%c/g,''));let c=[b];return!this._isFallbackMode&&a.colors&&(c=c.concat(a.colors)),a.args&&(c=c.concat(a.args)),c}}
|
||||
|
||||
function isServiceWorkerGlobalScope(){return'ServiceWorkerGlobalScope'in self&&self instanceof ServiceWorkerGlobalScope}function isDevBuild(){return`dev`==`prod`}function isLocalhost(){return!!('localhost'===location.hostname||'[::1]'===location.hostname||location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))}
|
||||
|
||||
self.workbox=self.workbox||{},self.workbox.LOG_LEVEL=self.workbox.LOG_LEVEL||{none:-1,verbose:0,debug:1,warn:2,error:3};const LIGHT_GREY=`#bdc3c7`; const DARK_GREY=`#7f8c8d`; const LIGHT_GREEN=`#2ecc71`; const LIGHT_YELLOW=`#f1c40f`; const LIGHT_RED=`#e74c3c`; const LIGHT_BLUE=`#3498db`;class LogHelper{constructor(){this._defaultLogLevel=isDevBuild()?self.workbox.LOG_LEVEL.debug:self.workbox.LOG_LEVEL.warn;}log(a){this._printMessage(self.workbox.LOG_LEVEL.verbose,a);}debug(a){this._printMessage(self.workbox.LOG_LEVEL.debug,a);}warn(a){this._printMessage(self.workbox.LOG_LEVEL.warn,a);}error(a){this._printMessage(self.workbox.LOG_LEVEL.error,a);}_printMessage(a,b){if(this._shouldLogMessage(a,b)){const c=this._getAllLogGroups(a,b);c.print();}}_getAllLogGroups(a,b){const c=new LogGroup,d=this._getPrimaryMessageDetails(a,b);if(c.addPrimaryLog(d),b.error){const a={message:b.error,logFunc:console.error};c.addLog(a);}const e=new LogGroup;if(b.that&&b.that.constructor&&b.that.constructor.name){const a=b.that.constructor.name;e.addLog(this._getKeyValueDetails('class',a));}return b.data&&('object'!=typeof b.data||b.data instanceof Array?e.addLog(this._getKeyValueDetails('additionalData',b.data)):Object.keys(b.data).forEach((a)=>{e.addLog(this._getKeyValueDetails(a,b.data[a]));})),c.addChildGroup(e),c}_getKeyValueDetails(a,b){return{message:`%c${a}: `,colors:[`color: ${LIGHT_BLUE}`],args:b}}_getPrimaryMessageDetails(a,b){let c,d;a===self.workbox.LOG_LEVEL.verbose?(c='Info',d=LIGHT_GREY):a===self.workbox.LOG_LEVEL.debug?(c='Debug',d=LIGHT_GREEN):a===self.workbox.LOG_LEVEL.warn?(c='Warn',d=LIGHT_YELLOW):a===self.workbox.LOG_LEVEL.error?(c='Error',d=LIGHT_RED):void 0;let e=`%c🔧 %c[${c}]`;const f=[`color: ${LIGHT_GREY}`,`color: ${d}`];let g;return'string'==typeof b?g=b:b.message&&(g=b.message),g&&(g=g.replace(/\s+/g,' '),e+=`%c ${g}`,f.push(`color: ${DARK_GREY}; font-weight: normal`)),{message:e,colors:f}}_shouldLogMessage(a,b){if(!b)return!1;let c=this._defaultLogLevel;return self&&self.workbox&&'number'==typeof self.workbox.logLevel&&(c=self.workbox.logLevel),c===self.workbox.LOG_LEVEL.none||a<c?!1:!0}}var logHelper = new LogHelper;
|
||||
|
||||
class NavigationRoute extends Route{constructor({whitelist:a,blacklist:b,handler:c}={}){isArrayOfClass({whitelist:a},RegExp),b?isArrayOfClass({blacklist:b},RegExp):b=[];super({match:({event:d,url:e})=>{let f,g=!1;if('navigate'===d.request.mode){const d=e.pathname+e.search;a.some((a)=>a.test(d))?b.some((a)=>a.test(d))?f=`The navigation route is not being used, since the `+`request URL matches both the whitelist and blacklist.`:(f=`The navigation route is being used.`,g=!0):f=`The navigation route is not being used, since the `+`URL being navigated to doesn't match the whitelist.`,logHelper.debug({that:this,message:f,data:{"request-url":e.href,whitelist:a,blacklist:b,handler:c}});}return g},handler:c,method:'GET'});}}
|
||||
|
||||
class RegExpRoute extends Route{constructor({regExp:a,handler:b,method:c}){isInstance({regExp:a},RegExp);super({match:({url:b})=>{const c=a.exec(b.href);return c?b.origin!==location.origin&&0!==c.index?(logHelper.debug({that:this,message:`Skipping route, because the RegExp match didn't occur `+`at the start of the URL.`,data:{url:b.href,regExp:a}}),null):c.slice(1):null},handler:b,method:c});}}
|
||||
|
||||
class Router$2{constructor(){this._routes=new Map,this._isListenerRegistered=!1;}addFetchListener(){return this._isListenerRegistered?(logHelper.warn({that:this,message:`addFetchListener() has already been called for this Router.`}),!1):(this._isListenerRegistered=!0,self.addEventListener('fetch',(a)=>{const b=this.handleRequest({event:a});b&&a.respondWith(b);}),!0)}handleRequest({event:a}){isInstance({event:a},FetchEvent);const b=new URL(a.request.url);if(!b.protocol.startsWith('http'))return void logHelper.log({that:this,message:`The URL does not start with HTTP, so it can't be handled.`,data:{request:a.request}});let{handler:c,params:d}=this._findHandlerAndParams({event:a,url:b});if(!c&&this.defaultHandler&&(c=this.defaultHandler),c){let e=c.handle({url:b,event:a,params:d});return this.catchHandler&&(e=e.catch((c)=>this.catchHandler.handle({url:b,event:a,error:c}))),e}}_findHandlerAndParams({event:a,url:b}){const c=this._routes.get(a.request.method)||[];for(const d of c){let c=d.match({url:b,event:a});if(c)return logHelper.log({that:this,message:'The router found a matching route.',data:{route:d,request:a.request}}),Array.isArray(c)&&0===c.length?c=void 0:c.constructor===Object&&0===Object.keys(c).length&&(c=void 0),{params:c,handler:d.handler}}return{handler:void 0,params:void 0}}setDefaultHandler({handler:a}={}){this.defaultHandler=normalizeHandler(a);}setCatchHandler({handler:a}={}){this.catchHandler=normalizeHandler(a);}registerRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a)this._routes.has(b.method)||this._routes.set(b.method,[]),this._routes.get(b.method).unshift(b);}registerRoute({route:a}={}){isInstance({route:a},Route),this.registerRoutes({routes:[a]});}unregisterRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a){this._routes.has(b.method)||logHelper.error({that:this,message:`Can't unregister route; there are no ${b.method}
|
||||
routes registered.`,data:{route:b}});const a=this._routes.get(b.method).indexOf(b);-1<a?this._routes.get(b.method).splice(a,1):logHelper.error({that:this,message:`Can't unregister route; the route wasn't previously
|
||||
registered.`,data:{route:b}});}}unregisterRoute({route:a}={}){isInstance({route:a},Route),this.unregisterRoutes({routes:[a]});}}
|
||||
|
||||
class Router$$1 extends Router$2{constructor(a,b){super({handleFetch:b}),this._revisionedCacheName=a;}registerRoute(a,b,c='GET'){'function'==typeof b&&(b={handle:b});let d;if('string'==typeof a){if(0===a.length)throw ErrorFactory.createError('empty-express-string');d=new ExpressRoute({path:a,handler:b,method:c});}else if(a instanceof RegExp)d=new RegExpRoute({regExp:a,handler:b,method:c});else if('function'==typeof a)d=new Route({match:a,handler:b,method:c});else throw ErrorFactory.createError('unsupported-route-type');return super.registerRoute({route:d}),d}registerNavigationRoute(a,b={}){if('string'!=typeof a)throw ErrorFactory.createError('navigation-route-url-string');const c='cacheName'in b?b.cacheName:this._revisionedCacheName;super.registerRoute({route:new NavigationRoute({handler:()=>caches.match(a,{cacheName:c}),whitelist:b.whitelist||[/./],blacklist:b.blacklist||[]})});}}
|
||||
|
||||
const errors$2={"multiple-cache-will-update-plugins":'You cannot register more than one plugin that implements cacheWillUpdate.',"multiple-cached-response-will-be-used-plugins":'You cannot register more than one plugin that implements cachedResponseWillBeUsed.',"invalid-response-for-caching":'The fetched response could not be cached due to an invalid response code.',"no-response-received":'No response received; falling back to cache.',"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character.`};var ErrorFactory$4 = new ErrorFactory$1(errors$2);
|
||||
|
||||
class CacheableResponse{constructor({statuses:a,headers:b}={}){atLeastOne({statuses:a,headers:b}),a!==void 0&&isArrayOfType({statuses:a},'number'),b!==void 0&&isType({headers:b},'object'),this.statuses=a,this.headers=b;}isResponseCacheable({request:a,response:b}={}){isInstance({response:b},Response);let c=!0;if(this.statuses&&(c=this.statuses.includes(b.status)),this.headers&&c&&(c=Object.keys(this.headers).some((a)=>b.headers.get(a)===this.headers[a])),!c){const c={response:b};this.statuses&&(c['valid-status-codes']=JSON.stringify(this.statuses)),this.headers&&(c['valid-headers']=JSON.stringify(this.headers)),a&&(c.request=a),logHelper.debug({message:`The response does not meet the criteria for being added to the
|
||||
cache.`,data:c});}return c}}
|
||||
|
||||
class CacheableResponsePlugin extends CacheableResponse{cacheWillUpdate({request:a,response:b}={}){return this.isResponseCacheable({request:a,response:b})}}
|
||||
|
||||
const getDefaultCacheName=({cacheId:a}={})=>{let b=`workbox-runtime-caching`;return a&&(b=`${a}-${b}`),self&&self.registration&&(b+=`-${self.registration.scope}`),b};
|
||||
const pluginCallbacks=['cacheDidUpdate','cachedResponseWillBeUsed','cacheWillUpdate','fetchDidFail','requestWillFetch'];
|
||||
|
||||
var cleanResponseCopy = (({response:a})=>{isInstance({response:a},Response);const b=a.clone(),c='body'in b?Promise.resolve(b.body):b.blob();return c.then((a)=>new Response(a,{headers:b.headers,status:b.status,statusText:b.statusText}))});
|
||||
|
||||
var asyncToGenerator = function (fn) {
|
||||
return function () {
|
||||
var gen = fn.apply(this, arguments);
|
||||
return new Promise(function (resolve, reject) {
|
||||
function step(key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
return Promise.resolve(value).then(function (value) {
|
||||
step("next", value);
|
||||
}, function (err) {
|
||||
step("throw", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return step("next");
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
class RequestWrapper{constructor({cacheName:a,cacheId:b,plugins:c,fetchOptions:d,matchOptions:e}={}){if(b&&('string'!=typeof b||0===b.length))throw ErrorFactory$4.createError('bad-cache-id');a?(isType({cacheName:a},'string'),this.cacheName=a,b&&(this.cacheName=`${b}-${this.cacheName}`)):this.cacheName=getDefaultCacheName({cacheId:b}),d&&(isType({fetchOptions:d},'object'),this.fetchOptions=d),e&&(isType({matchOptions:e},'object'),this.matchOptions=e),this.plugins=new Map,c&&(isArrayOfType({plugins:c},'object'),c.forEach((a)=>{for(let b of pluginCallbacks)if('function'==typeof a[b]){if(!this.plugins.has(b))this.plugins.set(b,[]);else if('cacheWillUpdate'===b)throw ErrorFactory$4.createError('multiple-cache-will-update-plugins');else if('cachedResponseWillBeUsed'===b)throw ErrorFactory$4.createError('multiple-cached-response-will-be-used-plugins');this.plugins.get(b).push(a);}})),this.plugins.has('cacheWillUpdate')&&(this._userSpecifiedCachableResponsePlugin=this.plugins.get('cacheWillUpdate')[0]);}getDefaultCacheableResponsePlugin(){return this._defaultCacheableResponsePlugin||(this._defaultCacheableResponsePlugin=new CacheableResponsePlugin({statuses:[200]})),this._defaultCacheableResponsePlugin}getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.cacheName)),a._cache})()}match({request:a}){var b=this;return asyncToGenerator(function*(){atLeastOne({request:a});const c=yield b.getCache();let d=yield c.match(a,b.matchOptions);if(b.plugins.has('cachedResponseWillBeUsed')){const e=b.plugins.get('cachedResponseWillBeUsed')[0];d=yield e.cachedResponseWillBeUsed({request:a,cache:c,cachedResponse:d,matchOptions:b.matchOptions,cacheName:b.cacheName});}return d})()}fetch({request:a}){var b=this;return asyncToGenerator(function*(){'string'==typeof a?a=new Request(a):isInstance({request:a},Request);const c=b.plugins.has('fetchDidFail')?a.clone():null;if(b.plugins.has('requestWillFetch'))for(let c of b.plugins.get('requestWillFetch')){const b=yield c.requestWillFetch({request:a});isInstance({returnedRequest:b},Request),a=b;}try{return yield fetch(a,b.fetchOptions)}catch(a){if(b.plugins.has('fetchDidFail'))for(let a of b.plugins.get('fetchDidFail'))yield a.fetchDidFail({request:c.clone()});throw a}})()}fetchAndCache({request:a,waitOnCache:b,cacheKey:c,cacheResponsePlugin:d,cleanRedirects:e}){var f=this;return asyncToGenerator(function*(){atLeastOne({request:a});let g;const h=yield f.fetch({request:a}),i=f._userSpecifiedCachableResponsePlugin||d||f.getDefaultCacheableResponsePlugin(),j=yield i.cacheWillUpdate({request:a,response:h});if(j){const b=e&&h.redirected?yield cleanResponseCopy({response:h}):h.clone();g=f.getCache().then((()=>{var d=asyncToGenerator(function*(d){let e;const g=c||a;if('opaque'!==h.type&&f.plugins.has('cacheDidUpdate')&&(e=yield f.match({request:g})),yield d.put(g,b),f.plugins.has('cacheDidUpdate'))for(let a of f.plugins.get('cacheDidUpdate'))yield a.cacheDidUpdate({cacheName:f.cacheName,oldResponse:e,newResponse:b,url:'url'in g?g.url:g});});return function(){return d.apply(this,arguments)}})());}else if(!j&&b)throw ErrorFactory$4.createError('invalid-response-for-caching');return b&&g&&(yield g),h})()}}
|
||||
|
||||
class Handler{constructor({requestWrapper:a,waitOnCache:b}={}){this.requestWrapper=a?a:new RequestWrapper,this.waitOnCache=!!b;}handle({event:a,params:b}={}){throw Error('This abstract method must be implemented in a subclass.')}}
|
||||
|
||||
class CacheFirst extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=yield b.requestWrapper.match({request:a.request});return c||(yield b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache}))})()}}
|
||||
|
||||
class CacheOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.match({request:a.request})})()}}
|
||||
|
||||
class NetworkFirst extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});const{networkTimeoutSeconds:b}=a;b&&(isType({networkTimeoutSeconds:b},'number'),this.networkTimeoutSeconds=b);}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=[];let d;b.networkTimeoutSeconds&&c.push(new Promise(function(c){d=setTimeout(function(){c(b.requestWrapper.match({request:a.request}));},1e3*b.networkTimeoutSeconds);}));const e=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).then(function(a){return d&&clearTimeout(d),a?a:Promise.reject(ErrorFactory$4.createError('no-response-received'))}).catch(function(){return b.requestWrapper.match({request:a.request})});return c.push(e),Promise.race(c)})()}}
|
||||
|
||||
class NetworkOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.fetch({request:a.request})})()}}
|
||||
|
||||
class StaleWhileRevalidate extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).catch(function(){return Response.error()}),d=yield b.requestWrapper.match({request:a.request});return d||(yield c)})()}}
|
||||
|
||||
let tmpIdbName=`workbox-cache-expiration`;self&&self.registration&&(tmpIdbName+=`-${self.registration.scope}`);const idbName=tmpIdbName;const idbVersion=1;const urlPropertyName='url';const timestampPropertyName='timestamp';
|
||||
|
||||
function createCommonjsModule(fn, module) {
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
var idb=createCommonjsModule(function(a){'use strict';(function(){function b(a){return Array.prototype.slice.call(a)}function c(a){return new Promise(function(b,c){a.onsuccess=function(){b(a.result);},a.onerror=function(){c(a.error);};})}function d(a,b,d){var e,f=new Promise(function(f,g){e=a[b].apply(a,d),c(e).then(f,g);});return f.request=e,f}function e(a,b,c){var e=d(a,b,c);return e.then(function(a){return a?new k(a,e.request):void 0})}function f(a,b,c){c.forEach(function(c){Object.defineProperty(a.prototype,c,{get:function(){return this[b][c]},set:function(a){this[b][c]=a;}});});}function g(a,b,c,e){e.forEach(function(e){e in c.prototype&&(a.prototype[e]=function(){return d(this[b],e,arguments)});});}function h(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return this[b][d].apply(this[b],arguments)});});}function i(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return e(this[b],d,arguments)});});}function j(a){this._index=a;}function k(a,b){this._cursor=a,this._request=b;}function l(a){this._store=a;}function m(a){this._tx=a,this.complete=new Promise(function(b,c){a.oncomplete=function(){b();},a.onerror=function(){c(a.error);},a.onabort=function(){c(a.error);};});}function n(a,b,c){this._db=a,this.oldVersion=b,this.transaction=new m(c);}function o(a){this._db=a;}f(j,'_index',['name','keyPath','multiEntry','unique']),g(j,'_index',IDBIndex,['get','getKey','getAll','getAllKeys','count']),i(j,'_index',IDBIndex,['openCursor','openKeyCursor']),f(k,'_cursor',['direction','key','primaryKey','value']),g(k,'_cursor',IDBCursor,['update','delete']),['advance','continue','continuePrimaryKey'].forEach(function(a){a in IDBCursor.prototype&&(k.prototype[a]=function(){var b=this,d=arguments;return Promise.resolve().then(function(){return b._cursor[a].apply(b._cursor,d),c(b._request).then(function(a){return a?new k(a,b._request):void 0})})});}),l.prototype.createIndex=function(){return new j(this._store.createIndex.apply(this._store,arguments))},l.prototype.index=function(){return new j(this._store.index.apply(this._store,arguments))},f(l,'_store',['name','keyPath','indexNames','autoIncrement']),g(l,'_store',IDBObjectStore,['put','add','delete','clear','get','getAll','getKey','getAllKeys','count']),i(l,'_store',IDBObjectStore,['openCursor','openKeyCursor']),h(l,'_store',IDBObjectStore,['deleteIndex']),m.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))},f(m,'_tx',['objectStoreNames','mode']),h(m,'_tx',IDBTransaction,['abort']),n.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))},f(n,'_db',['name','version','objectStoreNames']),h(n,'_db',IDBDatabase,['deleteObjectStore','close']),o.prototype.transaction=function(){return new m(this._db.transaction.apply(this._db,arguments))},f(o,'_db',['name','version','objectStoreNames']),h(o,'_db',IDBDatabase,['close']),['openCursor','openKeyCursor'].forEach(function(a){[l,j].forEach(function(c){c.prototype[a.replace('open','iterate')]=function(){var c=b(arguments),d=c[c.length-1],e=this._store||this._index,f=e[a].apply(e,c.slice(0,-1));f.onsuccess=function(){d(f.result);};};});}),[j,l].forEach(function(a){a.prototype.getAll||(a.prototype.getAll=function(a,b){var c=this,d=[];return new Promise(function(e){c.iterateCursor(a,function(a){return a?(d.push(a.value),void 0!==b&&d.length==b?void e(d):void a.continue()):void e(d)});})});});var p={open:function(a,b,c){var e=d(indexedDB,'open',[a,b]),f=e.request;return f.onupgradeneeded=function(a){c&&c(new n(f.result,a.oldVersion,f.transaction));},e.then(function(a){return new o(a)})},delete:function(a){return d(indexedDB,'deleteDatabase',[a])}};a.exports=p,a.exports.default=a.exports;})();});
|
||||
|
||||
const errors$3={"max-entries-or-age-required":`Either the maxEntries or maxAgeSeconds
|
||||
parameters (or both) are required when constructing Plugin.`,"max-entries-must-be-number":`The maxEntries parameter to the Plugin
|
||||
constructor must either be a number or undefined.`,"max-age-seconds-must-be-number":`The maxAgeSeconds parameter to the Plugin
|
||||
constructor must either be a number or undefined.`};var ErrorFactory$5 = new ErrorFactory$1(errors$3);
|
||||
|
||||
class CacheExpiration{constructor({maxEntries:a,maxAgeSeconds:b}={}){if(!(a||b))throw ErrorFactory$5.createError('max-entries-or-age-required');if(a&&'number'!=typeof a)throw ErrorFactory$5.createError('max-entries-must-be-number');if(b&&'number'!=typeof b)throw ErrorFactory$5.createError('max-age-seconds-must-be-number');this.maxEntries=a,this.maxAgeSeconds=b,this._dbs=new Map,this._caches=new Map,this._expirationMutex=!1,this._timestampForNextRun=null;}getDB({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=`${idbName}-${a}`;if(!b._dbs.has(c)){const d=yield idb.open(c,idbVersion,function(b){const c=b.createObjectStore(a,{keyPath:urlPropertyName});c.createIndex(timestampPropertyName,timestampPropertyName,{unique:!1});});b._dbs.set(c,d);}return b._dbs.get(c)})()}getCache({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),!b._caches.has(a)){const c=yield caches.open(a);b._caches.set(a,c);}return b._caches.get(a)})()}isResponseFresh({cacheName:a,cachedResponse:b,now:c}={}){if(b&&this.maxAgeSeconds){isInstance({cachedResponse:b},Response);const d=b.headers.get('date');if(d){'undefined'==typeof c&&(c=Date.now());const a=new Date(d),b=a.getTime();return!!isNaN(b)||b+1e3*this.maxAgeSeconds>c}return this.expireEntries({cacheName:a,now:c}),!0}return!0}updateTimestamp({cacheName:a,url:b,now:c}={}){var d=this;return asyncToGenerator(function*(){isType({url:b},'string'),isType({cacheName:a},'string');const e=new URL(b,location);e.hash='','undefined'==typeof c&&(c=Date.now());const f=yield d.getDB({cacheName:a}),g=f.transaction(a,'readwrite');g.objectStore(a).put({[timestampPropertyName]:c,[urlPropertyName]:e.href}),yield g.complete;})()}expireEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){if(c._expirationMutex)return void(c._timestampForNextRun=b);c._expirationMutex=!0,isType({cacheName:a},'string'),'undefined'==typeof b&&(b=Date.now());const d=c.maxAgeSeconds?yield c.findOldEntries({cacheName:a,now:b}):[],e=c.maxEntries?yield c.findExtraEntries({cacheName:a}):[],f=[...new Set(d.concat(e))];if(yield c.deleteFromCacheAndIDB({cacheName:a,urls:f}),0<f.length&&logHelper.debug({that:c,message:'Expired entries have been removed from the cache.',data:{cacheName:a,urls:f}}),c._expirationMutex=!1,c._timestampForNextRun){const b=c._timestampForNextRun;return c._timestampForNextRun=null,c.expireEntries({cacheName:a,now:b})}})()}findOldEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){isType({cacheName:a},'string'),isType({now:b},'number');const d=b-1e3*c.maxAgeSeconds,e=[],f=yield c.getDB({cacheName:a}),g=f.transaction(a,'readonly'),h=g.objectStore(a),i=h.index(timestampPropertyName);return i.iterateCursor(function(a){a&&(a.value[timestampPropertyName]<d&&e.push(a.value[urlPropertyName]),a.continue());}),yield g.complete,e})()}findExtraEntries({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=[],d=yield b.getDB({cacheName:a});let e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName);const h=yield g.count();return h>b.maxEntries&&(e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName),g.iterateCursor(function(a){a&&(c.push(a.value[urlPropertyName]),h-c.length>b.maxEntries&&a.continue());})),yield e.complete,c})()}deleteFromCacheAndIDB({cacheName:a,urls:b}={}){var c=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),isArrayOfType({urls:b},'string'),0<b.length){const d=yield c.getCache({cacheName:a}),e=yield c.getDB({cacheName:a});for(let c of b){yield d.delete(c);const b=e.transaction(a,'readwrite'),f=b.objectStore(a);f.delete(c),yield b.complete;}}})()}}
|
||||
|
||||
class CacheExpirationPlugin extends CacheExpiration{cachedResponseWillBeUsed({cacheName:a,cachedResponse:b,now:c}={}){return this.isResponseFresh({cacheName:a,cachedResponse:b,now:c})?b:null}cacheDidUpdate({cacheName:a,newResponse:b,url:c,now:d}={}){var e=this;return asyncToGenerator(function*(){isType({cacheName:a},'string'),isInstance({newResponse:b},Response),'undefined'==typeof d&&(d=Date.now()),yield e.updateTimestamp({cacheName:a,url:c,now:d}),yield e.expireEntries({cacheName:a,now:d});})()}}
|
||||
|
||||
const errors$4={"channel-name-required":`The channelName parameter is required when
|
||||
constructing a new BroadcastCacheUpdate instance.`,"responses-are-same-parameters-required":`The first, second, and
|
||||
headersToCheck parameters must be valid when calling responsesAreSame()`};var ErrorFactory$6 = new ErrorFactory$1(errors$4);
|
||||
|
||||
const cacheUpdatedMessageType='CACHE_UPDATED';
|
||||
const defaultHeadersToCheck=['content-length','etag','last-modified'];
|
||||
const defaultSource='workbox-broadcast-cache-update';
|
||||
|
||||
function broadcastUpdate({channel:a,cacheName:b,url:c,source:d}={}){isInstance({channel:a},BroadcastChannel),isType({cacheName:b},'string'),isType({source:d},'string'),isType({url:c},'string'),a.postMessage({type:cacheUpdatedMessageType,meta:d,payload:{cacheName:b,updatedUrl:c}});}
|
||||
|
||||
function responsesAreSame({first:a,second:b,headersToCheck:c}={}){if(!(a instanceof Response&&b instanceof Response&&c instanceof Array))throw ErrorFactory$6.createError('responses-are-same-parameters-required');const d=c.some((c)=>a.headers.has(c)&&b.headers.has(c));return d?c.every((c)=>a.headers.has(c)===b.headers.has(c)&&a.headers.get(c)===b.headers.get(c)):(logHelper.log({message:`Unable to determine whether the response has been updated
|
||||
because none of the headers that would be checked are present.`,data:{"First Response":a,"Second Response":b,"Headers To Check":JSON.stringify(c)}}),!0)}
|
||||
|
||||
class BroadcastCacheUpdate{constructor({channelName:a,headersToCheck:b,source:c}={}){if('string'!=typeof a||0===a.length)throw ErrorFactory$6.createError('channel-name-required');this.channelName=a,this.headersToCheck=b||defaultHeadersToCheck,this.source=c||defaultSource;}get channel(){return this._channel||(this._channel=new BroadcastChannel(this.channelName)),this._channel}notifyIfUpdated({first:a,second:b,cacheName:c,url:d}){isType({cacheName:c},'string'),responsesAreSame({first:a,second:b,headersToCheck:this.headersToCheck})||broadcastUpdate({cacheName:c,url:d,channel:this.channel,source:this.source});}}
|
||||
|
||||
class BroadcastCacheUpdatePlugin extends BroadcastCacheUpdate{cacheDidUpdate({cacheName:a,oldResponse:b,newResponse:c,url:d}){isType({cacheName:a},'string'),isInstance({newResponse:c},Response),b&&this.notifyIfUpdated({cacheName:a,first:b,second:c,url:d});}}
|
||||
|
||||
class Strategies{constructor({cacheId:a}={}){this._cacheId=a;}cacheFirst(a){return this._getCachingMechanism(CacheFirst,a)}cacheOnly(a){return this._getCachingMechanism(CacheOnly,a)}networkFirst(a){return this._getCachingMechanism(NetworkFirst,a)}networkOnly(a){return this._getCachingMechanism(NetworkOnly,a)}staleWhileRevalidate(a){return this._getCachingMechanism(StaleWhileRevalidate,a)}_getCachingMechanism(a,b={}){const c={cacheExpiration:CacheExpirationPlugin,broadcastCacheUpdate:BroadcastCacheUpdatePlugin,cacheableResponse:CacheableResponsePlugin},d={plugins:[]};b.excludeCacheId||(d.cacheId=this._cacheId),b.cacheName&&(d.cacheName=b.cacheName);const e=Object.keys(c);return e.forEach((a)=>{if(b[a]){const e=c[a],f=b[a];d.plugins.push(new e(f));}}),b.plugins&&b.plugins.forEach((a)=>{d.plugins.push(a);}),b.requestWrapper=new RequestWrapper(d),new a(b)}}
|
||||
|
||||
const errorMessageFactory=(a,b)=>{let c=`An error was thrown by workbox with error code: `+`;'${a}'`;return b&&(c+=` with extras: '${JSON.stringify(b)}'`),c};
|
||||
|
||||
class WorkboxError extends Error{constructor(a,b){super(),this.name=a,this.message=errorMessageFactory(a,b),b&&(this.extras=b);}}
|
||||
|
||||
class BaseCacheManager{constructor({cacheName:a,cacheId:b,plugins:c}={}){if(b&&('string'!=typeof b||0===b.length))throw new WorkboxError('bad-cache-id',{cacheId:b});this._entriesToCache=new Map,this._requestWrapper=new RequestWrapper({cacheName:a,cacheId:b,plugins:c,fetchOptions:{credentials:'same-origin'}});}_addEntries(a){this._parsedCacheUrls=null,a.forEach((a)=>{this._addEntryToInstallList(this._parseEntry(a));});}getCacheName(){return this._requestWrapper.cacheName}getCachedUrls(){return this._parsedCacheUrls||(this._parsedCacheUrls=Array.from(this._entriesToCache.keys()).map((a)=>new URL(a,location).href)),this._parsedCacheUrls}_addEntryToInstallList(a){const b=a.entryID,c=this._entriesToCache.get(a.entryID);return c?void this._onDuplicateInstallEntryFound(a,c):void this._entriesToCache.set(b,a)}install(){var a=this;return asyncToGenerator(function*(){if(0===a._entriesToCache.size)return[];const b=[];return a._entriesToCache.forEach(function(c){b.push(a._cacheEntry(c));}),Promise.all(b)})()}_cacheEntry(a){var b=this;return asyncToGenerator(function*(){const c=yield b._isAlreadyCached(a),d={url:a.request.url,revision:a.revision,wasUpdated:!c};if(c)return d;try{return yield b._requestWrapper.fetchAndCache({request:a.getNetworkRequest(),waitOnCache:!0,cacheKey:a.request,cleanRedirects:!0}),yield b._onEntryCached(a),d}catch(b){throw new WorkboxError('request-not-cached',{url:a.request.url,error:b})}})()}cleanup(){var a=this;return asyncToGenerator(function*(){if(!(yield caches.has(a.getCacheName())))return;const b=[];a._entriesToCache.forEach(function(a){b.push(a.request.url);});const c=yield a._getCache(),d=yield c.keys(),e=d.filter(function(a){return!b.includes(a.url)});return Promise.all(e.map((()=>{var b=asyncToGenerator(function*(b){yield c.delete(b),yield a._onEntryDeleted(b.url);});return function(){return b.apply(this,arguments)}})()))})()}_getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.getCacheName())),a._cache})()}_parseEntry(){throw new WorkboxError('requires-overriding')}_onDuplicateEntryFound(){throw new WorkboxError('requires-overriding')}_isAlreadyCached(){throw new WorkboxError('requires-overriding')}_onEntryCached(){throw new WorkboxError('requires-overriding')}_onEntryDeleted(){throw new WorkboxError('requires-overriding')}}
|
||||
|
||||
class IDBHelper{constructor(a,b,c){if(a==void 0||b==void 0||c==void 0)throw Error('name, version, storeName must be passed to the constructor.');this._name=a,this._version=b,this._storeName=c;}_getDb(){return this._dbPromise?this._dbPromise:(this._dbPromise=idb.open(this._name,this._version,(a)=>{a.createObjectStore(this._storeName);}).then((a)=>a),this._dbPromise)}close(){return this._dbPromise?this._dbPromise.then((a)=>{a.close(),this._dbPromise=null;}):void 0}put(a,b){return this._getDb().then((c)=>{const d=c.transaction(this._storeName,'readwrite'),e=d.objectStore(this._storeName);return e.put(b,a),d.complete})}delete(a){return this._getDb().then((b)=>{const c=b.transaction(this._storeName,'readwrite'),d=c.objectStore(this._storeName);return d.delete(a),c.complete})}get(a){return this._getDb().then((b)=>b.transaction(this._storeName).objectStore(this._storeName).get(a))}getAllValues(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAll())}getAllKeys(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAllKeys())}}
|
||||
|
||||
const cacheBustParamName='_workbox-precaching';const version='v1';const dbName='workbox-precaching';const dbVersion='1';const dbStorename='asset-revisions';let tmpRevisionedCacheName=`workbox-precaching-revisioned-${version}`;self&&self.registration&&(tmpRevisionedCacheName+=`-${self.registration.scope}`);const defaultRevisionedCacheName=tmpRevisionedCacheName;
|
||||
|
||||
class RevisionDetailsModel{constructor(){this._idbHelper=new IDBHelper(dbName,dbVersion,dbStorename);}get(a){return this._idbHelper.get(a)}put(a,b){return this._idbHelper.put(a,b)}delete(a){return this._idbHelper.delete(a)}_close(){this._idbHelper.close();}}
|
||||
|
||||
class BaseCacheEntry{constructor({entryID:a,revision:b,request:c,cacheBust:d}){this.entryID=a,this.revision=b,this.request=c,this.cacheBust=d;}getNetworkRequest(){if(!0!==this.cacheBust)return this.request;let a=this.request.url;const b={};if(!0===this.cacheBust)if('cache'in Request.prototype)b.cache='reload';else{const b=new URL(a,location);b.search+=(b.search?'&':'')+encodeURIComponent(cacheBustParamName)+'='+encodeURIComponent(this.revision),a=b.toString();}return new Request(a,b)}}
|
||||
|
||||
class StringCacheEntry extends BaseCacheEntry{constructor(a){if(isType({url:a},'string'),0===a.length)throw new WorkboxError('invalid-string-entry',{url:a});super({entryID:a,revision:a,request:new Request(a),cacheBust:!1});}}
|
||||
|
||||
class ObjectCacheEntry extends BaseCacheEntry{constructor({entryID:a,revision:b,url:c,cacheBust:d}){if('undefined'!=typeof b&&(isType({revision:b},'string'),0===b.length))throw new WorkboxError('invalid-object-entry',{problemParam:'revision',problemValue:b});if('undefined'==typeof d&&(d=!!b),isType({cacheBust:d},'boolean'),isType({url:c},'string'),0===c.length)throw new WorkboxError('invalid-object-entry',{problemParam:'url',problemValue:c});if('undefined'==typeof a)a=new URL(c,location).toString();else if(0===a.length)throw new WorkboxError('invalid-object-entry',{problemParam:'entryID',problemValue:a});super({entryID:a,revision:b||c,request:new Request(c),cacheBust:d});}}
|
||||
|
||||
class RevisionedCacheManager extends BaseCacheManager{constructor(a={}){a.cacheName=a.cacheName||defaultRevisionedCacheName,super(a),this._revisionDetailsModel=new RevisionDetailsModel;}addToCacheList({revisionedFiles:a}={}){isInstance({revisionedFiles:a},Array),super._addEntries(a);const b=a.filter((a)=>'string'==typeof a||!a.revision);0<b.length&&logHelper.debug({that:this,message:`Some precache entries are URLs without separate revision
|
||||
fields. If the URLs themselves do not contain revisioning info,
|
||||
like a hash or a version number, your users won't receive updates.`,data:{"URLs without revision fields":JSON.stringify(b),"Examples of safe, versioned URLs":`'/path/file.abcd1234.css' or '/v1.0.0/file.js'`,"Examples of dangerous, unversioned URLs":`'index.html' or '/path/file.css' or '/latest/file.js'`}});}_parseEntry(a){if(null===a)throw new WorkboxError('unexpected-precache-entry',{input:a});let b;switch(typeof a){case'string':b=new StringCacheEntry(a);break;case'object':b=new ObjectCacheEntry(a);break;default:throw new WorkboxError('unexpected-precache-entry',{input:a});}return b}_onDuplicateInstallEntryFound(a,b){if(b.revision!==a.revision)throw new WorkboxError('duplicate-entry-diff-revisions',{firstEntry:{url:b.request.url,revision:b.revision},secondEntry:{url:a.request.url,revision:a.revision}})}_isAlreadyCached(a){var b=this;return asyncToGenerator(function*(){const c=yield b._revisionDetailsModel.get(a.entryID);if(c!==a.revision)return!1;const d=yield b._getCache(),e=yield d.match(a.request);return!!e})()}_onEntryCached(a){var b=this;return asyncToGenerator(function*(){yield b._revisionDetailsModel.put(a.entryID,a.revision);})()}_onEntryDeleted(a){var b=this;return asyncToGenerator(function*(){yield b._revisionDetailsModel.delete(a);})()}_close(){this._revisionDetailsModel._close();}cleanup(){return super.cleanup().then(()=>this._close())}_createLogFriendlyString(a){let b=`\n`;return a.forEach((a)=>{b+=` URL: '${a.url}' Revision: `+`'${a.revision}'\n`;}),b}install(){return super.install().then((a)=>{const b=[],c=[];a.forEach((a)=>{a.wasUpdated?b.push({url:a.url,revision:a.revision}):c.push({url:a.url,revision:a.revision});});const d={};return 0<b.length&&(d['New / Updated Precache URL\'s']=this._createLogFriendlyString(b)),0<c.length&&(d['Up-to-date Precache URL\'s']=this._createLogFriendlyString(c)),logHelper.log({message:`Precache Details: ${b.length} requests `+`were added or updated and `+`${c.length} request are already `+`cached and up-to-date.`,data:d}),a})}}
|
||||
|
||||
if(!isServiceWorkerGlobalScope())throw new WorkboxError('not-in-sw');
|
||||
|
||||
class WorkboxSW$1{constructor({cacheId:a,skipWaiting:b,clientsClaim:c,handleFetch:d=!0,directoryIndex:e='index.html',precacheChannelName:f='precache-updates',ignoreUrlParametersMatching:g=[/^utm_/]}={}){if(!isServiceWorkerGlobalScope())throw ErrorFactory.createError('not-in-sw');if(isDevBuild()&&(isLocalhost()?logHelper.debug({message:'Welcome to Workbox!',data:{"📖":'Read the guides and documentation\nhttps://workboxjs.org/',"❓":'Use the [workbox] tag on StackOverflow to ask questions\nhttps://stackoverflow.com/questions/ask?tags=workbox',"🐛":'Found a bug? Report it on GitHub\nhttps://github.com/GoogleChrome/workbox/issues/new'}}):logHelper.warn(`This appears to be a production server. Please switch
|
||||
to the smaller, optimized production build of Workbox.`)),a&&('string'!=typeof a||0===a.length))throw ErrorFactory.createError('bad-cache-id');if(b&&'boolean'!=typeof b)throw ErrorFactory.createError('bad-skip-waiting');if(c&&'boolean'!=typeof c)throw ErrorFactory.createError('bad-clients-claim');if('undefined'!=typeof e)if(!1===e||null===e)e=!1;else if('string'!=typeof e||0===e.length)throw ErrorFactory.createError('bad-directory-index');const h=[];f&&h.push(new BroadcastCacheUpdatePlugin({channelName:f,source:registration&®istration.scope?registration.scope:location})),this._runtimeCacheName=getDefaultCacheName({cacheId:a}),this._revisionedCacheManager=new RevisionedCacheManager({cacheId:a,plugins:h}),this._strategies=new Strategies({cacheId:a}),this._precacheRouter=new Router$$1(this._revisionedCacheManager.getCacheName()),this._router=new Router$$1(this._revisionedCacheManager.getCacheName()),d&&(this._precacheRouter.addFetchListener(),this._router.addFetchListener()),this._registerInstallActivateEvents(b,c),this._registerDefaultRoutes(g,e);}precache(a){if(!Array.isArray(a))throw ErrorFactory.createError('bad-revisioned-cache-list');this._revisionedCacheManager.addToCacheList({revisionedFiles:a});}get router(){return this._router}get strategies(){return this._strategies}get runtimeCacheName(){return this._runtimeCacheName}_registerInstallActivateEvents(a,b){self.addEventListener('install',(b)=>{const c=this._revisionedCacheManager.getCachedUrls();0<c.length&&logHelper.debug({that:this,message:`The precached URLs will automatically be served using a
|
||||
cache-first strategy.`,data:{"Precached URLs":JSON.stringify(c)}}),b.waitUntil(this._revisionedCacheManager.install().then(()=>{if(a)return self.skipWaiting()}));}),self.addEventListener('activate',(a)=>{a.waitUntil(this._revisionedCacheManager.cleanup().then(()=>{if(b)return self.clients.claim()}));});}_registerDefaultRoutes(a,b){const c=[];(a||b)&&c.push(this._getCacheMatchPlugin(a,b));const d=this.strategies.cacheFirst({cacheName:this._revisionedCacheManager.getCacheName(),plugins:c,excludeCacheId:!0});this._precacheRouter.registerRoute(({url:c})=>{c.hash='';const d=this._revisionedCacheManager.getCachedUrls();if(-1!==d.indexOf(c.href))return!0;let e=this._removeIgnoreUrlParams(c.href,a);return-1!==d.indexOf(e.href)||b&&e.pathname.endsWith('/')&&(e.pathname+=b,-1!==d.indexOf(e.href))},d);}_getCacheMatchPlugin(a,b){var c=this;const d=(()=>{var d=asyncToGenerator(function*({request:d,cache:e,cachedResponse:f,matchOptions:g}){if(f)return f;let h=c._removeIgnoreUrlParams(d.url,a);return e.match(h.toString(),g).then(function(a){return!a&&h.pathname.endsWith('/')?(h.pathname+=b,e.match(h.toString(),g)):a})});return function(){return d.apply(this,arguments)}})();return{cachedResponseWillBeUsed:d}}_removeIgnoreUrlParams(a,b){const c=new URL(a),d=c.search.slice(1),e=d.split('&'),f=e.map((a)=>a.split('=')),g=f.filter((a)=>b.every((b)=>!b.test(a[0]))),h=g.map((a)=>a.join('='));return c.search=h.join('&'),c}}
|
||||
|
||||
return WorkboxSW$1;
|
||||
|
||||
}());
|
||||
//# sourceMappingURL=workbox-sw.prod.v2.1.0.js.map
|
File diff suppressed because one or more lines are too long
187
docs/4.1/assets/js/vendor/workbox-sw.prod.v2.1.2.js
vendored
187
docs/4.1/assets/js/vendor/workbox-sw.prod.v2.1.2.js
vendored
@ -1,187 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Google Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
var WorkboxSW = (function () {
|
||||
'use strict';
|
||||
|
||||
class ErrorFactory$1{constructor(a){this._errors=a;}createError(a,b){if(!(a in this._errors))throw new Error(`Unable to generate error '${a}'.`);let c=this._errors[a].replace(/\s+/g,' '),d=null;b&&(c+=` [${b.message}]`,d=b.stack);const e=new Error;return e.name=a,e.message=c,e.stack=d,e}}
|
||||
|
||||
const errors={"not-in-sw":'workbox-sw must be loaded in your service worker file.',"unsupported-route-type":'The first parameter to registerRoute() should be either an Express-style path string, a RegExp, or a function.',"empty-express-string":'The Express style route string must have some characters, an empty string is invalid.',"bad-revisioned-cache-list":`The 'precache()' method expects`+`an array of revisioned urls like so: ['/example/hello.1234.txt', `+`{path: 'hello.txt', revision: '1234'}]`,"navigation-route-url-string":`The registerNavigationRoute() method `+`expects a URL string as its first parameter.`,"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character`,"bad-skip-waiting":`The 'skipWaiting' parameter must be a boolean.`,"bad-clients-claim":`The 'clientsClaim' parameter must be a boolean.`,"bad-directory-index":`The 'directoryIndex' parameter must be a boolean.`};var ErrorFactory = new ErrorFactory$1(errors);
|
||||
|
||||
class LogGroup{constructor(){this._logs=[],this._childGroups=[],this._isFallbackMode=!1;const a=/Firefox\/(\d*)\.\d*/.exec(navigator.userAgent);if(a)try{const b=parseInt(a[1],10);55>b&&(this._isFallbackMode=!0);}catch(a){this._isFallbackMode=!0;}/Edge\/\d*\.\d*/.exec(navigator.userAgent)&&(this._isFallbackMode=!0);}addPrimaryLog(a){this._primaryLog=a;}addLog(a){this._logs.push(a);}addChildGroup(a){0===a._logs.length||this._childGroups.push(a);}print(){return 0===this._logs.length&&0===this._childGroups.length?void this._printLogDetails(this._primaryLog):void(this._primaryLog&&(this._isFallbackMode?this._printLogDetails(this._primaryLog):console.groupCollapsed(...this._getLogContent(this._primaryLog))),this._logs.forEach((a)=>{this._printLogDetails(a);}),this._childGroups.forEach((a)=>{a.print();}),this._primaryLog&&!this._isFallbackMode&&console.groupEnd())}_printLogDetails(a){const b=a.logFunc?a.logFunc:console.log;b(...this._getLogContent(a));}_getLogContent(a){let b=a.message;this._isFallbackMode&&'string'==typeof b&&(b=b.replace(/%c/g,''));let c=[b];return!this._isFallbackMode&&a.colors&&(c=c.concat(a.colors)),a.args&&(c=c.concat(a.args)),c}}
|
||||
|
||||
function isServiceWorkerGlobalScope(){return'ServiceWorkerGlobalScope'in self&&self instanceof ServiceWorkerGlobalScope}function isDevBuild(){return`dev`==`prod`}function isLocalhost(){return!!('localhost'===location.hostname||'[::1]'===location.hostname||location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))}
|
||||
|
||||
self.workbox=self.workbox||{},self.workbox.LOG_LEVEL=self.workbox.LOG_LEVEL||{none:-1,verbose:0,debug:1,warn:2,error:3};const LIGHT_GREY=`#bdc3c7`; const DARK_GREY=`#7f8c8d`; const LIGHT_GREEN=`#2ecc71`; const LIGHT_YELLOW=`#f1c40f`; const LIGHT_RED=`#e74c3c`; const LIGHT_BLUE=`#3498db`;class LogHelper{constructor(){this._defaultLogLevel=isDevBuild()?self.workbox.LOG_LEVEL.debug:self.workbox.LOG_LEVEL.warn;}log(a){this._printMessage(self.workbox.LOG_LEVEL.verbose,a);}debug(a){this._printMessage(self.workbox.LOG_LEVEL.debug,a);}warn(a){this._printMessage(self.workbox.LOG_LEVEL.warn,a);}error(a){this._printMessage(self.workbox.LOG_LEVEL.error,a);}_printMessage(a,b){if(this._shouldLogMessage(a,b)){const c=this._getAllLogGroups(a,b);c.print();}}_getAllLogGroups(a,b){const c=new LogGroup,d=this._getPrimaryMessageDetails(a,b);if(c.addPrimaryLog(d),b.error){const a={message:b.error,logFunc:console.error};c.addLog(a);}const e=new LogGroup;if(b.that&&b.that.constructor&&b.that.constructor.name){const a=b.that.constructor.name;e.addLog(this._getKeyValueDetails('class',a));}return b.data&&('object'!=typeof b.data||b.data instanceof Array?e.addLog(this._getKeyValueDetails('additionalData',b.data)):Object.keys(b.data).forEach((a)=>{e.addLog(this._getKeyValueDetails(a,b.data[a]));})),c.addChildGroup(e),c}_getKeyValueDetails(a,b){return{message:`%c${a}: `,colors:[`color: ${LIGHT_BLUE}`],args:b}}_getPrimaryMessageDetails(a,b){let c,d;a===self.workbox.LOG_LEVEL.verbose?(c='Info',d=LIGHT_GREY):a===self.workbox.LOG_LEVEL.debug?(c='Debug',d=LIGHT_GREEN):a===self.workbox.LOG_LEVEL.warn?(c='Warn',d=LIGHT_YELLOW):a===self.workbox.LOG_LEVEL.error?(c='Error',d=LIGHT_RED):void 0;let e=`%c🔧 %c[${c}]`;const f=[`color: ${LIGHT_GREY}`,`color: ${d}`];let g;return'string'==typeof b?g=b:b.message&&(g=b.message),g&&(g=g.replace(/\s+/g,' '),e+=`%c ${g}`,f.push(`color: ${DARK_GREY}; font-weight: normal`)),{message:e,colors:f}}_shouldLogMessage(a,b){if(!b)return!1;let c=this._defaultLogLevel;return self&&self.workbox&&'number'==typeof self.workbox.logLevel&&(c=self.workbox.logLevel),c===self.workbox.LOG_LEVEL.none||a<c?!1:!0}}var logHelper = new LogHelper;
|
||||
|
||||
const errors$1={"express-route-invalid-path":`When using ExpressRoute, you must
|
||||
provide a path that starts with a '/' character (to match same-origin
|
||||
requests) or that starts with 'http' (to match cross-origin requests)`};var ErrorFactory$3 = new ErrorFactory$1(errors$1);
|
||||
|
||||
var ErrorStackParser = {parse:()=>[]};
|
||||
|
||||
function atLeastOne(a){const b=Object.keys(a);b.some((b)=>a[b]!==void 0)||throwError('Please set at least one of the following parameters: '+b.map((a)=>`'${a}'`).join(', '));}function hasMethod(a,b){const c=Object.keys(a).pop(),d=typeof a[c][b];'function'!=d&&throwError(`The '${c}' parameter must be an object that exposes a
|
||||
'${b}' method.`);}function isInstance(a,b){const c=Object.keys(a).pop();a[c]instanceof b||throwError(`The '${c}' parameter must be an instance of
|
||||
'${b.name}'`);}function isOneOf(a,b){const c=Object.keys(a).pop();b.includes(a[c])||throwError(`The '${c}' parameter must be set to one of the
|
||||
following: ${b}`);}function isType(a,b){const c=Object.keys(a).pop(),d=typeof a[c];d!==b&&throwError(`The '${c}' parameter has the wrong type. (Expected:
|
||||
${b}, actual: ${d})`);}function isArrayOfType(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing
|
||||
one or more '${b}' elements.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])typeof e!==b&&throwError(d);}function isArrayOfClass(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing
|
||||
one or more '${b.name}' instances.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])e instanceof b||throwError(d);}function throwError(a){a=a.replace(/\s+/g,' ');const b=new Error(a);b.name='assertion-failed';const c=ErrorStackParser.parse(b);throw 3<=c.length&&(b.message=`Invalid call to ${c[2].functionName}() — `+a),b}
|
||||
|
||||
function normalizeHandler(a){return'object'==typeof a?(hasMethod({handler:a},'handle'),a):(isType({handler:a},'function'),{handle:a})}
|
||||
|
||||
const defaultMethod='GET';const validMethods=['DELETE','GET','HEAD','POST','PUT'];
|
||||
|
||||
class Route{constructor({match:a,handler:b,method:c}={}){this.handler=normalizeHandler(b),isType({match:a},'function'),this.match=a,c?(isOneOf({method:c},validMethods),this.method=c):this.method=defaultMethod;}}
|
||||
|
||||
var index$1=Array.isArray||function(a){return'[object Array]'==Object.prototype.toString.call(a)};
|
||||
|
||||
var index=pathToRegexp; var parse_1=parse; var compile_1=compile; var tokensToFunction_1=tokensToFunction; var tokensToRegExp_1=tokensToRegExp; var PATH_REGEXP=new RegExp('(\\\\.)|([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))','g');function parse(a,b){for(var c,d=[],e=0,f=0,g='',h=b&&b.delimiter||'/';null!=(c=PATH_REGEXP.exec(a));){var i=c[0],j=c[1],k=c.index;if(g+=a.slice(f,k),f=k+i.length,j){g+=j[1];continue}var l=a[f],m=c[2],n=c[3],o=c[4],p=c[5],q=c[6],r=c[7];g&&(d.push(g),g='');var s=c[2]||h,t=o||p;d.push({name:n||e++,prefix:m||'',delimiter:s,optional:'?'===q||'*'===q,repeat:'+'===q||'*'===q,partial:null!=m&&null!=l&&l!==m,asterisk:!!r,pattern:t?escapeGroup(t):r?'.*':'[^'+escapeString(s)+']+?'});}return f<a.length&&(g+=a.substr(f)),g&&d.push(g),d}function compile(a,b){return tokensToFunction(parse(a,b))}function encodeURIComponentPretty(a){return encodeURI(a).replace(/[\/?#]/g,function(a){return'%'+a.charCodeAt(0).toString(16).toUpperCase()})}function encodeAsterisk(a){return encodeURI(a).replace(/[?#]/g,function(a){return'%'+a.charCodeAt(0).toString(16).toUpperCase()})}function tokensToFunction(a){for(var b=Array(a.length),c=0;c<a.length;c++)'object'==typeof a[c]&&(b[c]=new RegExp('^(?:'+a[c].pattern+')$'));return function(c,d){for(var e,f='',g=c||{},h=d||{},k=h.pretty?encodeURIComponentPretty:encodeURIComponent,l=0;l<a.length;l++){if(e=a[l],'string'==typeof e){f+=e;continue}var i,m=g[e.name];if(null==m)if(e.optional){e.partial&&(f+=e.prefix);continue}else throw new TypeError('Expected "'+e.name+'" to be defined');if(index$1(m)){if(!e.repeat)throw new TypeError('Expected "'+e.name+'" to not repeat, but received `'+JSON.stringify(m)+'`');if(0===m.length)if(e.optional)continue;else throw new TypeError('Expected "'+e.name+'" to not be empty');for(var n=0;n<m.length;n++){if(i=k(m[n]),!b[l].test(i))throw new TypeError('Expected all "'+e.name+'" to match "'+e.pattern+'", but received `'+JSON.stringify(i)+'`');f+=(0===n?e.prefix:e.delimiter)+i;}continue}if(i=e.asterisk?encodeAsterisk(m):k(m),!b[l].test(i))throw new TypeError('Expected "'+e.name+'" to match "'+e.pattern+'", but received "'+i+'"');f+=e.prefix+i;}return f}}function escapeString(a){return a.replace(/([.+*?=^!:${}()[\]|\/\\])/g,'\\$1')}function escapeGroup(a){return a.replace(/([=!:$\/()])/g,'\\$1')}function attachKeys(a,b){return a.keys=b,a}function flags(a){return a.sensitive?'':'i'}function regexpToRegexp(a,b){var c=a.source.match(/\((?!\?)/g);if(c)for(var d=0;d<c.length;d++)b.push({name:d,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return attachKeys(a,b)}function arrayToRegexp(a,b,c){for(var d=[],e=0;e<a.length;e++)d.push(pathToRegexp(a[e],b,c).source);var f=new RegExp('(?:'+d.join('|')+')',flags(c));return attachKeys(f,b)}function stringToRegexp(a,b,c){return tokensToRegExp(parse(a,c),b,c)}function tokensToRegExp(a,b,c){index$1(b)||(c=b||c,b=[]),c=c||{};for(var d,e=c.strict,f=!1!==c.end,g='',h=0;h<a.length;h++)if(d=a[h],'string'==typeof d)g+=escapeString(d);else{var i=escapeString(d.prefix),j='(?:'+d.pattern+')';b.push(d),d.repeat&&(j+='(?:'+i+j+')*'),j=d.optional?d.partial?i+'('+j+')?':'(?:'+i+'('+j+'))?':i+'('+j+')',g+=j;}var k=escapeString(c.delimiter||'/'),l=g.slice(-k.length)===k;return e||(g=(l?g.slice(0,-k.length):g)+'(?:'+k+'(?=$))?'),g+=f?'$':e&&l?'':'(?='+k+'|$)',attachKeys(new RegExp('^'+g,flags(c)),b)}function pathToRegexp(a,b,c){return index$1(b)||(c=b||c,b=[]),c=c||{},a instanceof RegExp?regexpToRegexp(a,b):index$1(a)?arrayToRegexp(a,b,c):stringToRegexp(a,b,c)}index.parse=parse_1,index.compile=compile_1,index.tokensToFunction=tokensToFunction_1,index.tokensToRegExp=tokensToRegExp_1;
|
||||
|
||||
class ExpressRoute extends Route{constructor({path:a,handler:b,method:c}){if(!(a.startsWith('/')||a.startsWith('http')))throw ErrorFactory$3.createError('express-route-invalid-path');let d=[];const e=index(a,d);super({match:({url:b})=>{if(a.startsWith('/')&&b.origin!==location.origin)return null;const c=a.startsWith('/')?b.pathname:b.href,f=c.match(e);if(!f)return null;const g={};return d.forEach((a,b)=>{g[a.name]=f[b+1];}),g},handler:b,method:c});}}
|
||||
|
||||
class NavigationRoute extends Route{constructor({whitelist:a,blacklist:b,handler:c}={}){isArrayOfClass({whitelist:a},RegExp),b?isArrayOfClass({blacklist:b},RegExp):b=[];super({match:({event:d,url:e})=>{let f,g=!1;if('navigate'===d.request.mode){const d=e.pathname+e.search;a.some((a)=>a.test(d))?b.some((a)=>a.test(d))?f=`The navigation route is not being used, since the `+`request URL matches both the whitelist and blacklist.`:(f=`The navigation route is being used.`,g=!0):f=`The navigation route is not being used, since the `+`URL being navigated to doesn't match the whitelist.`,logHelper.debug({that:this,message:f,data:{"request-url":e.href,whitelist:a,blacklist:b,handler:c}});}return g},handler:c,method:'GET'});}}
|
||||
|
||||
class RegExpRoute extends Route{constructor({regExp:a,handler:b,method:c}){isInstance({regExp:a},RegExp);super({match:({url:b})=>{const c=a.exec(b.href);return c?b.origin!==location.origin&&0!==c.index?(logHelper.debug({that:this,message:`Skipping route, because the RegExp match didn't occur `+`at the start of the URL.`,data:{url:b.href,regExp:a}}),null):c.slice(1):null},handler:b,method:c});}}
|
||||
|
||||
class Router$2{constructor(){this._routes=new Map,this._isListenerRegistered=!1;}addFetchListener(){return this._isListenerRegistered?(logHelper.warn({that:this,message:`addFetchListener() has already been called for this Router.`}),!1):(this._isListenerRegistered=!0,self.addEventListener('fetch',(a)=>{const b=this.handleRequest({event:a});b&&a.respondWith(b);}),!0)}handleRequest({event:a}){isInstance({event:a},FetchEvent);const b=new URL(a.request.url);if(!b.protocol.startsWith('http'))return void logHelper.log({that:this,message:`The URL does not start with HTTP, so it can't be handled.`,data:{request:a.request}});let{handler:c,params:d}=this._findHandlerAndParams({event:a,url:b});if(!c&&this.defaultHandler&&(c=this.defaultHandler),c){let e=c.handle({url:b,event:a,params:d});return this.catchHandler&&(e=e.catch((c)=>this.catchHandler.handle({url:b,event:a,error:c}))),e}}_findHandlerAndParams({event:a,url:b}){const c=this._routes.get(a.request.method)||[];for(const d of c){let c=d.match({url:b,event:a});if(c)return logHelper.log({that:this,message:'The router found a matching route.',data:{route:d,request:a.request}}),Array.isArray(c)&&0===c.length?c=void 0:c.constructor===Object&&0===Object.keys(c).length&&(c=void 0),{params:c,handler:d.handler}}return{handler:void 0,params:void 0}}setDefaultHandler({handler:a}={}){this.defaultHandler=normalizeHandler(a);}setCatchHandler({handler:a}={}){this.catchHandler=normalizeHandler(a);}registerRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a)this._routes.has(b.method)||this._routes.set(b.method,[]),this._routes.get(b.method).unshift(b);}registerRoute({route:a}={}){isInstance({route:a},Route),this.registerRoutes({routes:[a]});}unregisterRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a){this._routes.has(b.method)||logHelper.error({that:this,message:`Can't unregister route; there are no ${b.method}
|
||||
routes registered.`,data:{route:b}});const a=this._routes.get(b.method).indexOf(b);-1<a?this._routes.get(b.method).splice(a,1):logHelper.error({that:this,message:`Can't unregister route; the route wasn't previously
|
||||
registered.`,data:{route:b}});}}unregisterRoute({route:a}={}){isInstance({route:a},Route),this.unregisterRoutes({routes:[a]});}}
|
||||
|
||||
class Router$$1 extends Router$2{constructor(a,b){super({handleFetch:b}),this._revisionedCacheName=a;}registerRoute(a,b,c='GET'){'function'==typeof b&&(b={handle:b});let d;if('string'==typeof a){if(0===a.length)throw ErrorFactory.createError('empty-express-string');const e=a.startsWith('http')?new URL(a,location).pathname:a,f=e.match(/[*:?+]/);f&&logHelper.warn({message:`registerRoute() was called with a string containing an `+`Express-style wildcard character. In the next version of `+`Workbox, Express-style wildcards won't be supported, and `+`strings will be treated a exact matches. Please switch to `+`regular expressions for equivalent behavior.`,data:{"Path String":a,"Wildcard Character":f[0],"Learn More":'https://goo.gl/xZMKEV'}}),d=new ExpressRoute({path:a,handler:b,method:c});}else if(a instanceof RegExp)d=new RegExpRoute({regExp:a,handler:b,method:c});else if('function'==typeof a)d=new Route({match:a,handler:b,method:c});else throw ErrorFactory.createError('unsupported-route-type');return super.registerRoute({route:d}),d}registerNavigationRoute(a,b={}){if('string'!=typeof a)throw ErrorFactory.createError('navigation-route-url-string');const c='cacheName'in b?b.cacheName:this._revisionedCacheName;super.registerRoute({route:new NavigationRoute({handler:()=>caches.match(a,{cacheName:c}),whitelist:b.whitelist||[/./],blacklist:b.blacklist||[]})});}}
|
||||
|
||||
const errors$2={"multiple-cache-will-update-plugins":'You cannot register more than one plugin that implements cacheWillUpdate.',"multiple-cached-response-will-be-used-plugins":'You cannot register more than one plugin that implements cachedResponseWillBeUsed.',"invalid-response-for-caching":'The fetched response could not be cached due to an invalid response code.',"no-response-received":'No response received; falling back to cache.',"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character.`};var ErrorFactory$4 = new ErrorFactory$1(errors$2);
|
||||
|
||||
class CacheableResponse{constructor({statuses:a,headers:b}={}){atLeastOne({statuses:a,headers:b}),a!==void 0&&isArrayOfType({statuses:a},'number'),b!==void 0&&isType({headers:b},'object'),this.statuses=a,this.headers=b;}isResponseCacheable({request:a,response:b}={}){isInstance({response:b},Response);let c=!0;if(this.statuses&&(c=this.statuses.includes(b.status)),this.headers&&c&&(c=Object.keys(this.headers).some((a)=>b.headers.get(a)===this.headers[a])),!c){const c={response:b};this.statuses&&(c['valid-status-codes']=JSON.stringify(this.statuses)),this.headers&&(c['valid-headers']=JSON.stringify(this.headers)),a&&(c.request=a),logHelper.debug({message:`The response does not meet the criteria for being added to the
|
||||
cache.`,data:c});}return c}}
|
||||
|
||||
class CacheableResponsePlugin extends CacheableResponse{cacheWillUpdate({request:a,response:b}={}){return this.isResponseCacheable({request:a,response:b})}}
|
||||
|
||||
const getDefaultCacheName=({cacheId:a}={})=>{let b=`workbox-runtime-caching`;return a&&(b=`${a}-${b}`),self&&self.registration&&(b+=`-${self.registration.scope}`),b};
|
||||
const pluginCallbacks=['cacheDidUpdate','cachedResponseWillBeUsed','cacheWillUpdate','fetchDidFail','requestWillFetch'];
|
||||
|
||||
var cleanResponseCopy = (({response:a})=>{isInstance({response:a},Response);const b=a.clone(),c='body'in b?Promise.resolve(b.body):b.blob();return c.then((a)=>new Response(a,{headers:b.headers,status:b.status,statusText:b.statusText}))});
|
||||
|
||||
var asyncToGenerator = function (fn) {
|
||||
return function () {
|
||||
var gen = fn.apply(this, arguments);
|
||||
return new Promise(function (resolve, reject) {
|
||||
function step(key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
return Promise.resolve(value).then(function (value) {
|
||||
step("next", value);
|
||||
}, function (err) {
|
||||
step("throw", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return step("next");
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
class RequestWrapper{constructor({cacheName:a,cacheId:b,plugins:c,fetchOptions:d,matchOptions:e}={}){if(b&&('string'!=typeof b||0===b.length))throw ErrorFactory$4.createError('bad-cache-id');a?(isType({cacheName:a},'string'),this.cacheName=a,b&&(this.cacheName=`${b}-${this.cacheName}`)):this.cacheName=getDefaultCacheName({cacheId:b}),d&&(isType({fetchOptions:d},'object'),this.fetchOptions=d),e&&(isType({matchOptions:e},'object'),this.matchOptions=e),this.plugins=new Map,c&&(isArrayOfType({plugins:c},'object'),c.forEach((a)=>{for(let b of pluginCallbacks)if('function'==typeof a[b]){if(!this.plugins.has(b))this.plugins.set(b,[]);else if('cacheWillUpdate'===b)throw ErrorFactory$4.createError('multiple-cache-will-update-plugins');else if('cachedResponseWillBeUsed'===b)throw ErrorFactory$4.createError('multiple-cached-response-will-be-used-plugins');this.plugins.get(b).push(a);}})),this.plugins.has('cacheWillUpdate')&&(this._userSpecifiedCachableResponsePlugin=this.plugins.get('cacheWillUpdate')[0]);}getDefaultCacheableResponsePlugin(){return this._defaultCacheableResponsePlugin||(this._defaultCacheableResponsePlugin=new CacheableResponsePlugin({statuses:[200]})),this._defaultCacheableResponsePlugin}getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.cacheName)),a._cache})()}match({request:a}){var b=this;return asyncToGenerator(function*(){atLeastOne({request:a});const c=yield b.getCache();let d=yield c.match(a,b.matchOptions);if(b.plugins.has('cachedResponseWillBeUsed')){const e=b.plugins.get('cachedResponseWillBeUsed')[0];d=yield e.cachedResponseWillBeUsed({request:a,cache:c,cachedResponse:d,matchOptions:b.matchOptions,cacheName:b.cacheName});}return d})()}fetch({request:a}){var b=this;return asyncToGenerator(function*(){'string'==typeof a?a=new Request(a):isInstance({request:a},Request);const c=b.plugins.has('fetchDidFail')?a.clone():null;if(b.plugins.has('requestWillFetch'))for(let c of b.plugins.get('requestWillFetch')){const b=yield c.requestWillFetch({request:a});isInstance({returnedRequest:b},Request),a=b;}try{return yield fetch(a,b.fetchOptions)}catch(a){if(b.plugins.has('fetchDidFail'))for(let a of b.plugins.get('fetchDidFail'))yield a.fetchDidFail({request:c.clone()});throw a}})()}fetchAndCache({request:a,waitOnCache:b,cacheKey:c,cacheResponsePlugin:d,cleanRedirects:e}){var f=this;return asyncToGenerator(function*(){atLeastOne({request:a});let g;const h=yield f.fetch({request:a}),i=f._userSpecifiedCachableResponsePlugin||d||f.getDefaultCacheableResponsePlugin(),j=yield i.cacheWillUpdate({request:a,response:h});if(j){const b=e&&h.redirected?yield cleanResponseCopy({response:h}):h.clone();g=f.getCache().then((()=>{var d=asyncToGenerator(function*(d){let e;const g=c||a;if('opaque'!==h.type&&f.plugins.has('cacheDidUpdate')&&(e=yield f.match({request:g})),yield d.put(g,b),f.plugins.has('cacheDidUpdate'))for(let a of f.plugins.get('cacheDidUpdate'))yield a.cacheDidUpdate({cacheName:f.cacheName,oldResponse:e,newResponse:b,url:'url'in g?g.url:g});});return function(){return d.apply(this,arguments)}})());}else if(!j&&b)throw ErrorFactory$4.createError('invalid-response-for-caching');return b&&g&&(yield g),h})()}}
|
||||
|
||||
class Handler{constructor({requestWrapper:a,waitOnCache:b}={}){this.requestWrapper=a?a:new RequestWrapper,this.waitOnCache=!!b;}handle({event:a,params:b}={}){throw Error('This abstract method must be implemented in a subclass.')}}
|
||||
|
||||
class CacheFirst extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=yield b.requestWrapper.match({request:a.request});return c||(yield b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache}))})()}}
|
||||
|
||||
class CacheOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.match({request:a.request})})()}}
|
||||
|
||||
class NetworkFirst extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});const{networkTimeoutSeconds:b}=a;b&&(isType({networkTimeoutSeconds:b},'number'),this.networkTimeoutSeconds=b);}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=[];let d;b.networkTimeoutSeconds&&c.push(new Promise(function(c){d=setTimeout(function(){c(b.requestWrapper.match({request:a.request}));},1e3*b.networkTimeoutSeconds);}));const e=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).then(function(a){return d&&clearTimeout(d),a?a:Promise.reject(ErrorFactory$4.createError('no-response-received'))}).catch(function(){return b.requestWrapper.match({request:a.request})});return c.push(e),Promise.race(c)})()}}
|
||||
|
||||
class NetworkOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.fetch({request:a.request})})()}}
|
||||
|
||||
class StaleWhileRevalidate extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).catch(function(){return Response.error()}),d=yield b.requestWrapper.match({request:a.request});return d||(yield c)})()}}
|
||||
|
||||
let tmpIdbName=`workbox-cache-expiration`;self&&self.registration&&(tmpIdbName+=`-${self.registration.scope}`);const idbName=tmpIdbName;const idbVersion=1;const urlPropertyName='url';const timestampPropertyName='timestamp';
|
||||
|
||||
function createCommonjsModule(fn, module) {
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
var idb=createCommonjsModule(function(a){'use strict';(function(){function b(a){return Array.prototype.slice.call(a)}function c(a){return new Promise(function(b,c){a.onsuccess=function(){b(a.result);},a.onerror=function(){c(a.error);};})}function d(a,b,d){var e,f=new Promise(function(f,g){e=a[b].apply(a,d),c(e).then(f,g);});return f.request=e,f}function e(a,b,c){var e=d(a,b,c);return e.then(function(a){return a?new k(a,e.request):void 0})}function f(a,b,c){c.forEach(function(c){Object.defineProperty(a.prototype,c,{get:function(){return this[b][c]},set:function(a){this[b][c]=a;}});});}function g(a,b,c,e){e.forEach(function(e){e in c.prototype&&(a.prototype[e]=function(){return d(this[b],e,arguments)});});}function h(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return this[b][d].apply(this[b],arguments)});});}function i(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return e(this[b],d,arguments)});});}function j(a){this._index=a;}function k(a,b){this._cursor=a,this._request=b;}function l(a){this._store=a;}function m(a){this._tx=a,this.complete=new Promise(function(b,c){a.oncomplete=function(){b();},a.onerror=function(){c(a.error);},a.onabort=function(){c(a.error);};});}function n(a,b,c){this._db=a,this.oldVersion=b,this.transaction=new m(c);}function o(a){this._db=a;}f(j,'_index',['name','keyPath','multiEntry','unique']),g(j,'_index',IDBIndex,['get','getKey','getAll','getAllKeys','count']),i(j,'_index',IDBIndex,['openCursor','openKeyCursor']),f(k,'_cursor',['direction','key','primaryKey','value']),g(k,'_cursor',IDBCursor,['update','delete']),['advance','continue','continuePrimaryKey'].forEach(function(a){a in IDBCursor.prototype&&(k.prototype[a]=function(){var b=this,d=arguments;return Promise.resolve().then(function(){return b._cursor[a].apply(b._cursor,d),c(b._request).then(function(a){return a?new k(a,b._request):void 0})})});}),l.prototype.createIndex=function(){return new j(this._store.createIndex.apply(this._store,arguments))},l.prototype.index=function(){return new j(this._store.index.apply(this._store,arguments))},f(l,'_store',['name','keyPath','indexNames','autoIncrement']),g(l,'_store',IDBObjectStore,['put','add','delete','clear','get','getAll','getKey','getAllKeys','count']),i(l,'_store',IDBObjectStore,['openCursor','openKeyCursor']),h(l,'_store',IDBObjectStore,['deleteIndex']),m.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))},f(m,'_tx',['objectStoreNames','mode']),h(m,'_tx',IDBTransaction,['abort']),n.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))},f(n,'_db',['name','version','objectStoreNames']),h(n,'_db',IDBDatabase,['deleteObjectStore','close']),o.prototype.transaction=function(){return new m(this._db.transaction.apply(this._db,arguments))},f(o,'_db',['name','version','objectStoreNames']),h(o,'_db',IDBDatabase,['close']),['openCursor','openKeyCursor'].forEach(function(a){[l,j].forEach(function(c){c.prototype[a.replace('open','iterate')]=function(){var c=b(arguments),d=c[c.length-1],e=this._store||this._index,f=e[a].apply(e,c.slice(0,-1));f.onsuccess=function(){d(f.result);};};});}),[j,l].forEach(function(a){a.prototype.getAll||(a.prototype.getAll=function(a,b){var c=this,d=[];return new Promise(function(e){c.iterateCursor(a,function(a){return a?(d.push(a.value),void 0!==b&&d.length==b?void e(d):void a.continue()):void e(d)});})});});var p={open:function(a,b,c){var e=d(indexedDB,'open',[a,b]),f=e.request;return f.onupgradeneeded=function(a){c&&c(new n(f.result,a.oldVersion,f.transaction));},e.then(function(a){return new o(a)})},delete:function(a){return d(indexedDB,'deleteDatabase',[a])}};a.exports=p,a.exports.default=a.exports;})();});
|
||||
|
||||
const errors$3={"max-entries-or-age-required":`Either the maxEntries or maxAgeSeconds
|
||||
parameters (or both) are required when constructing Plugin.`,"max-entries-must-be-number":`The maxEntries parameter to the Plugin
|
||||
constructor must either be a number or undefined.`,"max-age-seconds-must-be-number":`The maxAgeSeconds parameter to the Plugin
|
||||
constructor must either be a number or undefined.`};var ErrorFactory$5 = new ErrorFactory$1(errors$3);
|
||||
|
||||
class CacheExpiration{constructor({maxEntries:a,maxAgeSeconds:b}={}){if(!(a||b))throw ErrorFactory$5.createError('max-entries-or-age-required');if(a&&'number'!=typeof a)throw ErrorFactory$5.createError('max-entries-must-be-number');if(b&&'number'!=typeof b)throw ErrorFactory$5.createError('max-age-seconds-must-be-number');this.maxEntries=a,this.maxAgeSeconds=b,this._dbs=new Map,this._caches=new Map,this._expirationMutex=!1,this._timestampForNextRun=null;}getDB({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=`${idbName}-${a}`;if(!b._dbs.has(c)){const d=yield idb.open(c,idbVersion,function(b){const c=b.createObjectStore(a,{keyPath:urlPropertyName});c.createIndex(timestampPropertyName,timestampPropertyName,{unique:!1});});b._dbs.set(c,d);}return b._dbs.get(c)})()}getCache({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),!b._caches.has(a)){const c=yield caches.open(a);b._caches.set(a,c);}return b._caches.get(a)})()}isResponseFresh({cacheName:a,cachedResponse:b,now:c}={}){if(b&&this.maxAgeSeconds){isInstance({cachedResponse:b},Response);const d=b.headers.get('date');if(d){'undefined'==typeof c&&(c=Date.now());const a=new Date(d),b=a.getTime();return!!isNaN(b)||b+1e3*this.maxAgeSeconds>c}return this.expireEntries({cacheName:a,now:c}),!0}return!0}updateTimestamp({cacheName:a,url:b,now:c}={}){var d=this;return asyncToGenerator(function*(){isType({url:b},'string'),isType({cacheName:a},'string');const e=new URL(b,location);e.hash='','undefined'==typeof c&&(c=Date.now());const f=yield d.getDB({cacheName:a}),g=f.transaction(a,'readwrite');g.objectStore(a).put({[timestampPropertyName]:c,[urlPropertyName]:e.href}),yield g.complete;})()}expireEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){if(c._expirationMutex)return void(c._timestampForNextRun=b);c._expirationMutex=!0,isType({cacheName:a},'string'),'undefined'==typeof b&&(b=Date.now());const d=c.maxAgeSeconds?yield c.findOldEntries({cacheName:a,now:b}):[],e=c.maxEntries?yield c.findExtraEntries({cacheName:a}):[],f=[...new Set(d.concat(e))];if(yield c.deleteFromCacheAndIDB({cacheName:a,urls:f}),0<f.length&&logHelper.debug({that:c,message:'Expired entries have been removed from the cache.',data:{cacheName:a,urls:f}}),c._expirationMutex=!1,c._timestampForNextRun){const b=c._timestampForNextRun;return c._timestampForNextRun=null,c.expireEntries({cacheName:a,now:b})}})()}findOldEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){isType({cacheName:a},'string'),isType({now:b},'number');const d=b-1e3*c.maxAgeSeconds,e=[],f=yield c.getDB({cacheName:a}),g=f.transaction(a,'readonly'),h=g.objectStore(a),i=h.index(timestampPropertyName);return i.iterateCursor(function(a){a&&(a.value[timestampPropertyName]<d&&e.push(a.value[urlPropertyName]),a.continue());}),yield g.complete,e})()}findExtraEntries({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=[],d=yield b.getDB({cacheName:a});let e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName);const h=yield g.count();return h>b.maxEntries&&(e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName),g.iterateCursor(function(a){a&&(c.push(a.value[urlPropertyName]),h-c.length>b.maxEntries&&a.continue());})),yield e.complete,c})()}deleteFromCacheAndIDB({cacheName:a,urls:b}={}){var c=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),isArrayOfType({urls:b},'string'),0<b.length){const d=yield c.getCache({cacheName:a}),e=yield c.getDB({cacheName:a});for(let c of b){yield d.delete(c);const b=e.transaction(a,'readwrite'),f=b.objectStore(a);f.delete(c),yield b.complete;}}})()}}
|
||||
|
||||
class CacheExpirationPlugin extends CacheExpiration{cachedResponseWillBeUsed({cacheName:a,cachedResponse:b,now:c}={}){return this.isResponseFresh({cacheName:a,cachedResponse:b,now:c})?b:null}cacheDidUpdate({cacheName:a,newResponse:b,url:c,now:d}={}){var e=this;return asyncToGenerator(function*(){isType({cacheName:a},'string'),isInstance({newResponse:b},Response),'undefined'==typeof d&&(d=Date.now()),yield e.updateTimestamp({cacheName:a,url:c,now:d}),yield e.expireEntries({cacheName:a,now:d});})()}}
|
||||
|
||||
const errors$4={"channel-name-required":`The channelName parameter is required when
|
||||
constructing a new BroadcastCacheUpdate instance.`,"responses-are-same-parameters-required":`The first, second, and
|
||||
headersToCheck parameters must be valid when calling responsesAreSame()`};var ErrorFactory$6 = new ErrorFactory$1(errors$4);
|
||||
|
||||
const cacheUpdatedMessageType='CACHE_UPDATED';
|
||||
const defaultHeadersToCheck=['content-length','etag','last-modified'];
|
||||
const defaultSource='workbox-broadcast-cache-update';
|
||||
|
||||
function broadcastUpdate({channel:a,cacheName:b,url:c,source:d}={}){isInstance({channel:a},BroadcastChannel),isType({cacheName:b},'string'),isType({source:d},'string'),isType({url:c},'string'),a.postMessage({type:cacheUpdatedMessageType,meta:d,payload:{cacheName:b,updatedUrl:c}});}
|
||||
|
||||
function responsesAreSame({first:a,second:b,headersToCheck:c}={}){if(!(a instanceof Response&&b instanceof Response&&c instanceof Array))throw ErrorFactory$6.createError('responses-are-same-parameters-required');const d=c.some((c)=>a.headers.has(c)&&b.headers.has(c));return d?c.every((c)=>a.headers.has(c)===b.headers.has(c)&&a.headers.get(c)===b.headers.get(c)):(logHelper.log({message:`Unable to determine whether the response has been updated
|
||||
because none of the headers that would be checked are present.`,data:{"First Response":a,"Second Response":b,"Headers To Check":JSON.stringify(c)}}),!0)}
|
||||
|
||||
class BroadcastCacheUpdate{constructor({channelName:a,headersToCheck:b,source:c}={}){if('string'!=typeof a||0===a.length)throw ErrorFactory$6.createError('channel-name-required');this.channelName=a,this.headersToCheck=b||defaultHeadersToCheck,this.source=c||defaultSource;}get channel(){return this._channel||(this._channel=new BroadcastChannel(this.channelName)),this._channel}notifyIfUpdated({first:a,second:b,cacheName:c,url:d}){isType({cacheName:c},'string'),responsesAreSame({first:a,second:b,headersToCheck:this.headersToCheck})||broadcastUpdate({cacheName:c,url:d,channel:this.channel,source:this.source});}}
|
||||
|
||||
class BroadcastCacheUpdatePlugin extends BroadcastCacheUpdate{cacheDidUpdate({cacheName:a,oldResponse:b,newResponse:c,url:d}){isType({cacheName:a},'string'),isInstance({newResponse:c},Response),b&&this.notifyIfUpdated({cacheName:a,first:b,second:c,url:d});}}
|
||||
|
||||
class Strategies{constructor({cacheId:a}={}){this._cacheId=a;}cacheFirst(a){return this._getCachingMechanism(CacheFirst,a)}cacheOnly(a){return this._getCachingMechanism(CacheOnly,a)}networkFirst(a){return this._getCachingMechanism(NetworkFirst,a)}networkOnly(a){return this._getCachingMechanism(NetworkOnly,a)}staleWhileRevalidate(a){return this._getCachingMechanism(StaleWhileRevalidate,a)}_getCachingMechanism(a,b={}){const c={cacheExpiration:CacheExpirationPlugin,broadcastCacheUpdate:BroadcastCacheUpdatePlugin,cacheableResponse:CacheableResponsePlugin},d={plugins:[]};b.excludeCacheId||(d.cacheId=this._cacheId),b.cacheName&&(d.cacheName=b.cacheName);const e=Object.keys(c);return e.forEach((a)=>{if(b[a]){const e=c[a],f=b[a];d.plugins.push(new e(f));}}),b.plugins&&b.plugins.forEach((a)=>{d.plugins.push(a);}),b.requestWrapper=new RequestWrapper(d),new a(b)}}
|
||||
|
||||
const errorMessageFactory=(a,b)=>{let c=`An error was thrown by workbox with error code: `+`;'${a}'`;return b&&(c+=` with extras: '${JSON.stringify(b)}'`),c};
|
||||
|
||||
class WorkboxError extends Error{constructor(a,b){super(),this.name=a,this.message=errorMessageFactory(a,b),b&&(this.extras=b);}}
|
||||
|
||||
class BaseCacheManager{constructor({cacheName:a,cacheId:b,plugins:c}={}){if(b&&('string'!=typeof b||0===b.length))throw new WorkboxError('bad-cache-id',{cacheId:b});this._entriesToCache=new Map,this._requestWrapper=new RequestWrapper({cacheName:a,cacheId:b,plugins:c,fetchOptions:{credentials:'same-origin'}});}_addEntries(a){this._parsedCacheUrls=null,a.forEach((a)=>{this._addEntryToInstallList(this._parseEntry(a));});}getCacheName(){return this._requestWrapper.cacheName}getCachedUrls(){return this._parsedCacheUrls||(this._parsedCacheUrls=Array.from(this._entriesToCache.keys()).map((a)=>new URL(a,location).href)),this._parsedCacheUrls}_addEntryToInstallList(a){const b=a.entryID,c=this._entriesToCache.get(a.entryID);return c?void this._onDuplicateInstallEntryFound(a,c):void this._entriesToCache.set(b,a)}install(){var a=this;return asyncToGenerator(function*(){if(0===a._entriesToCache.size)return[];const b=[];return a._entriesToCache.forEach(function(c){b.push(a._cacheEntry(c));}),Promise.all(b)})()}_cacheEntry(a){var b=this;return asyncToGenerator(function*(){const c=yield b._isAlreadyCached(a),d={url:a.request.url,revision:a.revision,wasUpdated:!c};if(c)return d;try{return yield b._requestWrapper.fetchAndCache({request:a.getNetworkRequest(),waitOnCache:!0,cacheKey:a.request,cleanRedirects:!0}),yield b._onEntryCached(a),d}catch(b){throw new WorkboxError('request-not-cached',{url:a.request.url,error:b})}})()}cleanup(){var a=this;return asyncToGenerator(function*(){if(!(yield caches.has(a.getCacheName())))return;const b=[];a._entriesToCache.forEach(function(a){b.push(a.request.url);});const c=yield a._getCache(),d=yield c.keys(),e=d.filter(function(a){return!b.includes(a.url)});return Promise.all(e.map((()=>{var b=asyncToGenerator(function*(b){yield c.delete(b),yield a._onEntryDeleted(b.url);});return function(){return b.apply(this,arguments)}})()))})()}_getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.getCacheName())),a._cache})()}_parseEntry(){throw new WorkboxError('requires-overriding')}_onDuplicateEntryFound(){throw new WorkboxError('requires-overriding')}_isAlreadyCached(){throw new WorkboxError('requires-overriding')}_onEntryCached(){throw new WorkboxError('requires-overriding')}_onEntryDeleted(){throw new WorkboxError('requires-overriding')}}
|
||||
|
||||
class IDBHelper{constructor(a,b,c){if(a==void 0||b==void 0||c==void 0)throw Error('name, version, storeName must be passed to the constructor.');this._name=a,this._version=b,this._storeName=c;}_getDb(){return this._dbPromise?this._dbPromise:(this._dbPromise=idb.open(this._name,this._version,(a)=>{a.createObjectStore(this._storeName);}).then((a)=>a),this._dbPromise)}close(){return this._dbPromise?this._dbPromise.then((a)=>{a.close(),this._dbPromise=null;}):void 0}put(a,b){return this._getDb().then((c)=>{const d=c.transaction(this._storeName,'readwrite'),e=d.objectStore(this._storeName);return e.put(b,a),d.complete})}delete(a){return this._getDb().then((b)=>{const c=b.transaction(this._storeName,'readwrite'),d=c.objectStore(this._storeName);return d.delete(a),c.complete})}get(a){return this._getDb().then((b)=>b.transaction(this._storeName).objectStore(this._storeName).get(a))}getAllValues(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAll())}getAllKeys(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAllKeys())}}
|
||||
|
||||
const cacheBustParamName='_workbox-precaching';const version='v1';const dbName='workbox-precaching';const dbVersion='1';const dbStorename='asset-revisions';let tmpRevisionedCacheName=`workbox-precaching-revisioned-${version}`;self&&self.registration&&(tmpRevisionedCacheName+=`-${self.registration.scope}`);const defaultRevisionedCacheName=tmpRevisionedCacheName;
|
||||
|
||||
class RevisionDetailsModel{constructor(){this._idbHelper=new IDBHelper(dbName,dbVersion,dbStorename);}get(a){return this._idbHelper.get(a)}put(a,b){return this._idbHelper.put(a,b)}delete(a){return this._idbHelper.delete(a)}_close(){this._idbHelper.close();}}
|
||||
|
||||
class BaseCacheEntry{constructor({entryID:a,revision:b,request:c,cacheBust:d}){this.entryID=a,this.revision=b,this.request=c,this.cacheBust=d;}getNetworkRequest(){if(!0!==this.cacheBust)return this.request;let a=this.request.url;const b={};if(!0===this.cacheBust)if('cache'in Request.prototype)b.cache='reload';else{const b=new URL(a,location);b.search+=(b.search?'&':'')+encodeURIComponent(cacheBustParamName)+'='+encodeURIComponent(this.revision),a=b.toString();}return new Request(a,b)}}
|
||||
|
||||
class StringCacheEntry extends BaseCacheEntry{constructor(a){if(isType({url:a},'string'),0===a.length)throw new WorkboxError('invalid-string-entry',{url:a});super({entryID:a,revision:a,request:new Request(a),cacheBust:!1});}}
|
||||
|
||||
class ObjectCacheEntry extends BaseCacheEntry{constructor({entryID:a,revision:b,url:c,cacheBust:d}){if('undefined'!=typeof b&&(isType({revision:b},'string'),0===b.length))throw new WorkboxError('invalid-object-entry',{problemParam:'revision',problemValue:b});if('undefined'==typeof d&&(d=!!b),isType({cacheBust:d},'boolean'),isType({url:c},'string'),0===c.length)throw new WorkboxError('invalid-object-entry',{problemParam:'url',problemValue:c});if('undefined'==typeof a)a=new URL(c,location).toString();else if(0===a.length)throw new WorkboxError('invalid-object-entry',{problemParam:'entryID',problemValue:a});super({entryID:a,revision:b||c,request:new Request(c),cacheBust:d});}}
|
||||
|
||||
class RevisionedCacheManager extends BaseCacheManager{constructor(a={}){a.cacheName=a.cacheName||defaultRevisionedCacheName,super(a),this._revisionDetailsModel=new RevisionDetailsModel;}addToCacheList({revisionedFiles:a}={}){isInstance({revisionedFiles:a},Array),super._addEntries(a);const b=a.filter((a)=>'string'==typeof a||!a.revision);0<b.length&&logHelper.debug({that:this,message:`Some precache entries are URLs without separate revision
|
||||
fields. If the URLs themselves do not contain revisioning info,
|
||||
like a hash or a version number, your users won't receive updates.`,data:{"URLs without revision fields":JSON.stringify(b),"Examples of safe, versioned URLs":`'/path/file.abcd1234.css' or '/v1.0.0/file.js'`,"Examples of dangerous, unversioned URLs":`'index.html' or '/path/file.css' or '/latest/file.js'`}});}_parseEntry(a){if(null===a)throw new WorkboxError('unexpected-precache-entry',{input:a});let b;switch(typeof a){case'string':b=new StringCacheEntry(a);break;case'object':b=new ObjectCacheEntry(a);break;default:throw new WorkboxError('unexpected-precache-entry',{input:a});}return b}_onDuplicateInstallEntryFound(a,b){if(b.revision!==a.revision)throw new WorkboxError('duplicate-entry-diff-revisions',{firstEntry:{url:b.request.url,revision:b.revision},secondEntry:{url:a.request.url,revision:a.revision}})}_isAlreadyCached(a){var b=this;return asyncToGenerator(function*(){const c=yield b._revisionDetailsModel.get(a.entryID);if(c!==a.revision)return!1;const d=yield b._getCache(),e=yield d.match(a.request);return!!e})()}_onEntryCached(a){var b=this;return asyncToGenerator(function*(){yield b._revisionDetailsModel.put(a.entryID,a.revision);})()}_onEntryDeleted(a){var b=this;return asyncToGenerator(function*(){yield b._revisionDetailsModel.delete(a);})()}_close(){this._revisionDetailsModel._close();}cleanup(){return super.cleanup().then(()=>this._close())}_createLogFriendlyString(a){let b=`\n`;return a.forEach((a)=>{b+=` URL: '${a.url}' Revision: `+`'${a.revision}'\n`;}),b}install(){return super.install().then((a)=>{const b=[],c=[];a.forEach((a)=>{a.wasUpdated?b.push({url:a.url,revision:a.revision}):c.push({url:a.url,revision:a.revision});});const d={};return 0<b.length&&(d['New / Updated Precache URL\'s']=this._createLogFriendlyString(b)),0<c.length&&(d['Up-to-date Precache URL\'s']=this._createLogFriendlyString(c)),logHelper.log({message:`Precache Details: ${b.length} requests `+`were added or updated and `+`${c.length} request are already `+`cached and up-to-date.`,data:d}),a})}}
|
||||
|
||||
if(!isServiceWorkerGlobalScope())throw new WorkboxError('not-in-sw');
|
||||
|
||||
class WorkboxSW$1{constructor({cacheId:a,skipWaiting:b,clientsClaim:c,handleFetch:d=!0,directoryIndex:e='index.html',precacheChannelName:f='precache-updates',ignoreUrlParametersMatching:g=[/^utm_/]}={}){if(!isServiceWorkerGlobalScope())throw ErrorFactory.createError('not-in-sw');if(isDevBuild()&&(isLocalhost()?logHelper.debug({message:'Welcome to Workbox!',data:{"📖":'Read the guides and documentation\nhttps://workboxjs.org/',"❓":'Use the [workbox] tag on StackOverflow to ask questions\nhttps://stackoverflow.com/questions/ask?tags=workbox',"🐛":'Found a bug? Report it on GitHub\nhttps://github.com/GoogleChrome/workbox/issues/new'}}):logHelper.warn(`This appears to be a production server. Please switch
|
||||
to the smaller, optimized production build of Workbox.`)),a&&('string'!=typeof a||0===a.length))throw ErrorFactory.createError('bad-cache-id');if(b&&'boolean'!=typeof b)throw ErrorFactory.createError('bad-skip-waiting');if(c&&'boolean'!=typeof c)throw ErrorFactory.createError('bad-clients-claim');if('undefined'!=typeof e)if(!1===e||null===e)e=!1;else if('string'!=typeof e||0===e.length)throw ErrorFactory.createError('bad-directory-index');const h=[];f&&h.push(new BroadcastCacheUpdatePlugin({channelName:f,source:registration&®istration.scope?registration.scope:location})),this._runtimeCacheName=getDefaultCacheName({cacheId:a}),this._revisionedCacheManager=new RevisionedCacheManager({cacheId:a,plugins:h}),this._strategies=new Strategies({cacheId:a}),this._precacheRouter=new Router$$1(this._revisionedCacheManager.getCacheName()),this._router=new Router$$1(this._revisionedCacheManager.getCacheName()),d&&(this._precacheRouter.addFetchListener(),this._router.addFetchListener()),this._registerInstallActivateEvents(b,c),this._registerDefaultRoutes(g,e);}precache(a){if(!Array.isArray(a))throw ErrorFactory.createError('bad-revisioned-cache-list');this._revisionedCacheManager.addToCacheList({revisionedFiles:a});}get router(){return this._router}get strategies(){return this._strategies}get runtimeCacheName(){return this._runtimeCacheName}_registerInstallActivateEvents(a,b){self.addEventListener('install',(b)=>{const c=this._revisionedCacheManager.getCachedUrls();0<c.length&&logHelper.debug({that:this,message:`The precached URLs will automatically be served using a
|
||||
cache-first strategy.`,data:{"Precached URLs":JSON.stringify(c)}}),b.waitUntil(this._revisionedCacheManager.install().then(()=>{if(a)return self.skipWaiting()}));}),self.addEventListener('activate',(a)=>{a.waitUntil(this._revisionedCacheManager.cleanup().then(()=>{if(b)return self.clients.claim()}));});}_registerDefaultRoutes(a,b){const c=[];(a||b)&&c.push(this._getCacheMatchPlugin(a,b));const d=this.strategies.cacheFirst({cacheName:this._revisionedCacheManager.getCacheName(),plugins:c,excludeCacheId:!0});this._precacheRouter.registerRoute(({url:c})=>{c.hash='';const d=this._revisionedCacheManager.getCachedUrls();if(-1!==d.indexOf(c.href))return!0;let e=this._removeIgnoreUrlParams(c.href,a);return-1!==d.indexOf(e.href)||b&&e.pathname.endsWith('/')&&(e.pathname+=b,-1!==d.indexOf(e.href))},d);}_getCacheMatchPlugin(a,b){var c=this;const d=(()=>{var d=asyncToGenerator(function*({request:d,cache:e,cachedResponse:f,matchOptions:g}){if(f)return f;let h=c._removeIgnoreUrlParams(d.url,a);return e.match(h.toString(),g).then(function(a){return!a&&h.pathname.endsWith('/')?(h.pathname+=b,e.match(h.toString(),g)):a})});return function(){return d.apply(this,arguments)}})();return{cachedResponseWillBeUsed:d}}_removeIgnoreUrlParams(a,b){const c=new URL(a),d=c.search.slice(1),e=d.split('&'),f=e.map((a)=>a.split('=')),g=f.filter((a)=>b.every((b)=>!b.test(a[0]))),h=g.map((a)=>a.join('='));return c.search=h.join('&'),c}}
|
||||
|
||||
return WorkboxSW$1;
|
||||
|
||||
}());
|
||||
//# sourceMappingURL=workbox-sw.prod.v2.1.2.js.map
|
File diff suppressed because one or more lines are too long
777
docs/4.1/sw.js
777
docs/4.1/sw.js
@ -1,754 +1,29 @@
|
||||
/* global workbox:false */
|
||||
/* eslint-disable */
|
||||
|
||||
self.importScripts('/assets/js/vendor/workbox-sw.js')
|
||||
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
||||
// ++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
workbox.precaching.precacheAndRoute([
|
||||
{
|
||||
"url": "assets/brand/bootstrap-outline.svg",
|
||||
"revision": "9537646a9202cb5dca44e9034c1b414b"
|
||||
},
|
||||
{
|
||||
"url": "assets/brand/bootstrap-punchout.svg",
|
||||
"revision": "372e344ac243c4fa7c6c8b8a2af0e5ff"
|
||||
},
|
||||
{
|
||||
"url": "assets/brand/bootstrap-social-logo.png",
|
||||
"revision": "1e9e93d863b7811934889f9aac89c7de"
|
||||
},
|
||||
{
|
||||
"url": "assets/brand/bootstrap-social.png",
|
||||
"revision": "56be615bbca4502de5d55d721dae917f"
|
||||
},
|
||||
{
|
||||
"url": "assets/brand/bootstrap-solid.svg",
|
||||
"revision": "ea931a5b98a97e8b8658d9f6d537329e"
|
||||
},
|
||||
{
|
||||
"url": "assets/css/docs.min.css",
|
||||
"revision": "6e3cd62366e30b36d229cb7eb5c064ed"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/bootstrap-stack.png",
|
||||
"revision": "7384412324c769e447d3c4f86e9ff068"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/bootstrap-themes.png",
|
||||
"revision": "3976b58ff407451e8e8b598fdcde2cd2"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/android-chrome-192x192.png",
|
||||
"revision": "643718426d0a7d60036217ba988155be"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/android-chrome-512x512.png",
|
||||
"revision": "eb512e79165f504fd4da4d2758d5584b"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/apple-touch-icon.png",
|
||||
"revision": "042a7e9fdd293212aca19150aef71b0d"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/favicon-16x16.png",
|
||||
"revision": "50c62448d4014e5fb411887c05c2935b"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/favicon-32x32.png",
|
||||
"revision": "fed84e16b6ccfe88ee7ffaae5dfefd34"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/manifest.json",
|
||||
"revision": "eed73af41f4e55d335b5b3fa8c78538d"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/mstile-144x144.png",
|
||||
"revision": "84892991321e7998ca4c80ae21175f78"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/mstile-150x150.png",
|
||||
"revision": "61821c45a353e259bb83f9b0d338f5e8"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/mstile-310x150.png",
|
||||
"revision": "913e1b81006831c72a7bca38e4125edb"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/mstile-310x310.png",
|
||||
"revision": "29d79a7e648876504496211f003c4076"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/mstile-70x70.png",
|
||||
"revision": "386d71707992eb91fc53df303e99c2e7"
|
||||
},
|
||||
{
|
||||
"url": "assets/img/favicons/safari-pinned-tab.svg",
|
||||
"revision": "6b6b78894033fd91ce75affb548d8e67"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/docs.min.js",
|
||||
"revision": "9109c979ae60b0c5584b59ca6945d630"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/src/application.js",
|
||||
"revision": "83edc01382cfd889f982162964ec374e"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/src/ie-emulation-modes-warning.js",
|
||||
"revision": "c6e7032adf9bd98ac39e83c83108977b"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/src/pwa.js",
|
||||
"revision": "cac6034355863d6205e66862f6a729f7"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/src/search.js",
|
||||
"revision": "5b8bb2081b9e10ee9a469dd5feca5996"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/vendor/anchor.min.js",
|
||||
"revision": "01e6254e9f69c0c00f05060b0e1990fc"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/vendor/clipboard.min.js",
|
||||
"revision": "3f3688138a1b9fc4ef669ce9056b6674"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/vendor/holder.min.js",
|
||||
"revision": "6266d87979b32f717d298f7adf36984a"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/vendor/jquery-slim.min.js",
|
||||
"revision": "99b0a83cf1b0b1e2cb16041520e87641"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/vendor/popper.min.js",
|
||||
"revision": "83fb8c4d9199dce0224da0206423106f"
|
||||
},
|
||||
{
|
||||
"url": "assets/js/vendor/workbox-sw.js",
|
||||
"revision": "d41d8cd98f00b204e9800998ecf8427e"
|
||||
},
|
||||
{
|
||||
"url": "dist/css/bootstrap-grid.css",
|
||||
"revision": "db438cff680b6d0c029f75647b4b138a"
|
||||
},
|
||||
{
|
||||
"url": "dist/css/bootstrap-grid.min.css",
|
||||
"revision": "2206c9fb0197956129137af662b31115"
|
||||
},
|
||||
{
|
||||
"url": "dist/css/bootstrap-reboot.css",
|
||||
"revision": "cceed351e3a8401f573988a38e78d3a8"
|
||||
},
|
||||
{
|
||||
"url": "dist/css/bootstrap-reboot.min.css",
|
||||
"revision": "e2b23d34f3fcc9ce074c942e76f25d61"
|
||||
},
|
||||
{
|
||||
"url": "dist/css/bootstrap.css",
|
||||
"revision": "82252d754417f95f7779be349acc6361"
|
||||
},
|
||||
{
|
||||
"url": "dist/css/bootstrap.min.css",
|
||||
"revision": "a7022c6fa83d91db67738d6e3cd3252d"
|
||||
},
|
||||
{
|
||||
"url": "dist/js/bootstrap.bundle.js",
|
||||
"revision": "ee08eb7f44335a3cf385e03d4406e4a5"
|
||||
},
|
||||
{
|
||||
"url": "dist/js/bootstrap.bundle.min.js",
|
||||
"revision": "d70c474886678aebe3e9d91965dc8b62"
|
||||
},
|
||||
{
|
||||
"url": "dist/js/bootstrap.js",
|
||||
"revision": "c2cdb900858c3e63ce8cd9f69171d342"
|
||||
},
|
||||
{
|
||||
"url": "dist/js/bootstrap.min.js",
|
||||
"revision": "eb5fac582a82f296aeb74900b01a2fa3"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/about/brand/index.html",
|
||||
"revision": "da363abe2d31dead6009e6cabcf218e4"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/about/index.html",
|
||||
"revision": "21cd478d32480c820a6fe31906eef06d"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/about/license/index.html",
|
||||
"revision": "7458f731361d69e085d3631dfb20e4d9"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/about/overview/index.html",
|
||||
"revision": "ab77afaded6442e3d503f5a399698c59"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/about/translations/index.html",
|
||||
"revision": "070ffefa3c965013a256990075918b7d"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/browser-bugs/index.html",
|
||||
"revision": "ca363eeebf408a0af71bc30a4fdce92f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/alerts/index.html",
|
||||
"revision": "9ce6462d80d3f56b7eed0fdd70b8ed30"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/badge/index.html",
|
||||
"revision": "688237378dd152cf6dc8e251b589d25a"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/breadcrumb/index.html",
|
||||
"revision": "b9c06645080496c7ceefde94e8f40efa"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/button-group/index.html",
|
||||
"revision": "af1cb50d7abe6eefa019a67f7d66f2b0"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/buttons/index.html",
|
||||
"revision": "5cb2e19a4e918877ba94529217df85fb"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/card/index.html",
|
||||
"revision": "5c6317dc55e16caeb3acca80d10dc41b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/carousel/index.html",
|
||||
"revision": "272b1ccd06d335733568cda0957a56e5"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/collapse/index.html",
|
||||
"revision": "1a2ce5595bda4343efbd6f358627d9e9"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/dropdowns/index.html",
|
||||
"revision": "fb00e06439c66bae11a39b6c90143c13"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/forms/index.html",
|
||||
"revision": "2c70c60c66f6a755236b2fa2f7882ed9"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/index.html",
|
||||
"revision": "7030b612d83a1091f69bf96bd7ae78f8"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/input-group/index.html",
|
||||
"revision": "515b3174cac3d68cfdf75ba23ee608fc"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/jumbotron/index.html",
|
||||
"revision": "02176e3d196221dbf2bbfa96883c139a"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/list-group/index.html",
|
||||
"revision": "ea290fdf68db5cc08e1a99670a6186c7"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/modal/index.html",
|
||||
"revision": "4345babb0b732abaab295e3c5459c931"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/navbar/index.html",
|
||||
"revision": "091326032dfce11e8f56f364dec6ccd2"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/navs/index.html",
|
||||
"revision": "a2deab071c38ba8d88d90b5e65838dc9"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/pagination/index.html",
|
||||
"revision": "0e42703fd66a56493a99f924003dc75b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/popovers/index.html",
|
||||
"revision": "3456fc293b4d83d0924cc9f557233a2d"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/progress/index.html",
|
||||
"revision": "b321bf986421fca3339e96f6b5e14840"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/scrollspy/index.html",
|
||||
"revision": "382dd101252603ead6d11ec54ee42cb7"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/components/tooltips/index.html",
|
||||
"revision": "e484891eeede824d1ff667056a73929b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/content/code/index.html",
|
||||
"revision": "1d8e97be5baf2b8d2c1eadb84b7d545b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/content/figures/index.html",
|
||||
"revision": "baa4685aafcac84e12e3feff8b59713c"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/content/images/index.html",
|
||||
"revision": "f3ebd0e6e5f96ec46e11d68a2f65989b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/content/index.html",
|
||||
"revision": "95fb085074b4d33f820664987ebb086f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/content/reboot/index.html",
|
||||
"revision": "f11cb84f29deea8b9d582d472284e988"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/content/tables/index.html",
|
||||
"revision": "055743791dd522df832af124072ca9f5"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/content/typography/index.html",
|
||||
"revision": "69411358fc1b3f78dde85cf52f20b9ef"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/album/album.css",
|
||||
"revision": "e8343131a0fefafe6ae0f37db6d10f3c"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/album/index.html",
|
||||
"revision": "8088e1d95bc9263681886821a80f5bcc"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/blog/blog.css",
|
||||
"revision": "095c85e484178b56ad0446775869e628"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/blog/index.html",
|
||||
"revision": "c1d0cf090944a6369dcfeaeebbf73eff"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/carousel/carousel.css",
|
||||
"revision": "e1ef0ffa84cc98db13f90dd02b9981e7"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/carousel/index.html",
|
||||
"revision": "b60a1b9d8a622551914f1869d2070ca6"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/checkout/form-validation.css",
|
||||
"revision": "d13d35a0c04021ceacd8c153719860bc"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/checkout/index.html",
|
||||
"revision": "79021acecd4d9e2e84e26cf84153153b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/cover/cover.css",
|
||||
"revision": "211daf4eee015cb38fb10893c4645bbb"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/cover/index.html",
|
||||
"revision": "3c6d961d4b1d583a8cf972d66d6b8171"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/dashboard/dashboard.css",
|
||||
"revision": "419f2b36ccf58f5cb1b5b557658b65dd"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/dashboard/index.html",
|
||||
"revision": "de15dff920a3aebbb324d257985e4ba8"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/floating-labels/floating-labels.css",
|
||||
"revision": "0711f793d4f6bc20572f9b357c061b5b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/floating-labels/index.html",
|
||||
"revision": "e16e25d95c2a41f6d3d8ff7b94b82936"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/grid/grid.css",
|
||||
"revision": "4cd2e5cc5e19dc692d50ed6f077154ef"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/grid/index.html",
|
||||
"revision": "1a634e4a3281204f8d46c5fdaea35a96"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/index.html",
|
||||
"revision": "2671cd58f90fc28581031d51e44a7b4d"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/jumbotron/index.html",
|
||||
"revision": "187a48844da8e19e0765d417a5077f81"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/jumbotron/jumbotron.css",
|
||||
"revision": "0ef7edc6babea5a47645bda0c45368aa"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/navbar-bottom/index.html",
|
||||
"revision": "dd165c45857a4239ce7787aea5a7bff5"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/navbar-fixed/index.html",
|
||||
"revision": "1178a7c1f06eeeea76176173b2e0d7fd"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/navbar-fixed/navbar-top-fixed.css",
|
||||
"revision": "3d46ddff119cfe2886a34b72aefd42a6"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/navbar-static/index.html",
|
||||
"revision": "8f818f7c1ab4e90bf1ea9b0bd0adb5b3"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/navbar-static/navbar-top.css",
|
||||
"revision": "ae704085e05c4bc6a705b225b03a5aea"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/navbars/index.html",
|
||||
"revision": "84494d9562fd4bfb7a613cde029e839f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/navbars/navbar.css",
|
||||
"revision": "f95ea8bb033949bba31b05925773e223"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/offcanvas/index.html",
|
||||
"revision": "7543497ce75575f523a11efb856b54e8"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/offcanvas/offcanvas.css",
|
||||
"revision": "b5d28d8db34c23de78c46784c4ba4331"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/offcanvas/offcanvas.js",
|
||||
"revision": "5c0edf2d5a4d88ec65e801c0f58ef23a"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/pricing/index.html",
|
||||
"revision": "418289199fbd0b6749424611483058fd"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/pricing/pricing.css",
|
||||
"revision": "1e170831b26afb7a6bcde4f0bc2cb29b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/product/index.html",
|
||||
"revision": "7424fe35dc94c1190849c8627cc33ef0"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/product/product.css",
|
||||
"revision": "9db57bf56394ba8cd85abd5f7ebc8ef1"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/album.png",
|
||||
"revision": "685d5277fdf6f04aefbcbe01ba93e9ef"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/blog.png",
|
||||
"revision": "d06dc15ae8285908ec7ba9f4b1f98a44"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/carousel.png",
|
||||
"revision": "dc04e087b8ad4f000fa64e266812fc0f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/checkout.png",
|
||||
"revision": "030255900e0b73653cf6a2d074f17b31"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/cover.png",
|
||||
"revision": "ece97a4eb488c46a86a67d61db25dda2"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/dashboard.png",
|
||||
"revision": "2fc93187d09b5b8c342b962576eaf39e"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/floating-labels.png",
|
||||
"revision": "fae0436f9d026a67778f3a37d29b3dfc"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/grid.png",
|
||||
"revision": "cb63b8b5fd89749a2d87342876306dd8"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/jumbotron.png",
|
||||
"revision": "0f579cb67e8c8535d8fffef7d17b7e45"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/navbar-bottom.png",
|
||||
"revision": "0cefd6caed82af75be57d758633d9094"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/navbar-fixed.png",
|
||||
"revision": "1d38f157f0bbbd90957044d30eaef242"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/navbar-static.png",
|
||||
"revision": "2ff01be7ee251fc5c7f51ccf9de5f48d"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/navbars.png",
|
||||
"revision": "d4fbce8e1e38d78a5134e6be05cdd4d7"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/offcanvas.png",
|
||||
"revision": "c581d49a56f3e9d0d1753195c62e719a"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/pricing.png",
|
||||
"revision": "e33e2f37741c6d15c99f3378e2e551ea"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/product.png",
|
||||
"revision": "af74e4f7ddfc8cf2a44a9c601881329f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/sign-in.png",
|
||||
"revision": "9e4bf345a8c21403868f70b777efb483"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/starter-template.png",
|
||||
"revision": "1761d4e831e7c0659962e1abdb95421f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/sticky-footer-navbar.png",
|
||||
"revision": "428112965cf6826db55bcc6db07d9e5f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/screenshots/sticky-footer.png",
|
||||
"revision": "59b69c34997abee3d477f836d44ce8a3"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/sign-in/index.html",
|
||||
"revision": "0739de40d4fb2333772503ff6a475b18"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/sign-in/signin.css",
|
||||
"revision": "00e205f17ee0cd3f59d5e1e1e9cf3b3f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/starter-template/index.html",
|
||||
"revision": "d405e899854462588983ff1b304f7d0d"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/starter-template/starter-template.css",
|
||||
"revision": "8cb4aab3660723b641b6458f1a1d3ab1"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/sticky-footer-navbar/index.html",
|
||||
"revision": "cf52f64c92b9c1fae606d610fe2d2116"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/sticky-footer-navbar/sticky-footer-navbar.css",
|
||||
"revision": "c5c610f36d8c2a89e7d587880ee0cd68"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/sticky-footer/index.html",
|
||||
"revision": "7f8a7abbce45fa7d948f8fe3a41c3545"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/sticky-footer/sticky-footer.css",
|
||||
"revision": "09630d01995ef9c0f8fc9ae622f00466"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/tooltip-viewport/index.html",
|
||||
"revision": "b1074cded6dd5b3603fd470151af233e"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/tooltip-viewport/tooltip-viewport.css",
|
||||
"revision": "59ee4352f399bfe798346b4be4a5f88f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/examples/tooltip-viewport/tooltip-viewport.js",
|
||||
"revision": "8b7dceb6d175f264b789114201387bfa"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/extend/approach/index.html",
|
||||
"revision": "2fef962857db7b670e3ffb4fb2b3a3a5"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/extend/icons/index.html",
|
||||
"revision": "0a56f43c235108e3b8eae158177d7cdb"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/extend/index.html",
|
||||
"revision": "b5be504b373801faafeb0b790f2fa5ed"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/accessibility/index.html",
|
||||
"revision": "007846f682083aaa4e65c1119928a3bf"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/best-practices/index.html",
|
||||
"revision": "86da449cc171aca7811ccda09ccc420e"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/browsers-devices/index.html",
|
||||
"revision": "e044f9a3c2013a9fd8de0c6a25d2069b"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/build-tools/index.html",
|
||||
"revision": "06de1ab9e73c16cec63dd279802b3a35"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/contents/index.html",
|
||||
"revision": "17022f2c9c3e8c4d7ac4605c4e52146c"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/download/index.html",
|
||||
"revision": "20d30ce7e827dd44a267aadb12aa9f64"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/index.html",
|
||||
"revision": "811a42680ff2cbe5a4565ba8571b2f13"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/introduction/index.html",
|
||||
"revision": "4e34ead69e2e1aab6a26ba44671bece2"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/javascript/index.html",
|
||||
"revision": "360208d6c37e1eb359cdc1851022aa84"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/options/index.html",
|
||||
"revision": "6f7266cc764421fcde9b6958a8e2c0e4"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/theming/index.html",
|
||||
"revision": "1e208003966788093ac06a30d0007b34"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/getting-started/webpack/index.html",
|
||||
"revision": "cdd95c974c85b397ce3510fb538468f0"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/history/index.html",
|
||||
"revision": "21cd478d32480c820a6fe31906eef06d"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/index.html",
|
||||
"revision": "811a42680ff2cbe5a4565ba8571b2f13"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/layout/grid/index.html",
|
||||
"revision": "a5bd9b6a1027e9d4542251062bb0baa6"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/layout/index.html",
|
||||
"revision": "aaf8e1eed995085072062a503c910188"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/layout/media-object/index.html",
|
||||
"revision": "c140fcacd3589e0662587504754a3197"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/layout/overview/index.html",
|
||||
"revision": "fce3a2773e4e107a61b82e4c1f2e40f6"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/layout/utilities-for-layout/index.html",
|
||||
"revision": "7d74b593e28970aee475a5d626f1f3e1"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/migration/index.html",
|
||||
"revision": "d35fb579e8ec304cf8fe92bedd12aa4c"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/team/index.html",
|
||||
"revision": "21cd478d32480c820a6fe31906eef06d"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/borders/index.html",
|
||||
"revision": "c3adffc35fc4c15ce39a9d918c7d2b88"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/clearfix/index.html",
|
||||
"revision": "a67d1e4018e33f94561fb320af69e04f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/close-icon/index.html",
|
||||
"revision": "5871021e0e92137774de05be8dd7345e"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/colors/index.html",
|
||||
"revision": "975a8d9999d66f38d8c812e9545df715"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/display/index.html",
|
||||
"revision": "eebe9ffe5125359b45c389914ebeca4a"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/embed/index.html",
|
||||
"revision": "615d322fdd313950c2443640b21e692f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/flex/index.html",
|
||||
"revision": "56677b9a6185166b6f2807b36239e605"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/float/index.html",
|
||||
"revision": "336a436baabf93150175506898252a4a"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/image-replacement/index.html",
|
||||
"revision": "922ebd8f02a2f5267a29658a6fb1ce7a"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/index.html",
|
||||
"revision": "6c11a259f899c261fc50fdb6244aa6ce"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/position/index.html",
|
||||
"revision": "9e3af44a33b5d6ae617375c19bedb1c5"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/screenreaders/index.html",
|
||||
"revision": "b6af234512b5cc8fe343c87133844fb3"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/shadows/index.html",
|
||||
"revision": "a85a8cf2306f0653add17d4472893a52"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/sizing/index.html",
|
||||
"revision": "e822f546f0b4790e60189b13139a914e"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/spacing/index.html",
|
||||
"revision": "08f891a83b2d3694804f44ebed245b89"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/text/index.html",
|
||||
"revision": "e7a83ca4a0cbb0745c71bbe2de0a866f"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/vertical-align/index.html",
|
||||
"revision": "9ca821f6f013cc7c99983755a53d24f8"
|
||||
},
|
||||
{
|
||||
"url": "docs/4.1/utilities/visibility/index.html",
|
||||
"revision": "7e88317e8a53b2c3d76e9ff072eb389a"
|
||||
},
|
||||
{
|
||||
"url": "docs/getting-started/index.html",
|
||||
"revision": "811a42680ff2cbe5a4565ba8571b2f13"
|
||||
},
|
||||
{
|
||||
"url": "docs/index.html",
|
||||
"revision": "811a42680ff2cbe5a4565ba8571b2f13"
|
||||
},
|
||||
{
|
||||
"url": "examples/index.html",
|
||||
"revision": "f42d00b3e5074e91c48a7258b468a3ba"
|
||||
},
|
||||
{
|
||||
"url": "index.html",
|
||||
"revision": "9b972f782908d36757d09c1a2cf7d7c8"
|
||||
},
|
||||
{
|
||||
"url": "redirects.json",
|
||||
"revision": "ff6e3f0da9bd52ce20975be0b056d464"
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function () {
|
||||
navigator.serviceWorker.getRegistrations().then(function (registrations) {
|
||||
for (var registration of registrations) {
|
||||
registration.unregister()
|
||||
.then(function () {
|
||||
return self.clients.matchAll()
|
||||
})
|
||||
.then(function (clients) {
|
||||
clients.forEach(function (client) {
|
||||
if (client.url && 'navigate' in client) {
|
||||
client.navigate(client.url)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
])
|
||||
}())
|
||||
|
Loading…
x
Reference in New Issue
Block a user