import{idbSet as r,idbGet as s}from"./idb-kv-Dhbo4CRD.js";const e="vibefilter_error_log",u=1440*60*1e3;function f(t){const n=Date.now()-u;return t.filter(o=>{try{return new Date(o.ts).getTime()>=n}catch{return!0}})}async function g(){const t=await s(e)||[],n=f(t);return n.length!==t.length&&await r(e,n),n}async function l(t){if(t.length===0)return;const n=await g(),o=new Date().toISOString(),a=t.map(c=>({ts:o,msg:c})),i=[...n,...a].slice(-500);await r(e,i)}async function p(){await r(e,[])}export{l as a,p as c,g};
