-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsw.js
More file actions
2 lines (2 loc) · 46 KB
/
sw.js
File metadata and controls
2 lines (2 loc) · 46 KB
1
2
!function(){"use strict";var e,t,a,s;let n,r,i,o,c,l,h;let u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"serwist",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},d=e=>[u.prefix,e,u.suffix].filter(e=>e&&e.length>0).join("-"),f=e=>{for(let t of Object.keys(u))e(t)},p={updateDetails:e=>{f(t=>{let a=e[t];"string"==typeof a&&(u[t]=a)})},getGoogleAnalyticsName:e=>e||d(u.googleAnalytics),getPrecacheName:e=>e||d(u.precache),getPrefix:()=>u.prefix,getRuntimeName:e=>e||d(u.runtime),getSuffix:()=>u.suffix},m=(e,...t)=>{let a=e;return t.length>0&&(a+=` :: ${JSON.stringify(t)}`),a};class g extends Error{details;constructor(e,t){super(m(e,t)),this.name=e,this.details=t}}let w=new Set;async function y(e,t){let a=null;if(e.url&&(a=new URL(e.url).origin),a!==self.location.origin)throw new g("cross-origin-copy-response",{origin:a});let s=e.clone(),r={headers:new Headers(s.headers),status:s.status,statusText:s.statusText},i=t?t(r):r,o=!function(){if(void 0===n){let e=new Response("");if("body"in e)try{new Response(e.body),n=!0}catch(e){n=!1}n=!1}return n}()?await s.blob():s.body;return new Response(o,i)}class _{promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}function b(e,t){let a=new URL(e);for(let e of t)a.searchParams.delete(e);return a.href}async function v(e,t,a,s){let n=b(t.url,a);if(t.url===n)return e.match(t,s);let r={...s,ignoreSearch:!0};for(let i of(await e.keys(t,r)))if(n===b(i.url,a))return e.match(i,s)}function x(e){e.then(()=>{})}async function E(){for(let e of w)await e()}let R=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),"");function D(e){return new Promise(t=>setTimeout(t,e))}async function S(e){let t;if(!e)return;let a=await self.clients.matchAll({type:"window"}),s=new Set(a.map(e=>e.id)),n=performance.now();for(;performance.now()-n<2e3&&!(t=(a=await self.clients.matchAll({type:"window"})).find(t=>e?t.id===e:!s.has(t.id)));)await D(100);return t}function C(e,t){let a=t();return e.waitUntil(a),a}let q=(e,t)=>t.some(t=>e instanceof t),N=new WeakMap,k=new WeakMap,P=new WeakMap,I={get(e,t,a){if(e instanceof IDBTransaction){if("done"===t)return N.get(e);if("store"===t)return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return L(e[t])},set:(e,t,a)=>(e[t]=a,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function L(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("success",n),e.removeEventListener("error",r)},n=()=>{t(L(e.result)),s()},r=()=>{a(e.error),s()};e.addEventListener("success",n),e.addEventListener("error",r)});return P.set(t,e),t}(e);if(k.has(e))return k.get(e);let a="function"==typeof(t=e)?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(T(this),e),L(this.request)}:function(...e){return L(t.apply(T(this),e))}:(t instanceof IDBTransaction&&function(e){if(N.has(e))return;let t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("complete",n),e.removeEventListener("error",r),e.removeEventListener("abort",r)},n=()=>{t(),s()},r=()=>{a(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",n),e.addEventListener("error",r),e.addEventListener("abort",r)});N.set(e,t)}(t),q(t,r||(r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,I):t;return a!==e&&(k.set(e,a),P.set(a,e)),a}let T=e=>P.get(e),A=["get","getKey","getAll","getAllKeys","count"],U=["put","add","delete","clear"],B=new Map;function F(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(B.get(t))return B.get(t);let a=t.replace(/FromIndex$/,""),s=t!==a,n=U.includes(a);if(!(a in(s?IDBIndex:IDBObjectStore).prototype)||!(n||A.includes(a)))return;let r=async function(e,...t){let r=this.transaction(e,n?"readwrite":"readonly"),i=r.store;return s&&(i=i.index(t.shift())),(await Promise.all([i[a](...t),n&&r.done]))[0]};return B.set(t,r),r}I={...e=I,get:(t,a,s)=>F(t,a)||e.get(t,a,s),has:(t,a)=>!!F(t,a)||e.has(t,a)};let M=["continue","continuePrimaryKey","advance"],W={},O=new WeakMap,K=new WeakMap,j={get(e,t){if(!M.includes(t))return e[t];let a=W[t];return a||(a=W[t]=function(...e){O.set(this,K.get(this)[t](...e))}),a}};async function*$(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let a=new Proxy(t,j);for(K.set(a,t),P.set(a,T(t));t;)yield a,t=await (O.get(a)||t.continue()),O.delete(a)}function H(e,t){return t===Symbol.asyncIterator&&q(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&q(e,[IDBIndex,IDBObjectStore])}I={...t=I,get:(e,a,s)=>H(e,a)?$:t.get(e,a,s),has:(e,a)=>H(e,a)||t.has(e,a)};let V="requests",G="queueName";class Q{_db=null;async addEntry(e){let t=(await this.getDb()).transaction(V,"readwrite",{durability:"relaxed"});await t.store.add(e),await t.done}async getFirstEntryId(){let e=await this.getDb(),t=await e.transaction(V).store.openCursor();return t?.value.id}async getAllEntriesByQueueName(e){let t=await this.getDb();return await t.getAllFromIndex(V,G,IDBKeyRange.only(e))||[]}async getEntryCountByQueueName(e){return(await this.getDb()).countFromIndex(V,G,IDBKeyRange.only(e))}async deleteEntry(e){let t=await this.getDb();await t.delete(V,e)}async getFirstEntryByQueueName(e){return await this.getEndEntryFromIndex(IDBKeyRange.only(e),"next")}async getLastEntryByQueueName(e){return await this.getEndEntryFromIndex(IDBKeyRange.only(e),"prev")}async getEndEntryFromIndex(e,t){let a=await this.getDb(),s=await a.transaction(V).store.index(G).openCursor(e,t);return s?.value}async getDb(){return this._db||(this._db=await function(e,t,{blocked:a,upgrade:s,blocking:n,terminated:r}={}){let i=indexedDB.open(e,3),o=L(i);return s&&i.addEventListener("upgradeneeded",e=>{s(L(i.result),e.oldVersion,e.newVersion,L(i.transaction),e)}),a&&i.addEventListener("blocked",e=>a(e.oldVersion,e.newVersion,e)),o.then(e=>{r&&e.addEventListener("close",()=>r()),n&&e.addEventListener("versionchange",e=>n(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}("serwist-background-sync",0,{upgrade:this._upgradeDb})),this._db}_upgradeDb(e,t){t>0&&t<3&&e.objectStoreNames.contains(V)&&e.deleteObjectStore(V),e.createObjectStore(V,{autoIncrement:!0,keyPath:"id"}).createIndex(G,G,{unique:!1})}}class z{_queueName;_queueDb;constructor(e){this._queueName=e,this._queueDb=new Q}async pushEntry(e){delete e.id,e.queueName=this._queueName,await this._queueDb.addEntry(e)}async unshiftEntry(e){let t=await this._queueDb.getFirstEntryId();t?e.id=t-1:delete e.id,e.queueName=this._queueName,await this._queueDb.addEntry(e)}async popEntry(){return this._removeEntry(await this._queueDb.getLastEntryByQueueName(this._queueName))}async shiftEntry(){return this._removeEntry(await this._queueDb.getFirstEntryByQueueName(this._queueName))}async getAll(){return await this._queueDb.getAllEntriesByQueueName(this._queueName)}async size(){return await this._queueDb.getEntryCountByQueueName(this._queueName)}async deleteEntry(e){await this._queueDb.deleteEntry(e)}async _removeEntry(e){return e&&await this.deleteEntry(e.id),e}}let J=["method","referrer","referrerPolicy","mode","credentials","cache","redirect","integrity","keepalive"];class X{_requestData;static async fromRequest(e){let t={url:e.url,headers:{}};for(let a of("GET"!==e.method&&(t.body=await e.clone().arrayBuffer()),e.headers.forEach((e,a)=>{t.headers[a]=e}),J))void 0!==e[a]&&(t[a]=e[a]);return new X(t)}constructor(e){"navigate"===e.mode&&(e.mode="same-origin"),this._requestData=e}toObject(){let e=Object.assign({},this._requestData);return e.headers=Object.assign({},this._requestData.headers),e.body&&(e.body=e.body.slice(0)),e}toRequest(){return new Request(this._requestData.url,this._requestData)}clone(){return new X(this.toObject())}}let Y="serwist-background-sync",Z=new Set,ee=e=>{let t={request:new X(e.requestData).toRequest(),timestamp:e.timestamp};return e.metadata&&(t.metadata=e.metadata),t};class et{_name;_onSync;_maxRetentionTime;_queueStore;_forceSyncFallback;_syncInProgress=!1;_requestsAddedDuringSync=!1;constructor(e,{forceSyncFallback:t,onSync:a,maxRetentionTime:s}={}){if(Z.has(e))throw new g("duplicate-queue-name",{name:e});Z.add(e),this._name=e,this._onSync=a||this.replayRequests,this._maxRetentionTime=s||10080,this._forceSyncFallback=!!t,this._queueStore=new z(this._name),this._addSyncListener()}get name(){return this._name}async pushRequest(e){await this._addRequest(e,"push")}async unshiftRequest(e){await this._addRequest(e,"unshift")}async popRequest(){return this._removeRequest("pop")}async shiftRequest(){return this._removeRequest("shift")}async getAll(){let e=await this._queueStore.getAll(),t=Date.now(),a=[];for(let s of e){let e=6e4*this._maxRetentionTime;t-s.timestamp>e?await this._queueStore.deleteEntry(s.id):a.push(ee(s))}return a}async size(){return await this._queueStore.size()}async _addRequest({request:e,metadata:t,timestamp:a=Date.now()},s){let n={requestData:(await X.fromRequest(e.clone())).toObject(),timestamp:a};switch(t&&(n.metadata=t),s){case"push":await this._queueStore.pushEntry(n);break;case"unshift":await this._queueStore.unshiftEntry(n)}this._syncInProgress?this._requestsAddedDuringSync=!0:await this.registerSync()}async _removeRequest(e){let t;let a=Date.now();switch(e){case"pop":t=await this._queueStore.popEntry();break;case"shift":t=await this._queueStore.shiftEntry()}if(t){let s=6e4*this._maxRetentionTime;return a-t.timestamp>s?this._removeRequest(e):ee(t)}}async replayRequests(){let e;for(;e=await this.shiftRequest();)try{await fetch(e.request.clone())}catch(t){throw await this.unshiftRequest(e),new g("queue-replay-failed",{name:this._name})}}async registerSync(){if("sync"in self.registration&&!this._forceSyncFallback)try{await self.registration.sync.register(`${Y}:${this._name}`)}catch(e){}}_addSyncListener(){"sync"in self.registration&&!this._forceSyncFallback?self.addEventListener("sync",e=>{if(e.tag===`${Y}:${this._name}`){let t=async()=>{let t;this._syncInProgress=!0;try{await this._onSync({queue:this})}catch(e){if(e instanceof Error)throw e}finally{this._requestsAddedDuringSync&&!(t&&!e.lastChance)&&await this.registerSync(),this._syncInProgress=!1,this._requestsAddedDuringSync=!1}};e.waitUntil(t())}}):this._onSync({queue:this})}static get _queueNames(){return Z}}class ea{_queue;constructor(e,t){this._queue=new et(e,t)}fetchDidFail=async({request:e})=>{await this._queue.pushRequest({request:e})}}let es=e=>e&&"object"==typeof e?e:{handle:e};class en{handler;match;method;catchHandler;constructor(e,t,a="GET"){this.handler=es(t),this.match=e,this.method=a}setCatchHandler(e){this.catchHandler=es(e)}}class er extends en{_allowlist;_denylist;constructor(e,{allowlist:t=[/./],denylist:a=[]}={}){super(e=>this._match(e),e),this._allowlist=t,this._denylist=a}_match({url:e,request:t}){if(t&&"navigate"!==t.mode)return!1;let a=e.pathname+e.search;for(let e of this._denylist)if(e.test(a))return!1;return!!this._allowlist.some(e=>e.test(a))}}class ei extends en{constructor(e,t,a){super(({url:t})=>{let a=e.exec(t.href);if(a&&(t.origin===location.origin||0===a.index))return a.slice(1)},t,a)}}class eo{_routes;_defaultHandlerMap;_catchHandler;constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{let{request:t}=e,a=this.handleRequest({request:t,event:e});a&&e.respondWith(a)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&"CACHE_URLS"===e.data.type){let{payload:t}=e.data,a=Promise.all(t.urlsToCache.map(t=>{"string"==typeof t&&(t=[t]);let a=new Request(...t);return this.handleRequest({request:a,event:e})}));e.waitUntil(a),e.ports?.[0]&&a.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){let a;let s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;let n=s.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:n,url:s}),o=i?.handler,c=e.method;if(!o&&this._defaultHandlerMap.has(c)&&(o=this._defaultHandlerMap.get(c)),!o)return;try{a=o.handle({url:s,request:e,event:t,params:r})}catch(e){a=Promise.reject(e)}let l=i?.catchHandler;return a instanceof Promise&&(this._catchHandler||l)&&(a=a.catch(async a=>{if(l)try{return await l.handle({url:s,request:e,event:t,params:r})}catch(e){e instanceof Error&&(a=e)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a})),a}findMatchingRoute({url:e,sameOrigin:t,request:a,event:s}){for(let n of this._routes.get(a.method)||[]){let r;let i=n.match({url:e,sameOrigin:t,request:a,event:s});if(i)return Array.isArray(r=i)&&0===r.length?r=void 0:i.constructor===Object&&0===Object.keys(i).length?r=void 0:"boolean"==typeof i&&(r=void 0),{route:n,params:r}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,es(e))}setCatchHandler(e){this._catchHandler=es(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new g("unregister-route-but-not-found-with-method",{method:e.method});let t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new g("unregister-route-route-not-registered")}}let ec=()=>(o||((o=new eo).addFetchListener(),o.addCacheListener()),o);function el(e,t,a){let s;if("string"==typeof e){let n=new URL(e,location.href);s=new en(({url:e})=>e.href===n.href,t,a)}else if(e instanceof RegExp)s=new ei(e,t,a);else if("function"==typeof e)s=new en(e,t,a);else if(e instanceof en)s=e;else throw new g("unsupported-route-type",{moduleName:"@serwist/routing",funcName:"registerRoute",paramName:"capture"});return ec().registerRoute(s),s}function eh(e){return"string"==typeof e?new Request(e):e}class eu{request;url;event;params;_cacheKeys={};_strategy;_extendLifetimePromises;_handlerDeferred;_plugins;_pluginStateMap;constructor(e,t){for(let a of(Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new _,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map,this._plugins))this._pluginStateMap.set(a,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:t}=this,a=eh(e);if("navigate"===a.mode&&t instanceof FetchEvent&&t.preloadResponse){let e=await t.preloadResponse;if(e)return e}let s=this.hasCallback("fetchDidFail")?a.clone():null;try{for(let e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:t})}catch(e){if(e instanceof Error)throw new g("plugin-error-request-will-fetch",{thrownErrorMessage:e.message})}let n=a.clone();try{let e;for(let s of(e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions),this.iterateCallbacks("fetchDidSucceed")))e=await s({event:t,request:n,response:e});return e}catch(e){throw s&&await this.runCallbacks("fetchDidFail",{error:e,event:t,originalRequest:s.clone(),request:n.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),a=t.clone();return this.waitUntil(this.cachePut(e,a)),t}async cacheMatch(e){let t;let a=eh(e),{cacheName:s,matchOptions:n}=this._strategy,r=await this.getCacheKey(a,"read"),i={...n,cacheName:s};for(let e of(t=await caches.match(r,i),this.iterateCallbacks("cachedResponseWillBeUsed")))t=await e({cacheName:s,matchOptions:n,cachedResponse:t,request:r,event:this.event})||void 0;return t}async cachePut(e,t){let a=eh(e);await D(0);let s=await this.getCacheKey(a,"write");if(!t)throw new g("cache-put-with-no-response",{url:R(s.url)});let n=await this._ensureResponseSafeToCache(t);if(!n)return!1;let{cacheName:r,matchOptions:i}=this._strategy,o=await self.caches.open(r),c=this.hasCallback("cacheDidUpdate"),l=c?await v(o,s.clone(),["__WB_REVISION__"],i):null;try{await o.put(s,c?n.clone():n)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await E(),e}for(let e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:r,oldResponse:l,newResponse:n.clone(),request:s,event:this.event});return!0}async getCacheKey(e,t){let a=`${e.url} | ${t}`;if(!this._cacheKeys[a]){let s=e;for(let e of this.iterateCallbacks("cacheKeyWillBeUsed"))s=eh(await e({mode:t,request:s,event:this.event,params:this.params}));this._cacheKeys[a]=s}return this._cacheKeys[a]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let a of this.iterateCallbacks(e))await a(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if("function"==typeof t[e]){let a=this._pluginStateMap.get(t),s=s=>{let n={...s,state:a};return t[e](n)};yield s}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,a=!1;for(let e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,a=!0,!t)break;return!a&&t&&200!==t.status&&(t=void 0),t}}class ed{cacheName;plugins;fetchOptions;matchOptions;constructor(e={}){this.cacheName=p.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,a="string"==typeof e.request?new Request(e.request):e.request,s=new eu(this,{event:t,request:a,params:"params"in e?e.params:void 0}),n=this._getResponse(s,a,t),r=this._awaitComplete(n,s,a,t);return[n,r]}async _getResponse(e,t,a){let s;await e.runCallbacks("handlerWillStart",{event:a,request:t});try{if(s=await this._handle(t,e),void 0===s||"error"===s.type)throw new g("no-response",{url:t.url})}catch(n){if(n instanceof Error){for(let r of e.iterateCallbacks("handlerDidError"))if(void 0!==(s=await r({error:n,event:a,request:t})))break}if(!s)throw n}for(let n of e.iterateCallbacks("handlerWillRespond"))s=await n({event:a,request:t,response:s});return s}async _awaitComplete(e,t,a,s){let n,r;try{n=await e}catch(e){}try{await t.runCallbacks("handlerDidRespond",{event:s,request:a,response:n}),await t.doneWaiting()}catch(e){e instanceof Error&&(r=e)}if(await t.runCallbacks("handlerDidComplete",{event:s,request:a,response:n,error:r}),t.destroy(),r)throw r}}class ef extends ed{async _handle(e,t){let a,s=await t.cacheMatch(e);if(!s)try{s=await t.fetchAndCachePut(e)}catch(e){e instanceof Error&&(a=e)}if(!s)throw new g("no-response",{url:e.url,error:a});return s}}class ep extends ed{async _handle(e,t){let a=await t.cacheMatch(e);if(!a)throw new g("no-response",{url:e.url});return a}}let em={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};class eg extends ed{_networkTimeoutSeconds;constructor(e={}){super(e),this.plugins.some(e=>"cacheWillUpdate"in e)||this.plugins.unshift(em),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){let a;let s=[],n=[];if(this._networkTimeoutSeconds){let{id:r,promise:i}=this._getTimeoutPromise({request:e,logs:s,handler:t});a=r,n.push(i)}let r=this._getNetworkPromise({timeoutId:a,request:e,logs:s,handler:t});n.push(r);let i=await t.waitUntil((async()=>await t.waitUntil(Promise.race(n))||await r)());if(!i)throw new g("no-response",{url:e.url});return i}_getTimeoutPromise({request:e,logs:t,handler:a}){let s;return{promise:new Promise(t=>{s=setTimeout(async()=>{t(await a.cacheMatch(e))},1e3*this._networkTimeoutSeconds)}),id:s}}async _getNetworkPromise({timeoutId:e,request:t,logs:a,handler:s}){let n,r;try{r=await s.fetchAndCachePut(t)}catch(e){e instanceof Error&&(n=e)}return e&&clearTimeout(e),(n||!r)&&(r=await s.cacheMatch(t)),r}}class ew extends ed{_networkTimeoutSeconds;constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){let a,s;try{let s=[t.fetch(e)];if(this._networkTimeoutSeconds){let e=D(1e3*this._networkTimeoutSeconds);s.push(e)}if(!(a=await Promise.race(s)))throw Error(`Timed out the network response after ${this._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(s=e)}if(!a)throw new g("no-response",{url:e.url,error:s});return a}}class ey extends ed{constructor(e={}){super(e),this.plugins.some(e=>"cacheWillUpdate"in e)||this.plugins.unshift(em)}async _handle(e,t){let a;let s=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(s);let n=await t.cacheMatch(e);if(n);else try{n=await s}catch(e){e instanceof Error&&(a=e)}if(!n)throw new g("no-response",{url:e.url,error:a});return n}}let e_="www.google-analytics.com",eb="www.googletagmanager.com",ev=/^\/(\w+\/)?collect/,ex=e=>async({queue:t})=>{let a;for(;a=await t.shiftRequest();){let{request:s,timestamp:n}=a,r=new URL(s.url);try{let t="POST"===s.method?new URLSearchParams(await s.clone().text()):r.searchParams,a=n-(Number(t.get("qt"))||0),i=Date.now()-a;if(t.set("qt",String(i)),e.parameterOverrides)for(let a of Object.keys(e.parameterOverrides)){let s=e.parameterOverrides[a];t.set(a,s)}"function"==typeof e.hitFilter&&e.hitFilter.call(null,t),await fetch(new Request(r.origin+r.pathname,{body:t.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(e){throw await t.unshiftRequest(a),e}}},eE=e=>{let t=({url:e})=>e.hostname===e_&&ev.test(e.pathname),a=new ew({plugins:[e]});return[new en(t,a,"GET"),new en(t,a,"POST")]},eR=e=>new en(({url:e})=>e.hostname===e_&&"/analytics.js"===e.pathname,new eg({cacheName:e}),"GET"),eD=e=>new en(({url:e})=>e.hostname===eb&&"/gtag/js"===e.pathname,new eg({cacheName:e}),"GET"),eS=e=>new en(({url:e})=>e.hostname===eb&&"/gtm.js"===e.pathname,new eg({cacheName:e}),"GET"),eC=(e={})=>{let t=p.getGoogleAnalyticsName(e.cacheName),a=new ea("serwist-google-analytics",{maxRetentionTime:2880,onSync:ex(e)}),s=[eS(t),eR(t),eD(t),...eE(a)],n=new eo;for(let e of s)n.registerRoute(e);n.addFetchListener()};class eq extends ed{_fallbackToNetwork;static defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e};static copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await y(e):e};constructor(e={}){e.cacheName=p.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(eq.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let a;let s=t.params||{};if(this._fallbackToNetwork){let n=s.integrity,r=e.integrity,i=!r||r===n;a=await t.fetch(new Request(e,{integrity:"no-cors"!==e.mode?r||n:void 0})),n&&i&&"no-cors"!==e.mode&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,a.clone()))}else throw new g("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return a}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();let a=await t.fetch(e);if(!await t.cachePut(e,a.clone()))throw new g("bad-precaching-response",{url:e.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(let[a,s]of this.plugins.entries())s!==eq.copyRedirectedCacheableResponsesPlugin&&(s===eq.defaultPrecacheCacheabilityPlugin&&(e=a),s.cacheWillUpdate&&t++);0===t?this.plugins.push(eq.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}class eN{_precacheController;constructor({precacheController:e}){this._precacheController=e}cacheKeyWillBeUsed=async({request:e,params:t})=>{let a=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return a?new Request(a,{headers:e.headers}):e}}class ek{updatedURLs=[];notUpdatedURLs=[];handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)};cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:a})=>{if("install"===e.type&&t?.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;a?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return a}}class eP{_installAndActiveListenersAdded;_strategy;_urlsToCacheKeys=new Map;_urlsToCacheModes=new Map;_cacheKeysToIntegrities=new Map;constructor({cacheName:e,plugins:t=[],fallbackToNetwork:a=!0}={}){this._strategy=new eq({cacheName:p.getPrecacheName(e),plugins:[...t,new eN({precacheController:this})],fallbackToNetwork:a}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){let t=[];for(let a of e){"string"==typeof a?t.push(a):a&&void 0===a.revision&&t.push(a.url);let{cacheKey:e,url:s}=function(e){if(!e)throw new g("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:t,url:a}=e;if(!a)throw new g("add-to-cache-list-unexpected-type",{entry:e});if(!t){let e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}let s=new URL(a,location.href),n=new URL(a,location.href);return s.searchParams.set("__WB_REVISION__",t),{cacheKey:s.href,url:n.href}}(a),n="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(s)&&this._urlsToCacheKeys.get(s)!==e)throw new g("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(s),secondEntry:e});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==a.integrity)throw new g("add-to-cache-list-conflicting-integrities",{url:s});this._cacheKeysToIntegrities.set(e,a.integrity)}this._urlsToCacheKeys.set(s,e),this._urlsToCacheModes.set(s,n),t.length>0&&console.warn(`Serwist is precaching URLs without revision info: ${t.join(", ")}
This is generally NOT safe. Learn more at https://bit.ly/wb-precache`)}}install(e){return C(e,async()=>{let t=new ek;for(let[a,s]of(this.strategy.plugins.push(t),this._urlsToCacheKeys)){let t=this._cacheKeysToIntegrities.get(s),n=this._urlsToCacheModes.get(a),r=new Request(a,{integrity:t,cache:n,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:e}))}let{updatedURLs:a,notUpdatedURLs:s}=t;return{updatedURLs:a,notUpdatedURLs:s}})}activate(e){return C(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),a=new Set(this._urlsToCacheKeys.values()),s=[];for(let n of t)a.has(n.url)||(await e.delete(n),s.push(n.url));return{deletedURLs:s}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,a=this.getCacheKeyForURL(t);if(a)return(await self.caches.open(this.strategy.cacheName)).match(a)}createHandlerBoundToURL(e){let t=this.getCacheKeyForURL(e);if(!t)throw new g("non-precached-url",{url:e});return a=>(a.request=new Request(e),a.params={cacheKey:t,...a.params},this.strategy.handle(a))}}let eI=()=>(c||(c=new eP),c);class eL{_fallbackURL;_precacheController;constructor({fallbackURL:e,precacheController:t}){this._fallbackURL=e,this._precacheController=t||eI()}handlerDidError=()=>this._precacheController.matchPrecache(this._fallbackURL)}class eT extends en{constructor(e,t){super(({request:a})=>{let s=e.getURLsToCacheKeys();for(let n of function*(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:a="index.html",cleanURLs:s=!0,urlManipulation:n}={}){let r=new URL(e,location.href);r.hash="",yield r.href;let i=function(e,t=[]){for(let a of[...e.searchParams.keys()])t.some(e=>e.test(a))&&e.searchParams.delete(a);return e}(r,t);if(yield i.href,a&&i.pathname.endsWith("/")){let e=new URL(i.href);e.pathname+=a,yield e.href}if(s){let e=new URL(i.href);e.pathname+=".html",yield e.href}if(n)for(let e of n({url:r}))yield e.href}(a.url,t)){let t=s.get(n);if(t){let a=e.getIntegrityForCacheKey(t);return{cacheKey:t,integrity:a}}}},e.strategy)}}let eA="-precache-",eU=async(e,t=eA)=>{let a=(await self.caches.keys()).filter(a=>a.includes(t)&&a.includes(self.registration.scope)&&a!==e);return await Promise.all(a.map(e=>self.caches.delete(e))),a};function eB(e,t){eI().precache(e),el(new eT(eI(),t))}let eF=(e,t,a)=>!a.some(a=>e.headers.has(a)&&t.headers.has(a))||a.every(a=>{let s=e.headers.has(a)===t.headers.has(a),n=e.headers.get(a)===t.headers.get(a);return s&&n}),eM=["content-length","etag","last-modified"],eW="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function eO(e){return{cacheName:e.cacheName,updatedURL:e.request.url}}class eK{_headersToCheck;_generatePayload;_notifyAllClients;constructor({generatePayload:e,headersToCheck:t,notifyAllClients:a}={}){this._headersToCheck=t||eM,this._generatePayload=e||eO,this._notifyAllClients=a??!0}async notifyIfUpdated(e){if(e.oldResponse&&!eF(e.oldResponse,e.newResponse,this._headersToCheck)){let t={type:"CACHE_UPDATED",meta:"serwist-broadcast-update",payload:this._generatePayload(e)};if("navigate"===e.request.mode){let t;e.event instanceof FetchEvent&&(t=e.event.resultingClientId),(!await S(t)||eW)&&await D(3500)}if(this._notifyAllClients)for(let e of(await self.clients.matchAll({type:"window"})))e.postMessage(t);else if(e.event instanceof FetchEvent){let a=await self.clients.get(e.event.clientId);a?.postMessage(t)}}}}class ej{_broadcastUpdate;constructor(e){this._broadcastUpdate=new eK(e)}cacheDidUpdate=async e=>{x(this._broadcastUpdate.notifyIfUpdated(e))}}class e${_statuses;_headers;constructor(e={}){this._statuses=e.statuses,this._headers=e.headers}isResponseCacheable(e){let t=!0;return this._statuses&&(t=this._statuses.includes(e.status)),this._headers&&t&&(t=Object.keys(this._headers).some(t=>e.headers.get(t)===this._headers[t])),t}}class eH{_cacheableResponse;constructor(e){this._cacheableResponse=new e$(e)}cacheWillUpdate=async({response:e})=>this._cacheableResponse.isResponseCacheable(e)?e:null}let eV=(e,t)=>t.some(t=>e instanceof t),eG=new WeakMap,eQ=new WeakMap,ez=new WeakMap,eJ={get(e,t,a){if(e instanceof IDBTransaction){if("done"===t)return eG.get(e);if("store"===t)return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return eX(e[t])},set:(e,t,a)=>(e[t]=a,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function eX(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("success",n),e.removeEventListener("error",r)},n=()=>{t(eX(e.result)),s()},r=()=>{a(e.error),s()};e.addEventListener("success",n),e.addEventListener("error",r)});return ez.set(t,e),t}(e);if(eQ.has(e))return eQ.get(e);let a="function"==typeof(t=e)?(h||(h=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(eY(this),e),eX(this.request)}:function(...e){return eX(t.apply(eY(this),e))}:(t instanceof IDBTransaction&&function(e){if(eG.has(e))return;let t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("complete",n),e.removeEventListener("error",r),e.removeEventListener("abort",r)},n=()=>{t(),s()},r=()=>{a(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",n),e.addEventListener("error",r),e.addEventListener("abort",r)});eG.set(e,t)}(t),eV(t,l||(l=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,eJ):t;return a!==e&&(eQ.set(e,a),ez.set(a,e)),a}let eY=e=>ez.get(e),eZ=["get","getKey","getAll","getAllKeys","count"],e0=["put","add","delete","clear"],e1=new Map;function e4(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(e1.get(t))return e1.get(t);let a=t.replace(/FromIndex$/,""),s=t!==a,n=e0.includes(a);if(!(a in(s?IDBIndex:IDBObjectStore).prototype)||!(n||eZ.includes(a)))return;let r=async function(e,...t){let r=this.transaction(e,n?"readwrite":"readonly"),i=r.store;return s&&(i=i.index(t.shift())),(await Promise.all([i[a](...t),n&&r.done]))[0]};return e1.set(t,r),r}eJ={...a=eJ,get:(e,t,s)=>e4(e,t)||a.get(e,t,s),has:(e,t)=>!!e4(e,t)||a.has(e,t)};let e6=["continue","continuePrimaryKey","advance"],e3={},e2=new WeakMap,e8=new WeakMap,e5={get(e,t){if(!e6.includes(t))return e[t];let a=e3[t];return a||(a=e3[t]=function(...e){e2.set(this,e8.get(this)[t](...e))}),a}};async function*e9(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let a=new Proxy(t,e5);for(e8.set(a,t),ez.set(a,eY(t));t;)yield a,t=await (e2.get(a)||t.continue()),e2.delete(a)}function e7(e,t){return t===Symbol.asyncIterator&&eV(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&eV(e,[IDBIndex,IDBObjectStore])}eJ={...s=eJ,get:(e,t,a)=>e7(e,t)?e9:s.get(e,t,a),has:(e,t)=>e7(e,t)||s.has(e,t)};let te="cache-entries",tt=e=>{let t=new URL(e,location.href);return t.hash="",t.href};class ta{_cacheName;_db=null;constructor(e){this._cacheName=e}_upgradeDb(e){let t=e.createObjectStore(te,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e,{blocked:t}={}){let a=indexedDB.deleteDatabase(e);t&&a.addEventListener("blocked",e=>t(e.oldVersion,e)),eX(a).then(()=>void 0)}(this._cacheName)}async setTimestamp(e,t){let a={url:e=tt(e),timestamp:t,cacheName:this._cacheName,id:this._getId(e)},s=(await this.getDb()).transaction(te,"readwrite",{durability:"relaxed"});await s.store.put(a),await s.done}async getTimestamp(e){let t=await this.getDb(),a=await t.get(te,this._getId(e));return a?.timestamp}async expireEntries(e,t){let a=await this.getDb(),s=await a.transaction(te).store.index("timestamp").openCursor(null,"prev"),n=[],r=0;for(;s;){let a=s.value;a.cacheName===this._cacheName&&(e&&a.timestamp<e||t&&r>=t?n.push(s.value):r++),s=await s.continue()}let i=[];for(let e of n)await a.delete(te,e.id),i.push(e.url);return i}_getId(e){return`${this._cacheName}|${tt(e)}`}async getDb(){return this._db||(this._db=await function(e,t,{blocked:a,upgrade:s,blocking:n,terminated:r}={}){let i=indexedDB.open(e,1),o=eX(i);return s&&i.addEventListener("upgradeneeded",e=>{s(eX(i.result),e.oldVersion,e.newVersion,eX(i.transaction),e)}),a&&i.addEventListener("blocked",e=>a(e.oldVersion,e.newVersion,e)),o.then(e=>{r&&e.addEventListener("close",()=>r()),n&&e.addEventListener("versionchange",e=>n(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}("serwist-expiration",0,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class ts{_isRunning=!1;_rerunRequested=!1;_maxEntries;_maxAgeSeconds;_matchOptions;_cacheName;_timestampModel;constructor(e,t={}){this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new ta(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;let e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),a=await self.caches.open(this._cacheName);for(let e of t)await a.delete(e,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,x(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(!this._maxAgeSeconds)return!1;let t=await this._timestampModel.getTimestamp(e),a=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t<a}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}class tn{_config;_maxAgeSeconds;_cacheExpirations;constructor(e={}){this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&w.add(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===p.getRuntimeName())throw new g("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new ts(e,this._config),this._cacheExpirations.set(e,t)),t}cachedResponseWillBeUsed=async({event:e,request:t,cacheName:a,cachedResponse:s})=>{if(!s)return null;let n=this._isResponseDateFresh(s),r=this._getCacheExpiration(a);x(r.expireEntries());let i=r.updateTimestamp(t.url);if(e)try{e.waitUntil(i)}catch(e){}return n?s:null};_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;let t=this._getDateHeaderTimestamp(e);return null===t||t>=Date.now()-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;let t=new Date(e.headers.get("date")).getTime();return Number.isNaN(t)?null:t}cacheDidUpdate=async({cacheName:e,request:t})=>{let a=this._getCacheExpiration(e);await a.updateTimestamp(t.url),await a.expireEntries()};async deleteCacheAndMetadata(){for(let[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}async function tr(e,t){try{if(206===t.status)return t;let a=e.headers.get("range");if(!a)throw new g("no-range-header");let s=function(e){let t=e.trim().toLowerCase();if(!t.startsWith("bytes="))throw new g("unit-must-be-bytes",{normalizedRangeHeader:t});if(t.includes(","))throw new g("single-range-only",{normalizedRangeHeader:t});let a=/(\d*)-(\d*)/.exec(t);if(!a||!(a[1]||a[2]))throw new g("invalid-range-values",{normalizedRangeHeader:t});return{start:""===a[1]?void 0:Number(a[1]),end:""===a[2]?void 0:Number(a[2])}}(a),n=await t.blob(),r=function(e,t,a){let s,n;let r=e.size;if(a&&a>r||t&&t<0)throw new g("range-not-satisfiable",{size:r,end:a,start:t});return void 0!==t&&void 0!==a?(s=t,n=a+1):void 0!==t&&void 0===a?(s=t,n=r):void 0!==a&&void 0===t&&(s=r-a,n=r),{start:s,end:n}}(n,s.start,s.end),i=n.slice(r.start,r.end),o=i.size,c=new Response(i,{status:206,statusText:"Partial Content",headers:t.headers});return c.headers.set("Content-Length",String(o)),c.headers.set("Content-Range",`bytes ${r.start}-${r.end-1}/${n.size}`),c}catch(e){return new Response("",{status:416,statusText:"Range Not Satisfiable"})}}class ti{cachedResponseWillBeUsed=async({request:e,cachedResponse:t})=>t&&e.headers.has("range")?await tr(e,t):t}let to=()=>{self.__WB_DISABLE_DEV_LOGS=!0},tc=({runtimeCaching:e,entries:t,precacheOptions:a})=>(eB(t.map(({url:e,revision:t})=>({url:"string"==typeof e?e:e.toString(),revision:t})),a),e=e.map(e=>(!e.options||e.options.precacheFallback||e.options.plugins?.some(e=>"handlerDidError"in e)||(e.options.plugins||(e.options.plugins=[]),e.options.plugins.push({async handlerDidError(e){for(let{matcher:a,url:s,cacheMatchOptions:n={ignoreSearch:!0}}of t)if(a(e))return caches.match(s,n);return Response.error()}})),e))),tl=({precacheEntries:e,precacheOptions:t,cleanupOutdatedCaches:a=!1,...s})=>{if(e&&e.length>0&&eB(e,t),a&&self.addEventListener("activate",e=>{let t=p.getPrecacheName();e.waitUntil(eU(t).then(e=>{}))}),s.navigateFallback){var n;el(new er((n=s.navigateFallback,eI().createHandlerBoundToURL(n)),{allowlist:s.navigateFallbackAllowlist,denylist:s.navigateFallbackDenylist}))}},th=e=>null!=e,tu={CacheFirst:ef,CacheOnly:ep,NetworkFirst:eg,NetworkOnly:ew,StaleWhileRevalidate:ey},td=(...e)=>{for(let t of e)if("string"==typeof t.handler){let{cacheName:e,networkTimeoutSeconds:a,fetchOptions:s,matchOptions:n,plugins:r,backgroundSync:i,broadcastUpdate:o,cacheableResponse:c,expiration:l,precacheFallback:h,rangeRequests:u}=t.options,d=tu[t.handler];el(t.urlPattern,new d({cacheName:e??void 0,networkTimeoutSeconds:a,fetchOptions:s,matchOptions:n,plugins:[...r??[],i&&new ea(i.name,i.options),o&&new ej({channelName:o.channelName,...o.options}),c&&new eH(c),l&&new tn(l),h&&new eL(h),u?new ti:void 0].filter(th)}),t.method)}else el(t.urlPattern,t.handler,t.method)};(({precacheEntries:e,precacheOptions:t,cleanupOutdatedCaches:a,skipWaiting:s=!1,importScripts:n,navigationPreload:r=!1,cacheId:i,clientsClaim:o=!1,runtimeCaching:c,offlineAnalyticsConfig:l,disableDevLogs:h,fallbacks:u,...d})=>{var f;n&&n.length>0&&self.importScripts(...n),r&&self.registration?.navigationPreload&&self.addEventListener("activate",e=>{e.waitUntil(self.registration.navigationPreload.enable().then(()=>{f&&self.registration.navigationPreload.setHeaderValue(f)}))}),void 0!==i&&p.updateDetails({prefix:i}),s?self.skipWaiting():self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),o&&self.addEventListener("activate",()=>self.clients.claim()),tl({precacheEntries:e,precacheOptions:t,cleanupOutdatedCaches:a,...d.navigateFallback&&{navigateFallback:d.navigateFallback,navigateFallbackAllowlist:d.navigateFallbackAllowlist,navigateFallbackDenylist:d.navigateFallbackDenylist}}),void 0!==c&&(void 0!==u&&(c=tc({...u,runtimeCaching:c})),td(...c)),void 0!==l&&("boolean"==typeof l?l&&eC():eC(l)),h&&to()})({precacheEntries:[{'revision':'a1b7599199e2e8c82f2c6bcf8d8aca61','url':'/_next/static/JdYusgxKYCunVUke6sd7H/_buildManifest.js'},{'revision':'b6652df95db52feb4daf4eca35380933','url':'/_next/static/JdYusgxKYCunVUke6sd7H/_ssgManifest.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/13b76428-56ef92d027d6786a.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/318-99450bf1dc451cff.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/752-a9c823f9c1fb08ad.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/app/_not-found-38244fafac947cfe.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/app/layout-61f8a135a745e74b.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/app/page-2f3f91e00fac31a1.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/fd9d1056-994a898959ab23ba.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/framework-8883d1e9be70c3da.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/main-840e4f6ddcf80223.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/main-app-1a9e77b37f3db18a.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/pages/_app-98cb51ec6f9f135f.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/pages/_error-e87e5963ec1b8011.js'},{'revision':'837c0df77fd5009c9e46d446188ecfd0','url':'/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js'},{'revision':'JdYusgxKYCunVUke6sd7H','url':'/_next/static/chunks/webpack-66187d6712327023.js'},{'revision':'18ef25a21a100153','url':'/_next/static/css/18ef25a21a100153.css'},{'revision':'b361fe817abe4698','url':'/_next/static/css/b361fe817abe4698.css'},{'revision':'3a0668ba9eb4080ff5bb5df785ad94f0','url':'/favicon.ico'},{'revision':'34f347c48c427690a6ce5a7d41f0c170','url':'/icon.png'},{'revision':'ade41f578ed30b7d2468cb8388b21bd5','url':'/icons/icon-128x128.png'},{'revision':'6bfa8d457314c1d4456b8a2ceae4e621','url':'/icons/icon-144x144.png'},{'revision':'1ec259cfd9f5e397e72a9882f7440d0e','url':'/icons/icon-152x152.png'},{'revision':'39c648bca8964f130bca6f265ebedf0a','url':'/icons/icon-192x192.png'},{'revision':'29eb71bc2e306542c600e1efc4ec903e','url':'/icons/icon-384x384.png'},{'revision':'24708ff923123b10c8b6eb7caef544f4','url':'/icons/icon-48x48.png'},{'revision':'4c334c8b44ae9fce6ceb3009d47cd684','url':'/icons/icon-512x512.png'},{'revision':'f3a98a4d74bcf7e5adc2b0e170feb4a2','url':'/icons/icon-72x72.png'},{'revision':'5768c67a7eceb52b05a648c9a1dde9b2','url':'/icons/icon-96x96.png'},{'revision':'ef65c6c51c02657bbd697380dc7be749','url':'/images/screenshot-wide-0.png'},{'revision':'4e23aff3265ebfac5a985b637bc90b90','url':'/manifest.json'},{'revision':'8e061864f388b47f33a1c3780831193e','url':'/next.svg'},{'revision':'48fe1886c777f23078be6b552e927928','url':'/sw.js'},{'revision':'61c6b19abff40ea7acd577be818f3976','url':'/vercel.svg'},{'revision':'6dd14f6e5f8a63e9d186da86090b39cd','url':'/workbox-e43f5367.js'},{'revision':'0c3b49c61954210e95d72cea5748bbec','url':'/workbox-e43f5367.js.map'}],skipWaiting:!0,clientsClaim:!0,navigationPreload:!0,runtimeCaching:[{urlPattern:/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,handler:"CacheFirst",options:{cacheName:"google-fonts-webfonts",expiration:{maxEntries:4,maxAgeSeconds:31536e3}}},{urlPattern:/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,handler:"StaleWhileRevalidate",options:{cacheName:"google-fonts-stylesheets",expiration:{maxEntries:4,maxAgeSeconds:604800}}},{urlPattern:/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,handler:"StaleWhileRevalidate",options:{cacheName:"static-font-assets",expiration:{maxEntries:4,maxAgeSeconds:604800}}},{urlPattern:/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,handler:"StaleWhileRevalidate",options:{cacheName:"static-image-assets",expiration:{maxEntries:64,maxAgeSeconds:2592e3}}},{urlPattern:/\/_next\/static.+\.js$/i,handler:"CacheFirst",options:{cacheName:"next-static-js-assets",expiration:{maxEntries:64,maxAgeSeconds:86400}}},{urlPattern:/\/_next\/image\?url=.+$/i,handler:"StaleWhileRevalidate",options:{cacheName:"next-image",expiration:{maxEntries:64,maxAgeSeconds:86400}}},{urlPattern:/\.(?:mp3|wav|ogg)$/i,handler:"CacheFirst",options:{rangeRequests:!0,cacheName:"static-audio-assets",expiration:{maxEntries:32,maxAgeSeconds:86400}}},{urlPattern:/\.(?:mp4|webm)$/i,handler:"CacheFirst",options:{rangeRequests:!0,cacheName:"static-video-assets",expiration:{maxEntries:32,maxAgeSeconds:86400}}},{urlPattern:/\.(?:js)$/i,handler:"StaleWhileRevalidate",options:{cacheName:"static-js-assets",expiration:{maxEntries:48,maxAgeSeconds:86400}}},{urlPattern:/\.(?:css|less)$/i,handler:"StaleWhileRevalidate",options:{cacheName:"static-style-assets",expiration:{maxEntries:32,maxAgeSeconds:86400}}},{urlPattern:/\/_next\/data\/.+\/.+\.json$/i,handler:"StaleWhileRevalidate",options:{cacheName:"next-data",expiration:{maxEntries:32,maxAgeSeconds:86400}}},{urlPattern:/\.(?:json|xml|csv)$/i,handler:"NetworkFirst",options:{cacheName:"static-data-assets",expiration:{maxEntries:32,maxAgeSeconds:86400}}},{urlPattern:({sameOrigin:e,url:{pathname:t}})=>!(!e||t.startsWith("/api/auth/callback"))&&!!t.startsWith("/api/"),handler:"NetworkFirst",method:"GET",options:{cacheName:"apis",expiration:{maxEntries:16,maxAgeSeconds:86400},networkTimeoutSeconds:10}},{urlPattern:({request:e,url:{pathname:t},sameOrigin:a})=>"1"===e.headers.get("RSC")&&"1"===e.headers.get("Next-Router-Prefetch")&&a&&!t.startsWith("/api/"),handler:"NetworkFirst",options:{cacheName:"pages-rsc-prefetch",expiration:{maxEntries:32,maxAgeSeconds:86400}}},{urlPattern:({request:e,url:{pathname:t},sameOrigin:a})=>"1"===e.headers.get("RSC")&&a&&!t.startsWith("/api/"),handler:"NetworkFirst",options:{cacheName:"pages-rsc",expiration:{maxEntries:32,maxAgeSeconds:86400}}},{urlPattern:({url:{pathname:e},sameOrigin:t})=>t&&!e.startsWith("/api/"),handler:"NetworkFirst",options:{cacheName:"pages",expiration:{maxEntries:32,maxAgeSeconds:86400}}},{urlPattern:({sameOrigin:e})=>!e,handler:"NetworkFirst",options:{cacheName:"cross-origin",expiration:{maxEntries:32,maxAgeSeconds:3600},networkTimeoutSeconds:10}}]})}();