import{a6 as a}from"./c.998383f4.js";const t=async t=>{let r;try{r=await fetch(a(t,!0))}catch(a){throw new Error(`Downloading firmware failed: ${a}`)}if(!r.ok)throw new Error(`Downloading firmware failed: ${r.status}`);return[{data:await r.arrayBuffer(),offset:0}]},r=async(a,t,r,o)=>{const e=await a.runStub();r&&await e.eraseFlash();let f=0;for(const a of t)f+=a.data.byteLength;let s=0,n=0;o(0);for(const a of t)await e.flashData(a.data,(a=>{const t=Math.floor((n+a)/f*100);t!==s&&(s=t,o(t))}),a.offset,!0),n+=a.data.byteLength;o(100)};export{r as f,t as g};
