!function(){"use strict";const r=window.fetch.bind(window);let e=new Map;browser.runtime.onMessage.addListener(a=>"singlefile.fetchFrame"==a.method&&window.frameId&&window.frameId==a.frameId?async function(e){try{const a=await r(e.url,{cache:"force-cache",headers:e.headers,referrerPolicy:"strict-origin-when-cross-origin"});return{status:a.status,headers:[...a.headers],array:Array.from(new Uint8Array(await a.arrayBuffer()))}}catch(r){return{error:r&&(r.message||r.toString())}}}(a):"singlefile.fetchResponse"==a.method?async function(r){const a=e.get(r.requestId);a&&(r.error?(a.reject(new Error(r.error)),e.delete(r.requestId)):(r.truncated&&(a.array?a.array=a.array.concat(r.array):(a.array=r.array,e.set(r.requestId,a)),r.finished&&(r.array=a.array)),r.truncated&&!r.finished||(a.resolve({status:r.status,headers:{get:e=>r.headers&&r.headers[e]},arrayBuffer:async()=>new Uint8Array(r.array).buffer}),e.delete(r.requestId))));return{}}(a):void 0)}();
