;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "700425bf-3eeb-4b3f-83cb-8ff3fe8a4382", e._sentryDebugIdIdentifier = "sentry-dbid-700425bf-3eeb-4b3f-83cb-8ff3fe8a4382");
  } catch (e) {
  }
}
;
import { jsx } from "preact/jsx-runtime";
import { useRef } from "preact/hooks";
import register from "preact-custom-element";
import { s as stylesheets, E as EmbedShell, r as resolveEnvironment } from "./resolveEnvironment-cyRWc5YB.js";
import { C as CreateIndividualComponent } from "./CreateIndividualComponent-HE4NLlav.js";
import { e as emitAdyenSdkEvent } from "./emitEvent-CzZf80Am.js";
const AdyenIndividual = ({
  rootlegalentityid,
  fetchToken,
  environment,
  locale,
  settings = {},
  experiments = {},
  view
}) => {
  const eventEmitterRef = useRef(null);
  const handleOnComplete = (data) => {
    emitAdyenSdkEvent(eventEmitterRef, "complete", data);
  };
  const handleOnClose = () => {
    emitAdyenSdkEvent(eventEmitterRef, "close");
  };
  return /* @__PURE__ */ jsx("div", { ref: eventEmitterRef, style: "width:100%;", children: /* @__PURE__ */ jsx(
    EmbedShell,
    {
      componentName: "adyen-individual-configuration",
      rootLegalEntityId: rootlegalentityid,
      settings,
      experiments,
      getSdkToken: fetchToken,
      locale,
      baseUrl: resolveEnvironment(environment),
      children: /* @__PURE__ */ jsx(
        CreateIndividualComponent,
        {
          legalEntityId: rootlegalentityid,
          onSubmitSuccess: handleOnComplete,
          modalView: view === "modal",
          onClose: handleOnClose
        }
      )
    }
  ) });
};
register(
  AdyenIndividual,
  "adyen-individual-configuration",
  ["rootlegalentityid", "environment", "locale", "fetchToken", "settings", "experiments", "view"],
  { shadow: true, adoptedStyleSheets: stylesheets }
);
export {
  AdyenIndividual
};
