import { Q as QueryClient, j as jsxRuntimeExports, I as I18nextProvider, b as QueryClientProvider, W as WidgetsCoreContextProvider, c as WidgetsLoggerContextProvider, F as FeaturesContextProvider } from "./root-CqOwVDsl.js";
import { r as reactExports } from "./index-BKyMaBlO.js";
import { E as ErrorBoundary, a as Error, L as Loader } from "./loader-5BGkTPnX.js";
import { i as i18n } from "./groupBy-D_TkG_rU.js";
const View = reactExports.lazy(() => import("./view-T_jO6n1T.js"));
function Root(props) {
  const { t } = i18n;
  const queryClient = reactExports.useRef();
  queryClient.current ?? (queryClient.current = new QueryClient({
    defaultOptions: {
      queries: {
        staleTime: Infinity,
        // Queries should never be refetched
        // Failed queries are not subject to staleTime, disable refetch
        refetchOnReconnect: false,
        refetchOnWindowFocus: false
      }
    }
  }));
  return /* @__PURE__ */ jsxRuntimeExports.jsx(I18nextProvider, { i18n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(QueryClientProvider, { client: queryClient.current, children: /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetsCoreContextProvider, { core: props.core, children: /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetsLoggerContextProvider, { logger: props.logger, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FeaturesContextProvider, { features: props.config.features, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
    ErrorBoundary,
    {
      fallbackRender: ({ error, resetErrorBoundary }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Error, { error, reset: resetErrorBoundary, supportUrl: props.config.supportUrl }),
      onReset: () => {
        var _a;
        return (_a = queryClient.current) == null ? void 0 : _a.clear();
      },
      children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { label: t("loading") }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(View, { ...props }) })
    }
  ) }) }) }) }) });
}
export {
  Root as default
};
//# sourceMappingURL=root-B7SfLxu_.js.map
