-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathservice-worker.js
1 lines (1 loc) · 3.92 KB
/
service-worker.js
1
"use strict";var precacheConfig=[["index.html","95f681745614549d728a88bc644337c9"],["service-worker.js","8883b950c54c83aa241ff49802c22e34"],["static/css/app.b8a8cf36ef8c09d6d081f14d1330f6c4.css","34db0d442191891d378a6023a7947e5f"],["static/js/0.6d69c6b4c070bb18956b.js","4b8a0df0cf7d76a6549c71cc6faa850a"],["static/js/1.cc67e5baa92d4ba4965d.js","f0a6473de357e4fcb617ae15c744112d"],["static/js/2.e23e46cbce493d8f3af6.js","8857d594bbd5cb593c81cf0b0b5f2798"],["static/js/3.6ada9b8e92226d3cac4f.js","aaf1a4c2ab144dc5c7f70819c3238a28"],["static/js/4.f592fe62a2eaad6d2ac5.js","62f8580ea78054769192104323d4be45"],["static/js/5.1b49e5d09b98caeefa54.js","7da5c84f2873785633089d5c7d407f12"],["static/js/6.f32b593b9f5a2b6734b7.js","5a15eaa2769d4548ce858d0b8993d15e"],["static/js/7.710cde65f82a2e13a3d6.js","db4b5d02eda8a1dfb443a26ba7120307"],["static/js/8.b77df42fb67a83847594.js","dce3d15cf9605f2d6e4380114eeb39fa"],["static/js/9.0393a6eb70c9a73e2732.js","989f262b4c5e079bc64adb6d1760168a"],["static/js/app.5c02779c3a193da096b5.js","d7333d9851de676c874de4d86fd6b1ff"],["static/js/manifest.d0b89c5dc81b43f876cc.js","3a5fb2aa02981577711f29dfb764bf15"],["static/js/vendor.4d1fd4b2d6c3ae7caca9.js","09d1f1d5d142f0a6170ce7c8faeaa95d"],["static/sw.js","d41d8cd98f00b204e9800998ecf8427e"]],cacheName="sw-precache-v3-one-music-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var a=new URL(e);return"/"===a.pathname.slice(-1)&&(a.pathname+=t),a.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,a,n){var c=new URL(e);return n&&c.pathname.match(n)||(c.search+=(c.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(a)),c.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var a=new URL(t).pathname;return e.some(function(e){return a.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(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),a.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],a=e[1],n=new URL(t,self.location),c=createCacheKey(n,hashParamName,a,!1);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(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(a){if(!t.has(a)){var n=new Request(a,{credentials:"same-origin"});return fetch(n).then(function(t){if(!t.ok)throw new Error("Request for "+a+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(a,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(a){return Promise.all(a.map(function(a){if(!t.has(a.url))return e.delete(a)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,a=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);(t=urlsToCacheKeys.has(a))||(a=addDirectoryIndex(a,"index.html"),t=urlsToCacheKeys.has(a));0,t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(a)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}});