function s(e, n) {
  return `render_v2_${e}_${n}`;
}
function u(e, n) {
  return `render_${e}_${n}`;
}
function o(e, n) {
  return `unmount_${e}_${n}`;
}
function a(e, n) {
  return `observable_${e}_${n}`;
}
function r(e) {
  return e instanceof Error && /abort/i.test(e.message);
}
function i(e, n) {
  return e instanceof Error && e.message ? e.message : n;
}
function d(e, n) {
  return e instanceof Error ? new Error(`${n}: ${e.message}`) : new Error(n);
}
function f(e) {
  if (typeof e != "object" || e === null)
    return !1;
  const t = e["src/index.tsx"];
  return typeof t != "object" || t === null ? !1 : typeof t.file == "string";
}
function l(e, n) {
  return `${e}/manifest.json?rnd=${Math.random()}`;
}
function c(e, n) {
  return n ? `${e}/src/index.tsx?rnd=${Math.random()}` : `${e}/src/index.tsx`;
}
function $(e) {
  if (r(e))
    return !1;
  const n = i(e, "")?.toLowerCase() ?? "";
  return n.includes("manifest request failed with status 404") || n.includes("manifest is missing the required src/index.tsx entry") || n.includes("unexpected token") || n.includes("json");
}
function m(e) {
  return {
    ...e.emergeType ? { emergeType: e.emergeType } : {},
    ...e.hostRuntime ? { hostRuntime: e.hostRuntime } : {},
    ...e.loggedUser ? { loggedUser: e.loggedUser } : {}
  };
}
function g(e, n) {
  const t = `${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)}_rnd_${Math.round(
    Math.random() * 1e3
  )}`;
  return {
    divContainerId: `container_${e}_${n}_${t}`,
    scriptId: `script_${n}_${t}`,
    moduleId: n
  };
}
export {
  u as buildLegacyRenderKey,
  m as buildLegacyRenderOptions,
  c as buildLocalDevEntryUrl,
  g as buildMFInstanceIds,
  l as buildManifestUrl,
  a as buildObservableKey,
  s as buildRenderV2Key,
  o as buildUnmountKey,
  i as getFailureDetail,
  r as isAbortLikeError,
  f as isMFManifest,
  $ as shouldUseLocalDevEntryFallback,
  d as toError
};
