;
{
  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] = "8d78d6c2-df02-47fd-9896-888a2940182f", e._sentryDebugIdIdentifier = "sentry-dbid-8d78d6c2-df02-47fd-9896-888a2940182f");
  } 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 { M as ManageTransferInstrumentComponent } from "./ManageTransferInstrumentComponent-Df7W6e7W.js";
import { e as emitAdyenSdkEvent } from "./emitEvent-CzZf80Am.js";
const AdyenManageTransferInstruments = ({
  rootlegalentityid,
  fetchToken,
  environment,
  locale,
  settings = {},
  experiments = {}
}) => {
  const eventEmitterRef = useRef(null);
  const handleOnAdd = (rootLegalEntityId) => {
    emitAdyenSdkEvent(eventEmitterRef, "add", rootLegalEntityId);
  };
  const handleOnEdit = (transferInstrumentId) => {
    emitAdyenSdkEvent(eventEmitterRef, "edit", transferInstrumentId);
  };
  const handleOnRemove = (transferInstrumentId) => {
    emitAdyenSdkEvent(eventEmitterRef, "remove", transferInstrumentId);
  };
  return /* @__PURE__ */ jsx("div", { ref: eventEmitterRef, style: "width:100%;", children: /* @__PURE__ */ jsx(
    EmbedShell,
    {
      componentName: "adyen-transfer-instrument-management",
      rootLegalEntityId: rootlegalentityid,
      settings,
      experiments,
      getSdkToken: fetchToken,
      locale,
      baseUrl: resolveEnvironment(environment),
      children: /* @__PURE__ */ jsx(
        ManageTransferInstrumentComponent,
        {
          legalEntityId: rootlegalentityid,
          onAdd: handleOnAdd,
          onEdit: handleOnEdit,
          onRemoveSuccess: handleOnRemove
        }
      )
    }
  ) });
};
register(
  AdyenManageTransferInstruments,
  "adyen-transfer-instrument-management",
  ["rootlegalentityid", "fetchToken", "environment", "locale", "settings", "experiments"],
  { shadow: true, adoptedStyleSheets: stylesheets }
);
