import u from "../../../@babel/runtime/helpers/esm/regeneratorRuntime.mjs";
import f from "../../../@babel/runtime/helpers/esm/asyncToGenerator.mjs";
import l from "../../../@babel/runtime/helpers/esm/typeof.mjs";
import p from "../../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import * as d from "../../../react-dom/index.mjs";
var t = p({}, d), R = t.version, v = t.render, E = t.unmountComponentAtNode, i;
try {
  var g = Number((R || "").split(".")[0]);
  g >= 18 && (i = t.createRoot);
} catch {
}
function s(e) {
  var r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
  r && l(r) === "object" && (r.usingClientEntryPoint = e);
}
var a = "__rc_react_root__";
function h(e, r) {
  s(!0);
  var o = r[a] || i(r);
  s(!1), o.render(e), r[a] = o;
}
function y(e, r) {
  v(e, r);
}
function w(e, r) {
  if (i) {
    h(e, r);
    return;
  }
  y(e, r);
}
function N(e) {
  return m.apply(this, arguments);
}
function m() {
  return m = f(/* @__PURE__ */ u().mark(function e(r) {
    return u().wrap(function(n) {
      for (; ; )
        switch (n.prev = n.next) {
          case 0:
            return n.abrupt("return", Promise.resolve().then(function() {
              var _;
              (_ = r[a]) === null || _ === void 0 || _.unmount(), delete r[a];
            }));
          case 1:
          case "end":
            return n.stop();
        }
    }, e);
  })), m.apply(this, arguments);
}
function O(e) {
  E(e);
}
function A(e) {
  return c.apply(this, arguments);
}
function c() {
  return c = f(/* @__PURE__ */ u().mark(function e(r) {
    return u().wrap(function(n) {
      for (; ; )
        switch (n.prev = n.next) {
          case 0:
            if (i === void 0) {
              n.next = 2;
              break;
            }
            return n.abrupt("return", N(r));
          case 2:
            O(r);
          case 3:
          case "end":
            return n.stop();
        }
    }, e);
  })), c.apply(this, arguments);
}
export {
  w as render,
  A as unmount
};
