-
Notifications
You must be signed in to change notification settings - Fork 0
/
service-worker.js
1 lines (1 loc) · 4.57 KB
/
service-worker.js
1
"use strict";var precacheConfig=[["/index.html","ace0da9cba07cf0efaf0395d73656b7c"],["/static/css/main.d467862c.css","3efdfb8f98f9d14df198ab455fb4f641"],["/static/js/main.8dd156a1.js","017c74c96485175500e346a08e875c83"],["/static/media/PlayfairDisplay-Regular.13370fa0.woff","13370fa057fac5b99bd1e5dfe97e553e"],["/static/media/PlayfairDisplay-Regular.f914c825.woff2","f914c825aa412d8a96b55e07fdc3f37e"],["/static/media/Roboto-Bold.08cb8f79.woff","08cb8f79715774f9a6285ee7db2919a3"],["/static/media/Roboto-Bold.f3a02e25.woff2","f3a02e2578bee50e620e515912278bc9"],["/static/media/Roboto-Light.10ad0f86.woff","10ad0f861c0c5807734017c341940649"],["/static/media/Roboto-Light.ed4b08d2.woff2","ed4b08d2702fa26acc324ef1e89ae837"],["/static/media/Roboto-Regular.94dac78e.woff","94dac78eee406a8c8f0406b69b85ac2b"],["/static/media/Roboto-Regular.9feb0110.woff2","9feb0110b6dff9ee2b9ebd17f7a1aee6"],["/static/media/Roboto-Thin.46888f27.woff2","46888f279ddb7baaf89772dec4c8e893"],["/static/media/Roboto-Thin.f09d9b5e.woff","f09d9b5e8e8a5f3843c1f0fa161fa23c"],["/static/media/exposure.9ee78f83.jpg","9ee78f83d12547dbf7bdfef3dc33dc93"],["/static/media/icomoon.08744720.svg","087447200118d8fc1aaaa675843b5de6"],["/static/media/icomoon.47991f37.woff","47991f37242722a58c9a974bf16de1e0"],["/static/media/icomoon.6a19ab3a.eot","6a19ab3a52d7d36a0fdcac89c93a19b9"],["/static/media/icomoon.f1bc049c.ttf","f1bc049c869df004eaabcaaa56a067e3"],["/static/media/panoramic-journey.359b93b5.jpg","359b93b50c0c4b4604c9cd85eef5ecef"],["/static/media/penderyn-store.4baaa1e2.jpg","4baaa1e2c20d10852ad757a2ac84e4a0"],["/static/media/sky-fortitude.dab9affe.jpg","dab9affec5f21fe6fc75bab715e3e54a"],["/static/media/sonovate.a2a5dc25.jpg","a2a5dc25ed7196c9eef875b51af80a6e"]],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(a){return a.redirected?("body"in a?Promise.resolve(a.body):a.blob()).then(function(e){return new Response(e,{headers:a.headers,status:a.status,statusText:a.statusText})}):Promise.resolve(a)},createCacheKey=function(e,a,t,n){var c=new URL(e);return n&&c.pathname.match(n)||(c.search+=(c.search?"&":"")+encodeURIComponent(a)+"="+encodeURIComponent(t)),c.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,t){var a=new URL(e);return a.hash="",a.search=a.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(a){return t.every(function(e){return!e.test(a[0])})}).map(function(e){return e.join("=")}).join("&"),a.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var a=e[0],t=e[1],n=new URL(a,self.location),c=createCacheKey(n,hashParamName,t,/\.\w{8}\./);return[n.toString(),c]}));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(n){return setOfCachedUrls(n).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(a){if(!t.has(a)){var e=new Request(a,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+a+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return n.put(a,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(a){return a.keys().then(function(e){return Promise.all(e.map(function(e){if(!t.has(e.url))return a.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(a){if("GET"===a.request.method){var e,t=stripIgnoredUrlParameters(a.request.url,ignoreUrlParametersMatching),n="index.html";(e=urlsToCacheKeys.has(t))||(t=addDirectoryIndex(t,n),e=urlsToCacheKeys.has(t));var c="/index.html";!e&&"navigate"===a.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],a.request.url)&&(t=new URL(c,self.location).toString(),e=urlsToCacheKeys.has(t)),e&&a.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(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',a.request.url,e),fetch(a.request)}))}});