-
Notifications
You must be signed in to change notification settings - Fork 0
/
service-worker.js
1 lines (1 loc) · 4 KB
/
service-worker.js
1
"use strict";var precacheConfig=[["/index.html","d74c8db2b4cdb293ca90d59c03f2a784"],["/static/css/main.c17080f1.css","302476b8b379a677f648aa1e48918ebd"],["/static/js/main.40429f06.js","e71851755f899a557e9bc1145b46d7eb"],["/static/media/back_ground_jessye.669d6eac.jpg","669d6eac009cc09d1d8e7ae72aae2a8b"],["/static/media/back_ground_jessye_small.e3e418f6.png","e3e418f6a847501f8dd5f25992ea87a2"],["/static/media/back_ground_music.ba723b62.jpg","ba723b62512008816de17bcae90984fb"],["/static/media/back_ground_music_small.c55f9ce9.png","c55f9ce9654f92053491845257bde6c4"],["/static/media/back_ground_painting.f07c54c4.jpg","f07c54c46439bfe7bc8cf6df56502ff9"],["/static/media/back_ground_painting_small.994bfdcb.png","994bfdcba6e77aeffa127bdb7e46cf39"],["/static/media/back_ground_winter.ec485e42.jpg","ec485e42fe64329e4508ccda7c111d29"],["/static/media/back_ground_winter_small.97061b72.png","97061b72736a11f8e570050ea34cabef"],["/static/media/pointing_up.d3404ce5.png","d3404ce57ba5d1d35f464596b2e5c274"],["/static/media/resume.20d6c26d.pdf","20d6c26ddd79613f4b78f66eb9d99546"],["/static/media/right_pointer.99e3698a.png","99e3698a27bdfaac7f1d7740d88ac5e3"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,n,a){var r=new URL(e);return a&&r.pathname.match(a)||(r.search+=(r.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),r.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,n){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return n.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],a=new URL(t,self.location),r=createCacheKey(a,hashParamName,n,/\.\w{8}\./);return[a.toString(),r]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(a){return setOfCachedUrls(a).then(function(n){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!n.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return a.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var n=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!n.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,n=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),a="index.html";(e=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,a),e=urlsToCacheKeys.has(n));var r="/index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(n=new URL(r,self.location).toString(),e=urlsToCacheKeys.has(n)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}});