vendor: 6,476 bytes, line 1
1try{self["workbox:core:7.4.0"]&&_()}catch{}const ee=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},te=ee;class l extends Error{constructor(e,t){const n=te(e,t);super(n),this.name=e,this.details=t}}const f={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},U=s=>[f.prefix,s,f.suffix].filter(e=>e&&e.length>0).join("-"),se=s=>{for(const e of Object.keys(f))s(e)},C={updateDetails:s=>{se(e=>{typeof s[e]=="string"&&(f[e]=s[e])})},getGoogleAnalyticsName:s=>s||U(f.googleAnalytics),getPrecacheName:s=>s||U(f.precache),getPrefix:()=>f.prefix,getRuntimeName:s=>s||U(f.runtime),getSuffix:()=>f.suffix};function O(s,e){const t=e();return s.waitUntil(t),t}try{self["workbox:precaching:7.4.0"]&&_()}catch{}const ne="__WB_REVISION__";function re(s){if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const a=new URL(s,location.href);return{cacheKey:a.href,url:a.href}}const{revision:e,url:t}=s;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(!e){const a=new URL(t,location.href);return{cacheKey:a.href,url:a.href}}const n=new URL(t,location.href),r=new URL(t,location.href);return n.searchParams.set(ne,e),{cacheKey:n.href,url:r.href}}class ae{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const r=t.originalRequest.url;n?this.notUpdatedURLs.push(r):this.updatedURLs.push(r)}return n}}}class ie{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const r=n?.cacheKey||this._precacheController.getCacheKeyForURL(t.url);return r?new Request(r,{headers:t.headers}):t},this._precacheController=e}}let w;function oe(){if(w===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),w=!0}catch{w=!1}w=!1}return w}async function ce(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const n=s.clone(),a={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=oe()?n.body:await n.blob();return new Response(i,a)}const he=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function K(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function le(s,e,t,n){const r=K(e.url,t);if(e.url===r)return s.match(e,n);const a=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,a);for(const o of i){const c=K(o.url,t);if(r===c)return s.match(o,n)}}class ue{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const F=new Set;async function de(){for(const s of F)await s()}function fe(s){return new Promise(e=>setTimeout(e,s))}try{self["workbox:strategies:7.4.0"]&&_()}catch{}function E(s){return typeof s=="string"?new Request(s):s}class pe{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new ue,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=E(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const a=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const o of this.iterateCallbacks("fetchDidSucceed"))i=await o({event:t,request:a,response:i});return i}catch(i){throw r&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:r.clone(),request:a.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=E(e);let n;const{cacheName:r,matchOptions:a}=this._strategy,i=await this.getCacheKey(t,"read"),o=Object.assign(Object.assign({},a),{cacheName:r});n=await caches.match(i,o);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await c({cacheName:r,matchOptions:a,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=E(e);await fe(0);const r=await this.getCacheKey(n,"write");if(!t)throw new l("cache-put-with-no-response",{url:he(r.url)});const a=await this._ensureResponseSafeToCache(t);if(!a)return!1;const{cacheName:i,matchOptions:o}=this._strategy,c=await self.caches.open(i),h=this.hasCallback("cacheDidUpdate"),d=h?await le(c,r.clone(),["__WB_REVISION__"],o):null;try{await c.put(r,h?a.clone():a)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await de(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:d,newResponse:a.clone(),request:r,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(const a of this.iterateCallbacks("cacheKeyWillBeUsed"))r=E(await a({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield a=>{const i=Object.assign(Object.assign({},a),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){const e=this._extendLifetimePromises.splice(0),n=(await Promise.allSettled(e)).find(r=>r.status==="rejected");if(n)throw n.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const r of this.iterateCallbacks("cacheWillUpdate"))if(t=await r({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class H{constructor(e={}
vendor: 9,117 bytes, lines 1-2
1){this.cacheName=C.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,r="params"in e?e.params:void 0,a=new pe(this,{event:t,request:n,params:r}),i=this._getResponse(a,n,t),o=this._awaitComplete(i,a,n,t);return[i,o]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let r;try{if(r=await this._handle(t,e),!r||r.type==="error")throw new l("no-response",{url:t.url})}catch(a){if(a instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(r=await i({error:a,event:n,request:t}),r)break}if(!r)throw a}for(const a of e.iterateCallbacks("handlerWillRespond"))r=await a({event:n,request:t,response:r});return r}async _awaitComplete(e,t,n,r){let a,i;try{a=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:r,request:n,response:a}),await t.doneWaiting()}catch(o){o instanceof Error&&(i=o)}if(await t.runCallbacks("handlerDidComplete",{event:r,request:n,response:a,error:i}),t.destroy(),i)throw i}}class g extends H{constructor(e={}){e.cacheName=C.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(g.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const r=t.params||{};if(this._fallbackToNetwork){const a=r.integrity,i=e.integrity,o=!i||i===a;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||a:void 0})),a&&o&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new l("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,r]of this.plugins.entries())r!==g.copyRedirectedCacheableResponsesPlugin&&(r===g.defaultPrecacheCacheabilityPlugin&&(e=n),r.cacheWillUpdate&&t++);t===0?this.plugins.push(g.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}g.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};g.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await ce(s):s}};class ge{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new g({cacheName:C.getPrecacheName(e),plugins:[...t,new ie({precacheController:this})],fallbackToNetwork:n}),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){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:r,url:a}=re(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(a)&&this._urlsToCacheKeys.get(a)!==r)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(a),secondEntry:r});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(r)&&this._cacheKeysToIntegrities.get(r)!==n.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:a});this._cacheKeysToIntegrities.set(r,n.integrity)}if(this._urlsToCacheKeys.set(a,r),this._urlsToCacheModes.set(a,i),t.length>0){const o=`Workbox is precaching URLs without revision info: ${t.join(", ")} 2This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(o)}}}install(e){return O(e,async()=>{const t=new ae;this.strategy.plugins.push(t);for(const[a,i]of this._urlsToCacheKeys){const o=this._cacheKeysToIntegrities.get(i),c=this._urlsToCacheModes.get(a),h=new Request(a,{integrity:o,cache:c,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return O(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),r=new Set(this._urlsToCacheKeys.values()),a=[];for(const i of n)r.has(i.url)||(await t.delete(i),a.push(i.url));return{deletedURLs:a}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let S;const V=()=>(S||(S=new ge),S);try{self["workbox:routing:7.4.0"]&&_()}catch{}const $="GET",x=s=>s&&typeof s=="object"?s:{handle:s};class b{constructor(e,t,n=$){this.handler=x(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=x(e)}}class me extends b{constructor(e,t,n){const r=({url:a})=>{const i=e.exec(a.href);if(i&&!(a.origin!==location.origin&&i.index!==0))return i.slice(1)};super(r,t,n)}}class we{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(r=>{typeof r=="string"&&(r=[r]);const a=new Request(...r);return this.handleRequest({request:a,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const r=n.origin===location.origin,{params:a,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let o=i&&i.handler;const c=e.method;if(!o&&this._defaultHandlerMap.has(c)&&(o=this._defaultHandlerMap.get(c)),!o)return;let h;try{h=o.handle({url:n,request:e,event:t,params:a})}catch(u){h=Promise.reject(u)}const d=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||d)&&(h=h.catch(async u=>{if(d)try{return await d.handle({url:n,request:e,event:t,params:a})}catch(m){m instanceof Error&&(u=m)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const a=this._routes.get(n.method)||[];for(const i of a){let o;const c=i.match({url:e,sameOrigin:t,request:n,event:r});if(c)return o=c,(Array.isArray(o)&&o.length===0||c.constructor===Object&&Object.keys(c).length===0||typeof c=="boolean")&&(o=void 0),{route:i,params:o}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,x(e))}setCatchHandler(e){this._catchHandler=x(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 l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let y;const ye=()=>(y||(y=new we,y.addFetchListener(),y.addCacheListener()),y);function z(s,e,t){let n;if(typeof s=="string"){const a=new URL(s,location.href),i=({url:o})=>o.href===a.href;n=new b(i,e,t)}else if(s instanceof RegExp)n=new me(s,e,t);else if(typeof s=="function")n=new b(s,e,t);else if(s instanceof b)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return ye().registerRoute(n),n}function _e(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Re(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:r}={}){const a=new URL(s,location.href);a.hash="",yield a.href;const i=_e(a,e);if(yield i.href,t&&i.pathname.endsWith("/")){const o=new URL(i.href);o.pathname+=t,yield o.href}if(n){const o=new URL(i.href);o.pathname+=".html",yield o.href}if(r){const o=r({url:a});for(const c of o)yield c.href}}class be extends b{constructor(e,t){const n=({request:r})=>
2{const a=e.getURLsToCacheKeys();for(const i of Re(r.url,t)){const o=a.get(i);if(o){const c=e.getIntegrityForCacheKey(o);return{cacheKey:o,integrity:c}}}};super(n,e.strategy)}}function Ce(s){const e=V(),t=new be(e,s);z(t)}const Ee="-precache-",xe=async(s,e=Ee)=>{const n=(await self.caches.keys()).filter(r=>r.includes(e)&&r.includes(self.registration.scope)&&r!==s);return await Promise.all(n.map(r=>self.caches.delete(r))),n};function De(){self.addEventListener("activate",(s=>{const e=C.getPrecacheName();s.waitUntil(xe(e).then(t=>{}))}))}function Te(s){V().precache(s)}function Le(s,e){Te(s),Ce(e)}function Ue(s){F.add(s)}function G(s){s.then(()=>{})}function Se(){self.addEventListener("activate",()=>self.clients.claim())}class Ae extends H{async _handle(e,t){let n=await t.cacheMatch(e),r;if(!n)try{n=await t.fetchAndCachePut(e)}catch(a){a instanceof Error&&(r=a)}if(!n)throw new l("no-response",{url:e.url,error:r});return n}}const Ie=(s,e)=>e.some(t=>s instanceof t);let B,j;function Pe(){return B||(B=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ne(){return j||(j=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Q=new WeakMap,N=new WeakMap,X=new WeakMap,A=new WeakMap,v=new WeakMap;function ke(s){const e=new Promise((t,n)=>{const r=()=>{s.removeEventListener("success",a),s.removeEventListener("error",i)},a=()=>{t(p(s.result)),r()},i=()=>{n(s.error),r()};s.addEventListener("success",a),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&Q.set(t,s)}).catch(()=>{}),v.set(e,s),e}function Me(s){if(N.has(s))return;const e=new Promise((t,n)=>{const r=()=>{s.removeEventListener("complete",a),s.removeEventListener("error",i),s.removeEventListener("abort",i)},a=()=>{t(),r()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),r()};s.addEventListener("complete",a),s.addEventListener("error",i),s.addEventListener("abort",i)});N.set(s,e)}let k={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return N.get(s);if(e==="objectStoreNames")return s.objectStoreNames||X.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return p(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function ve(s){k=s(k)}function Oe(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(I(this),e,...t);return X.set(n,e.sort?e.sort():[e]),p(n)}:Ne().includes(s)?function(...e){return s.apply(I(this),e),p(Q.get(this))}:function(...e){return p(s.apply(I(this),e))}}function Ke(s){return typeof s=="function"?Oe(s):(s instanceof IDBTransaction&&Me(s),Ie(s,Pe())?new Proxy(s,k):s)}function p(s){if(s instanceof IDBRequest)return ke(s);if(A.has(s))return A.get(s);const e=Ke(s);return e!==s&&(A.set(s,e),v.set(e,s)),e}const I=s=>v.get(s);function Be(s,e,{blocked:t,upgrade:n,blocking:r,terminated:a}={}){const i=indexedDB.open(s,e),o=p(i);return n&&i.addEventListener("upgradeneeded",c=>{n(p(i.result),c.oldVersion,c.newVersion,p(i.transaction),c)}),t&&i.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),o.then(c=>{a&&c.addEventListener("close",()=>a()),r&&c.addEventListener("versionchange",h=>r(h.oldVersion,h.newVersion,h))}).catch(()=>{}),o}function je(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),p(t).then(()=>{})}const We=["get","getKey","getAll","getAllKeys","count"],qe=["put","add","delete","clear"],P=new Map;function W(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(P.get(e))return P.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,r=qe.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(r||We.includes(t)))return;const a=async function(i,...o){const c=this.transaction(i,r?"readwrite":"readonly");let h=c.store;return n&&(h=h.index(o.shift())),(await Promise.all([h[t](...o),r&&c.done]))[0]};return P.set(e,a),a}ve(s=>({...s,get:(e,t,n)=>W(e,t)||s.get(e,t,n),has:(e,t)=>!!W(e,t)||s.has(e,t)}));try{self["workbox:expiration:7.4.0"]&&_()}catch{}const Fe="workbox-expiration",R="cache-entries",q=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class He{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(R,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&je(this._cacheName)}async setTimestamp(e,t){e=q(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},a=(await this.getDb()).transaction(R,"readwrite",{durability:"relaxed"});await a.store.put(n),await a.done}async getTimestamp(e){const n=await(await this.getDb()).get(R,this._getId(e));return n?.timestamp}async expireEntries(e,t){const n=await this.getDb();let r=await n.transaction(R).store.index("timestamp").openCursor(null,"prev");const a=[];let i=0;for(;r;){const c=r.value;c.cacheName===this._cacheName&&(e&&c.timestamp<e||t&&i>=t?a.push(r.value):i++),r=await r.continue()}const o=[];for(const c of a)await n.delete(R,c.id),o.push(c.url);return o}_getId(e){return this._cacheName+"|"+q(e)}async getDb(){return this._db||(this._db=await Be(Fe,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class Ve{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new He(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const r of t)await n.delete(r,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,G(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t<n:!0}else return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}class $e{constructor(e={}){this.cachedResponseWillBeUsed=async({event:t,request:n,cacheName:r,cachedResponse:a})=>{if(!a)return null;const i=this._isResponseDateFresh(a),o=this._getCacheExpiration(r);G(o.expireEntries());const c=o.updateTimestamp(n.url);if(t)try{t.waitUntil(c)}catch{}return i?a:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const r=this._getCacheExpiration(t);await r.updateTimestamp(n.url),await r.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&Ue(()=>
2this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===C.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new Ve(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),r=new Date(t).getTime();return isNaN(r)?null:r}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}const ze="tempstash-share",Ge=2,D="shares",T="metadata",Qe="activeUserId",Xe=1440*6e4,M=20,Y=512*1024*1024,L=2e4,J=120,Ye=s=>{const e=Array.isArray(s.files)?s.files.filter(i=>i instanceof File):[];if(e.length>M)throw new Error(`Tempstash can receive up to ${M} files at once`);const t=e.reduce((i,o)=>i+o.size,0);if(!Number.isSafeInteger(t)||t>Y)throw new Error("The shared files are too large to queue safely");const n=typeof s.title=="string"?s.title:"",r=typeof s.text=="string"?s.text:"",a=typeof s.url=="string"?s.url:"";if(n.length>J||r.length>L||a.length>L)throw new Error("The shared text is too large to queue safely");return{files:e,title:n,text:r,url:a}},Je=s=>new Promise((e,t)=>{s.oncomplete=()=>e(),s.onerror=()=>t(s.error||new Error("Shared item storage failed")),s.onabort=()=>t(s.error||new Error("Shared item storage was aborted"))}),Ze=()=>new Promise((s,e)=>{const t=indexedDB.open(ze,Ge);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(D)||n.createObjectStore(D,{autoIncrement:!0}),n.objectStoreNames.contains(T)||n.createObjectStore(T)},t.onsuccess=()=>{const n=t.result;n.onversionchange=()=>n.close(),s(n)},t.onerror=()=>e(t.error||new Error("Could not open shared items")),t.onblocked=()=>e(new Error("Shared item storage is blocked by another Tempstash tab"))}),et=s=>typeof s=="number"&&Number.isFinite(s)&&s>0,tt=s=>{if(!s||typeof s!="object")return null;const e=s;return et(e.timestamp)?{ownerUserId:typeof e.ownerUserId=="string"&&e.ownerUserId?e.ownerUserId:null,timestamp:e.timestamp,files:Array.isArray(e.files)?e.files:[],title:typeof e.title=="string"?e.title:"",text:typeof e.text=="string"?e.text:"",url:typeof e.url=="string"?e.url:""}:null},st=async s=>{const e=Ye(s),t=await Ze();try{const n=t.transaction([D,T],"readwrite"),r=n.objectStore(D),i=n.objectStore(T).get(Qe);i.onsuccess=()=>{const h=i.result;r.add({...e,ownerUserId:typeof h=="string"&&h?h:null,timestamp:Date.now()})};const o=Date.now()-Xe,c=r.openCursor();c.onsuccess=()=>{const h=c.result;if(!h)return;const d=tt(h.value);(!d||d.timestamp<o)&&h.delete(),h.continue()},await Je(n)}finally{t.close()}};self.skipWaiting();Se();De();Le([{"revision":"1872c500de691dce40960bb85481de07","url":"registerSW.js"},{"revision":"2c1d7c3e3d5221a2f980daa362e45e86","url":"index.html"},{"revision":null,"url":"assets/vendor-supabase-fVq5vccW.js"},{"revision":null,"url":"assets/vendor-react-CUnmROEk.js"},{"revision":null,"url":"assets/vendor-motion-CGv3B7MR.js"},{"revision":null,"url":"assets/index-DTm5UXEN.js"},{"revision":null,"url":"assets/index-BH7o0-e3.css"},{"revision":null,"url":"assets/PublicLayout-B8M4IsEK.js"},{"revision":null,"url":"assets/Home-CEHRCmx_.js"},{"revision":"751f1257df22690e5b2f8889735e8063","url":"apple-touch-icon.png"},{"revision":"60fc9a1fbc5dd53855e0c4f9e77b457a","url":"pwa-192x192.png"},{"revision":"f497cfabcceec87c141e89f59c1045e3","url":"pwa-512x512.png"},{"revision":"f2cf6c27f7ae1b5a9b4121fe7acd99cf","url":"manifest.webmanifest"}]);z(({request:s,url:e})=>s.method==="GET"&&e.origin===self.location.origin&&e.pathname.startsWith("/assets/")&&(s.destination==="script"||s.destination==="style"),new Ae({cacheName:"tempstash-runtime-assets",plugins:[new $e({maxEntries:48,maxAgeSeconds:720*60*60})]}));self.addEventListener("fetch",s=>{const e=new URL(s.request.url);if(s.request.method==="POST"&&e.pathname==="/share"){const t=s.request.clone(),r=(async()=>{const i=await t.formData().catch(()=>null);if(!i)throw new Error("Shared payload could not be read");const o=i.getAll("files").filter(m=>m instanceof File),c=String(i.get("title")||""),h=String(i.get("text")||""),d=String(i.get("url")||"");if(o.length===0&&!h.trim()&&!d.trim())throw new Error("Shared payload was empty");if(o.length>M)throw new Error("Too many shared files");const u=o.reduce((m,Z)=>m+Z.size,0);if(!Number.isSafeInteger(u)||u>Y)throw new Error("Shared files exceeded the supported queue size");if(c.length>J||h.length>L||d.length>L)throw new Error("Shared text exceeded the supported size");return await st({files:o,title:c,text:h,url:d}),!0})();s.waitUntil(r);const a=new URL("/share-target",self.location.origin);s.respondWith(r.then(()=>Response.redirect(a.href,303)).catch(()=>(a.searchParams.set("share_error","1"),Response.redirect(a.href,303))))}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.