This repository has been archived by the owner on Dec 3, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
service-worker.js
1 lines (1 loc) · 5.81 KB
/
service-worker.js
1
"use strict";function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}var precacheConfig=[["index.html","421f2e06cdb8b7938eee99d63699d821"],["static/js/main.f7809dad.js","ea753135d43fa1755f927a32b2b17b48"],["static/media/1.b014063d.jpg","b014063d99bd6a9dd135f016f936a0ef"],["static/media/amit.430ca651.jpg","430ca65113ceca4c218ef80c94d90008"],["static/media/bbc.ca39ba89.svg","ca39ba890c4ca677ea0656f5c2d80ce9"],["static/media/bex.5b6e82e4.jpg","5b6e82e451d8110f8d06e8373140316b"],["static/media/claudia.1143c7b8.jpg","1143c7b8ca0c86f7182f3cce10feaa8e"],["static/media/code.f4e20b73.svg","f4e20b73abfe0ea08e46e676d4f38b15"],["static/media/conference-hall.8477d977.svg","8477d977ad10819b704488c453a84779"],["static/media/coop.713af1b3.png","713af1b3393610f3bd70614ebac04626"],["static/media/cyf_brand.fbcea877.png","fbcea87769f4ae6b776d2d54778f5348"],["static/media/email-icon.14b25ceb.svg","14b25cebab1202a341ab9551d9279607"],["static/media/fb_logo.556ec1eb.svg","556ec1eb0284493e4f324ad5a1b392c5"],["static/media/geckoboard.964aa89b.png","964aa89b2b6a1bc5ff2f25e0d3e23c79"],["static/media/german.47f11405.jpg","47f114056652404860bbdf2422b3493f"],["static/media/github.cefc2023.png","cefc20232703e5e3c24efd5f50d75e26"],["static/media/index.18e9058c.scss","18e9058c0f35c1afc3bc691921c0a646"],["static/media/james.4eadcacb.png","4eadcacb88fb5afec6efc53e63bf4b2c"],["static/media/kash.16e0f0bf.jpg","16e0f0bf19a00e8f2191b3cd83b39768"],["static/media/kinningparkcomplex.d1d7cec8.png","d1d7cec82b49b95e45d6422773d237b8"],["static/media/laptop.f8a8df6e.svg","f8a8df6e52a14b6655f07a03f64589fe"],["static/media/linkedin-logo.bbf7ff60.svg","bbf7ff60cb9f648211f7c81143f5d282"],["static/media/loading.c5590569.svg","c5590569aab553af03722baa7d379978"],["static/media/mentors-group.efb176cd.jpg","efb176cd923d15c44b27845d1cf78927"],["static/media/mozafar.65181414.jpg","65181414524b9d9acd8809ce27af487b"],["static/media/nate.44a9ba3d.jpg","44a9ba3d37a5897e921d09032b94d7ab"],["static/media/nodejs.949ce556.svg","949ce5565428bde4bc1172d8889a3f96"],["static/media/pipedrive.7accd6d4.png","7accd6d44c8665cb946f1efc19fa971b"],["static/media/react.a0a9cca5.svg","a0a9cca52f068d869729ec5e5e9852a2"],["static/media/refugees-deeply.dee1af6a.jpeg","dee1af6a7b3949dd1cb7566512939e6f"],["static/media/rob.58166c3f.jpg","58166c3f12564d776b0b08d430e286b3"],["static/media/simon.718b6348.jpg","718b63487df5df225c80d7800a36dbfa"],["static/media/skyscanner.26d3455e.svg","26d3455e90b53a9f65a44eea478e060b"],["static/media/slack.5c07c2ac.png","5c07c2ac14ebdcc9c786fe2687bd32d9"],["static/media/students-group.8468710f.jpg","8468710fde75e7a5d42dd2beb7f9f027"],["static/media/tablet.d8d83b38.svg","d8d83b382311b054302d53aeb9f9e80b"],["static/media/ticketmaster.4e3e2ba6.png","4e3e2ba61678958d175cabd16a5b3350"],["static/media/twitter-silhouette.c79710d5.svg","c79710d5dc1360490b88d9f1b2cae8ac"],["static/media/unhcr.e406f503.png","e406f503e0c2bb13202c37bab5814c99"],["static/media/will.97e2c509.jpg","97e2c509fc9fa4331f66b83eda1a7a84"],["static/media/wired.b5a6ae90.svg","b5a6ae90404095ae3481395feb2afa09"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,a){var t=new URL(e);return"/"===t.pathname.slice(-1)&&(t.pathname+=a),t.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(a){return new Response(a,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,a,t,c){var n=new URL(e);return c&&n.pathname.match(c)||(n.search+=(n.search?"&":"")+encodeURIComponent(a)+"="+encodeURIComponent(t)),n.toString()},isPathWhitelisted=function(e,a){if(0===e.length)return!0;var t=new URL(a).pathname;return e.some(function(e){return t.match(e)})},stripIgnoredUrlParameters=function(e,a){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return a.every(function(a){return!a.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var a=e[0],t=e[1],c=new URL(a,self.location),n=createCacheKey(c,hashParamName,t,/\.\w{8}\./);return[c.toString(),n]}));self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(a){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!a.has(t)){var c=new Request(t,{credentials:"same-origin"});return fetch(c).then(function(a){if(!a.ok)throw new Error("Request for "+t+" returned a response with status "+a.status);return cleanResponse(a).then(function(a){return e.put(t,a)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var a=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(t){return Promise.all(t.map(function(t){if(!a.has(t.url))return e.delete(t)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var a,t=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);a=urlsToCacheKeys.has(t);a||(t=addDirectoryIndex(t,"index.html"),a=urlsToCacheKeys.has(t));!a&&"navigate"===e.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],e.request.url)&&(t=new URL("/index.html",self.location).toString(),a=urlsToCacheKeys.has(t)),a&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(t)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(a){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,a),fetch(e.request)}))}});