import { jsx as n } from "../../../../../preact@10.29.0/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import l from "classnames";
import { isValidElement as i, cloneElement as u } from "../../../../../preact@10.29.0/node_modules/preact/dist/preact.module.js";
import { W as f, V as b, B as S } from "./StoreProvider-CBB99upB.js";
try {
  let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, o = new e.Error().stack;
  o && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[o] = "4fa947b3-db0f-4fc4-b39d-1f0507fbacbe", e._sentryDebugIdIdentifier = "sentry-dbid-4fa947b3-db0f-4fc4-b39d-1f0507fbacbe");
} catch {
}
const L = "adyen-kyc-end-state-layout", m = "adyen-kyc-end-state-layout-header", I = "adyen-kyc-end-state-layout-icon", p = "adyen-kyc-end-state-layout-icon-success", g = "adyen-kyc-end-state-layout-icon-error", h = "adyen-kyc-end-state-layout-icon-info", k = "adyen-kyc-end-state-layout-icon-warning", w = "adyen-kyc-end-state-layout-title", E = "adyen-kyc-end-state-layout-description", N = "adyen-kyc-end-state-layout-action", t = {
  endStateLayout: L,
  endStateLayoutHeader: m,
  endStateLayoutIcon: I,
  endStateLayoutIconSuccess: p,
  endStateLayoutIconError: g,
  endStateLayoutIconInfo: h,
  endStateLayoutIconWarning: k,
  endStateLayoutTitle: w,
  endStateLayoutDescription: E,
  endStateLayoutAction: N
}, x = ({
  action: e,
  description: o,
  loading: c = !1,
  title: d,
  variant: a = "success"
}) => {
  if (e && (!i(e) || e.type !== f))
    throw new Error('EndStateLayout component only accepts Button component as "action".');
  const r = l(t.endStateLayoutIcon, {
    [t.endStateLayoutIconSuccess]: a === "success",
    [t.endStateLayoutIconError]: a === "error",
    [t.endStateLayoutIconWarning]: a === "warning",
    [t.endStateLayoutIconInfo]: a === "info" || a === "basic"
  }), y = {
    basic: "info-circle",
    error: "cross",
    info: "info-circle",
    success: "check",
    warning: "warning"
  }, s = e ? u(e, { disabled: c }) : null;
  return /* @__PURE__ */ n("article", { className: t.endStateLayout, children: [
    /* @__PURE__ */ n("header", { className: t.endStateLayoutHeader, children: [
      c ? /* @__PURE__ */ n("div", { className: t.endStateLayoutIcon, role: "progressbar", children: /* @__PURE__ */ n(b, {}) }) : /* @__PURE__ */ n("div", { className: r, role: "img", "aria-label": a, children: /* @__PURE__ */ n(S, { name: y[a] }) }),
      /* @__PURE__ */ n("h1", { className: t.endStateLayoutTitle, children: d }),
      o && /* @__PURE__ */ n("div", { className: t.endStateLayoutDescription, children: o })
    ] }),
    s && /* @__PURE__ */ n("div", { className: t.endStateLayoutAction, role: "toolbar", children: s })
  ] });
};
export {
  x as E
};
