import { m as i } from "./publicApi-fkG2o0UD.js";
import { useEffect as a } from "react";
import { d as u, E as p, a as m } from "./EnterpriseViewOnlyPreset-CW0maUhb.js";
import { w as d, h as _, g as l } from "./utils-BXswP1HG.js";
const y = ({
  dashboardDefinition: o
}) => (a(() => {
  d(
    '[data-input-id="resource_tab_input"]',
    "#resource_tab_description_viz"
  );
}, []), a(() => {
  const r = (t) => {
    const e = t.querySelector(
      '[data-test="viz-waiting-for-input-message"]'
    );
    e?.textContent === "No search results returned" && (e.textContent = "No results found. Resource consumption may not be supported for your operating system.");
  }, n = { childList: !0, subtree: !0 }, c = (t) => {
    t.forEach((e) => {
      e.type === "childList" && e.addedNodes.length > 0 && e.target.dataset.test === "viz-size-wrapper" && r(e.target);
    });
  }, s = new MutationObserver(c);
  return _(
    "#resource_tab_cpu_consumption_viz",
    "#resource_tab_memory_consumption_viz",
    () => {
      const t = document.querySelector("#resource_tab_cpu_consumption_viz"), e = document.querySelector(
        "#resource_tab_memory_consumption_viz"
      );
      t && (r(t), s.observe(t, n)), e && (r(e), s.observe(e, n));
    },
    400,
    4e3
  ), () => {
    s.disconnect();
  };
}, [o]), o ? /* @__PURE__ */ i.jsx(
  u.DashboardContextProvider,
  {
    preset: p,
    initialDefinition: o,
    children: /* @__PURE__ */ i.jsx(m.DashboardCore, { width: "100%", height: "auto", actionMenus: l("error") })
  }
) : null);
export {
  y as ResourceDashboard,
  y as default
};
