function p(h) {
  let n = [], s = [], i = 0, f = !1, o = !1;
  const l = /* @__PURE__ */ new WeakSet(), u = {
    schedule: (e, t = !1, r = !1) => {
      const d = r && f, c = d ? n : s;
      return t && l.add(e), c.indexOf(e) === -1 && (c.push(e), d && f && (i = n.length)), e;
    },
    cancel: (e) => {
      const t = s.indexOf(e);
      t !== -1 && s.splice(t, 1), l.delete(e);
    },
    process: (e) => {
      if (f) {
        o = !0;
        return;
      }
      if (f = !0, [n, s] = [s, n], s.length = 0, i = n.length, i)
        for (let t = 0; t < i; t++) {
          const r = n[t];
          r(e), l.has(r) && (u.schedule(r), h());
        }
      f = !1, o && (o = !1, u.process(e));
    }
  };
  return u;
}
export {
  p as createRenderStep
};
//# sourceMappingURL=create-render-step.es.js.map
