import { clearListState as $ } from "./clear-list-state.mjs";
function d(i, e) {
  const n = i.substring(e.length + 1).split(".")[0];
  return parseInt(n, 10);
}
function p(i, e, n, a) {
  if (e === void 0)
    return n;
  const r = `${String(i)}`;
  let s = n;
  a === -1 && (s = $(`${r}.${e}`, s));
  const o = { ...s }, f = /* @__PURE__ */ new Set();
  return Object.entries(s).filter(([t]) => {
    if (!t.startsWith(`${r}.`))
      return !1;
    const c = d(t, r);
    return Number.isNaN(c) ? !1 : c >= e;
  }).forEach(([t, c]) => {
    const l = d(t, r), u = t.replace(
      `${r}.${l}`,
      `${r}.${l + a}`
    );
    o[u] = c, f.add(u), f.has(t) || delete o[t];
  }), o;
}
export {
  p as changeErrorIndices
};
//# sourceMappingURL=change-error-indices.mjs.map
