1var __VP_CONFIG__={"excludePaths":["/__down","/__up","/__log","/__results","/__preview","/__preview_card","/__colos","/__zinc","/meta","/turn-creds","/health","/locations"],"assetExtensions":".*","fetchTimeoutMs":10000,"idbName":"cf-version-pinning","workerName":"speedtest-production"};var __VP_SW_PATH__="/sw.js";var __VP_IDB_NAME__="cf-version-pinning";var __VP_CACHE_PREFIX__="cf-version-pinning";"use strict";(()=>{var v=Object.defineProperty;var w=(i,e,t)=>e in i?v(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var d=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);var h=typeof __VP_CONFIG__<"u"?__VP_CONFIG__:{excludePaths:[],assetExtensions:"\\.(js|css|svg|png|jpg|jpeg|gif|webp|woff|woff2|ttf|eot|ico|json|map)$",fetchTimeoutMs:1e4,idbName:"cf-version-pinning"},y=1,l="client-versions",E=/^[a-f0-9-]{36}$/i,_=new Set(["GET","HEAD","OPTIONS","TRACE","PUT","DELETE"]);function f(i){return typeof i=="string"&&E.test(i)}function u(i,e,t){console.error(JSON.stringify({event:i,error:String(e),url:t.pathname}))}var P=i=>new Promise(e=>setTimeout(e,i)),m=class{constructor(){d(this,"end",Date.now()+h.fetchTimeoutMs);d(this,"timedOut",!1);d(this,"attempts",0)}get expired(){return this.timedOut||Date.now()>=this.end}fetch(e){let t=this.end-Date.now();if(t<=0)return Promise.reject(new Error("deadline exceeded"));this.attempts++;let r=new AbortController,s=setTimeout(()=>{this.timedOut=!0,r.abort()},t);return fetch(e,{signal:r.signal}).finally(()=>clearTimeout(s))}pause(){let e=50+Math.random()*100;return P(Math.max(0,Math.min(e,this.end-Date.now())))}};function R(i){return h.excludePaths.some(e=>i.pathname.startsWith(e))?!1:new RegExp(h.assetExtensions).test(i.pathname)}function b(i,e){let t;return Promise.race([i,new Promise((r,s)=>{t=setTimeout(()=>s(new Error("timeout")),e)})]).finally(()=>clearTimeout(t))}function T(i,e){let t=new Headers(i.headers);return h.workerName!==void 0?t.set("Cloudflare-Workers-Version-Overrides",`${h.workerName}="${e}"`):t.set("Cloudflare-Workers-Version-Key",e),i.mode!=="no-cors"||i.method!=="GET"&&i.method!=="HEAD"?new Request(i,{headers:t}):new Request(i.url,{method:i.method,headers:t,mode:"same-origin",credentials:i.credentials,cache:i.cache,redirect:i.redirect,referrer:i.referrer,referrerPolicy:i.referrerPolicy,integrity:i.integrity})}var p=class{constructor(){d(this,"cache",new Map);d(this,"db",null)}
1async init(){this.db=await this.openDB();let e=await this.getAllEntries();for(let[t,r]of e)this.cache.has(t)||this.cache.set(t,r)}async setVersion(e,t){if(this.cache.set(e,t),this.db)try{await this.execWrite(r=>r.put(t,e))}catch{}}getVersion(e){return this.cache.get(e)}async purgeStaleClients(e){let t=new Set(e),r=[];for(let s of this.cache.keys())t.has(s)||r.push(s);for(let s of r)this.cache.delete(s);if(this.db&&r.length>0)try{await this.execWrite(s=>{for(let n of r)s.delete(n);return s.delete("_last_purge")})}catch{}}openDB(){return new Promise((e,t)=>{let r=indexedDB.open(h.idbName,y);r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error),r.onupgradeneeded=()=>{let s=r.result;s.objectStoreNames.contains(l)||s.createObjectStore(l)}})}getAllEntries(){let e=this.db;return e?new Promise((t,r)=>{let s=e.transaction([l],"readonly"),n=s.objectStore(l),o=[],a=n.openCursor();a.onsuccess=()=>{let c=a.result;c&&(typeof c.key=="string"&&f(c.value)&&o.push([c.key,c.value]),c.continue())},s.oncomplete=()=>t(o),s.onerror=()=>r(s.error)}):Promise.resolve([])}execWrite(e){return new Promise((t,r)=>{if(!this.db)return r(new Error("DB not initialized"));let s=this.db.transaction([l],"readwrite");e(s.objectStore(l)),s.oncomplete=()=>t(),s.onerror=()=>r(s.error)})}},D=2e3,g=class{constructor(){d(this,"store",new p);d(this,"navigations",0);d(this,"ready",Promise.resolve())}init(){this.ready=b(this.store.init(),D).catch(e=>{console.warn(JSON.stringify({event:"vp_idb_init_failed",error:String(e)}))}),self.addEventListener("install",e=>{e.waitUntil(this.onInstall())}),self.addEventListener("activate",e=>{e.waitUntil(this.onActivate())}),self.addEventListener("fetch",e=>{this.onFetch(e)}),self.addEventListener("message",e=>{this.onMessage(e)})}onMessage(e){let t=e.data;if(t?.type==="set-version"&&f(t.version)){let r=e.source,s=r&&"id"in r?r.id:void 0;if(!s)return;e.waitUntil(this.ready.then(()=>{if(!this.store.getVersion(s))return this.store.setVersion(s,t.version)}))}}async onInstall(){await self.skipWaiting()}async onActivate(){await this.ready,await self.clients.claim();let e=await self.clients.matchAll();await this.store.purgeStaleClients(e.map(t=>t.id))}onFetch(e){let t=new URL(e.request.url);t.origin===self.origin&&(e.request.mode!=="navigate"&&!R(t)||e.respondWith(this.handleFetch(e,t)))}async handleFetch(e,t){let r=e.resultingClientId||e.clientId||"",s=new m,n;try{if(await this.ready,e.request.mode==="navigate")return this.navigations++,this.navigations%10===0&&this.store.purgeStaleClients((await self.clients.matchAll()).map(a=>a.id)).catch(()=>{}),await this.handleNavigation(e.request,r,s);let o=this.store.getVersion(r);return o?(n={request:T(e.request,o),version:o},await this.handleAssetRequest(n.request,n.version,r,t,s)):await s.fetch(e.request.clone())}catch(o){return u("vp_fetch_error",o,t),s.expired||s.attempts>0&&!_.has(e.request.method)?Response.error():n&&s.attempts>0?(await s.pause(),this.handleAssetRequest(n.request,n.version,r,t,s).catch(a=>(u("vp_pinned_retry_failed",a,t),Response.error()))):s.fetch(e.request).catch(a=>(u("vp_fallback_failed",a,t),Response.error()))}}async handleNavigation(e,t,r){let s=await r.fetch(e),n=s.headers.get("X-Worker-Version-Id");return f(n)&&t&&await this.store.setVersion(t,n),s}async handleAssetRequest(e,t,r,s,n){let o=await n.fetch(e.clone()),a=o.headers.get("X-Worker-Version-Id");if(a&&a!==t){let c={pinned:t,remote:a,status:o.status,url:s.pathname};console.warn(JSON.stringify({event:"vp_version_mismatch",...c,clientId:r}));try{(await self.clients.get(r))?.postMessage({type:"stale-version",...c})}catch{}}return o}};new g().init();})();
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.