import { options as c } from "../../dist/preact.module.mjs";
var n, u, h, E = [], a = [], m = c.__b, v = c.__r, H = c.diffed, s = c.__c, l = c.unmount;
function p() {
  for (var i; i = E.shift(); )
    if (i.__P && i.__H)
      try {
        i.__H.__h.forEach(f), i.__H.__h.forEach(e), i.__H.__h = [];
      } catch (o) {
        i.__H.__h = [], c.__e(o, i.__v);
      }
}
c.__b = function(i) {
  n = null, m && m(i);
}, c.__r = function(i) {
  v && v(i);
  var o = (n = i.__c).__H;
  o && (u === n ? (o.__h = [], n.__h = [], o.__.forEach(function(_) {
    _.__N && (_.__ = _.__N), _.__V = a, _.__N = _.i = void 0;
  })) : (o.__h.forEach(f), o.__h.forEach(e), o.__h = [])), u = n;
}, c.diffed = function(i) {
  H && H(i);
  var o = i.__c;
  o && o.__H && (o.__H.__h.length && (E.push(o) !== 1 && h === c.requestAnimationFrame || ((h = c.requestAnimationFrame) || y)(p)), o.__H.__.forEach(function(_) {
    _.i && (_.__H = _.i), _.__V !== a && (_.__ = _.__V), _.i = void 0, _.__V = a;
  })), u = n = null;
}, c.__c = function(i, o) {
  o.some(function(_) {
    try {
      _.__h.forEach(f), _.__h = _.__h.filter(function(r) {
        return !r.__ || e(r);
      });
    } catch (r) {
      o.some(function(t) {
        t.__h && (t.__h = []);
      }), o = [], c.__e(r, _.__v);
    }
  }), s && s(i, o);
}, c.unmount = function(i) {
  l && l(i);
  var o, _ = i.__c;
  _ && _.__H && (_.__H.__.forEach(function(r) {
    try {
      f(r);
    } catch (t) {
      o = t;
    }
  }), _.__H = void 0, o && c.__e(o, _.__v));
};
var d = typeof requestAnimationFrame == "function";
function y(i) {
  var o, _ = function() {
    clearTimeout(r), d && cancelAnimationFrame(o), setTimeout(i);
  }, r = setTimeout(_, 100);
  d && (o = requestAnimationFrame(_));
}
function f(i) {
  var o = n, _ = i.__c;
  typeof _ == "function" && (i.__c = void 0, _()), n = o;
}
function e(i) {
  var o = n;
  i.__c = i.__(), n = o;
}
