import { y as u, h as d, a as _, a1 as y, bs as g, a0 as h, a2 as p, aB as b, aI as w, aC as O, s as R, as as t } from "./index-DRgrWhNH.js";
import { y as m, z as C } from "./AssetItem-ufNA-vj9.js";
function D(c, v, i = !1, o = !1, E = !1) {
  var l = c, r = "";
  u(() => {
    var f = (
      /** @type {Effect} */
      y
    );
    if (r === (r = v() ?? "")) {
      d && _();
      return;
    }
    if (f.nodes !== null && (g(
      f.nodes.start,
      /** @type {TemplateNode} */
      f.nodes.end
    ), f.nodes = null), r !== "") {
      if (d) {
        h.data;
        for (var a = _(), n = a; a !== null && (a.nodeType !== p || /** @type {Comment} */
        a.data !== ""); )
          n = a, a = b(a);
        if (a === null)
          throw w(), O;
        m(h, n), l = R(a);
        return;
      }
      var s = r + "";
      i ? s = `<svg>${s}</svg>` : o && (s = `<math>${s}</math>`);
      var e = C(s);
      if ((i || o) && (e = /** @type {Element} */
      t(e)), m(
        /** @type {TemplateNode} */
        t(e),
        /** @type {TemplateNode} */
        e.lastChild
      ), i || o)
        for (; t(e); )
          l.before(
            /** @type {TemplateNode} */
            t(e)
          );
      else
        l.before(e);
    }
  });
}
export {
  D as h
};
//# sourceMappingURL=html-C8LCprZP.js.map
