import { jsx as e } from "../../../../../preact@10.29.0/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { W as b, V as v, Q as g, A as S, E as w, c as E, d as P, I as k, e as I, D as C, T as D, f as _, S as x, n as T, g as A, av as L } from "./StoreProvider-CBB99upB.js";
import { useState as s, useEffect as N } from "../../../../../preact@10.29.0/node_modules/preact/hooks/dist/hooks.module.js";
try {
  let r = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, n = new r.Error().stack;
  n && (r._sentryDebugIds = r._sentryDebugIds || {}, r._sentryDebugIds[n] = "24d2268c-ad79-43ae-97bb-b4865bf93275", r._sentryDebugIdIdentifier = "sentry-dbid-24d2268c-ad79-43ae-97bb-b4865bf93275");
} catch {
}
const t = new CSSStyleSheet(), B = [t];
import("./styles-CLV89_hH.js").then(({ css: r }) => {
  t.replaceSync(r);
}).catch((r) => console.error("Error loading styles", r));
const G = ({
  children: r,
  rootLegalEntityId: n,
  settings: o,
  experiments: a,
  // HO-only
  refreshExperiments: i,
  // HO-only
  baseUrl: d,
  getSdkToken: l,
  componentName: c,
  locale: h
}) => {
  const [f, y] = s(!0), [u, m] = s(!1);
  return A(l), N(() => {
    L().then((p) => {
      p || m(!0), y(!1);
    });
  }, []), u ? /* @__PURE__ */ e("div", { children: [
    "Something went wrong, please",
    /* @__PURE__ */ e(b, { onClick: () => location.reload(), children: "refresh the page." })
  ] }) : f ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(x, { settings: o, children: /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(S, { rootLegalEntityId: n, baseUrl: d, children: /* @__PURE__ */ e(
    w,
    {
      experiments: a,
      refreshExperiments: i,
      children: /* @__PURE__ */ e(E, { children: [
        /* @__PURE__ */ e("span", { className: "adyen-kyc__sdk-version", hidden: !0, children: "4.0.0-compact.9" }),
        /* @__PURE__ */ e(
          P,
          {
            componentName: c,
            rootLegalEntityId: n,
            children: /* @__PURE__ */ e(k, { locale: h, children: /* @__PURE__ */ e(I, { children: [
              /* @__PURE__ */ e(C, {}),
              /* @__PURE__ */ e("div", { className: "adyen-kyc-ui-element-container-wrapper", children: /* @__PURE__ */ e("div", { className: "adyen-kyc-ui-element-container", children: /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(_, { children: r }) }) }) })
            ] }) })
          }
        )
      ] })
    }
  ) }) }) });
}, j = Object.freeze({
  live: "https://onboardingcomponents-live.adyen.com/",
  test: "https://test.adyen.com/"
}), M = (r) => j[r] ?? T(r);
export {
  G as E,
  M as r,
  B as s
};
