import { jsx as e } from "../../../../../preact@10.29.0/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useState as I, useEffect as w } from "../../../../../preact@10.29.0/node_modules/preact/hooks/dist/hooks.module.js";
import { u as k, z as C, O as d, W as f } from "./StoreProvider-CBB99upB.js";
import { M as T } from "./Modal-BMdWqd0Y.js";
try {
  let n = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, s = new n.Error().stack;
  s && (n._sentryDebugIds = n._sentryDebugIds || {}, n._sentryDebugIds[s] = "47b3c569-46b0-4f41-96b6-a2cc21365ab0", n._sentryDebugIdIdentifier = "sentry-dbid-47b3c569-46b0-4f41-96b6-a2cc21365ab0");
} catch {
}
const D = "adyen-kyc-confirm", E = "adyen-kyc-confirm-message", M = "adyen-kyc-confirm-actions", t = {
  confirm: D,
  confirmMessage: E,
  confirmActions: M
}, N = ({
  description: n,
  cancelText: s,
  confirmText: y,
  critical: m = !1,
  onCancel: o,
  onConfirm: b,
  title: i,
  analyticsEventLabel: u
}) => {
  const { t: c } = k("ui"), h = C(), [r, l] = I(!1), p = o !== void 0, g = m ? "critical" : "primary";
  w(() => {
    h.addTaskEvent("Opened modal", {
      actionType: "open",
      label: u
    });
  }, []);
  const v = async () => {
    l(!0);
    try {
      await b();
    } finally {
      l(!1);
    }
  };
  return /* @__PURE__ */ e(T, { size: "small", transition: "dropIn", showCloseButton: !1, ariaLabel: i, children: /* @__PURE__ */ e("div", { className: t.confirm, children: [
    /* @__PURE__ */ e("div", { className: t.confirmMessage, children: [
      /* @__PURE__ */ e(d, { variant: "title", el: "h3", children: i }),
      n && /* @__PURE__ */ e(d, { variant: "body", el: "p", children: n })
    ] }),
    /* @__PURE__ */ e("div", { className: t.confirmActions, children: [
      p && /* @__PURE__ */ e(f, { onClick: o, variant: "secondary", disabled: r, children: s ?? c((a) => a.cancel) }),
      /* @__PURE__ */ e(f, { onClick: v, variant: g, loading: r, children: y ?? c((a) => a.confirm) })
    ] })
  ] }) });
};
export {
  N as C
};
