import { jsx as e } from "../../../../../preact@10.29.0/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { defineSlots as l } from "../../../../../named-slots@0.4.2/node_modules/named-slots/dist/Slot.js";
import { u, z as y, aB as f, P as p, O as b, C as g } from "./StoreProvider-CBB99upB.js";
import { L as h } from "./List-BAzyC6sw.js";
import { S as v } from "./StructuredList-EKVbq_i3.js";
import { t as w } from "./trackNavigation-db_h46BT.js";
try {
  let t = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, n = new t.Error().stack;
  n && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[n] = "69b31980-5178-473c-a8f0-d7b5b7294cdf", t._sentryDebugIdIdentifier = "sentry-dbid-69b31980-5178-473c-a8f0-d7b5b7294cdf");
} catch {
}
const S = "adyen-kyc-summary-header", k = {
  summaryHeader: S
}, N = ({ children: t, handleEditForm: n, sections: i }) => {
  const { t: a } = u("common"), { Slot: s } = l(t, ["errorPanel", "extraContent"]), d = y();
  return /* @__PURE__ */ e("div", { role: "region", children: [
    /* @__PURE__ */ e(f, { title: a((r) => r.summary), description: a((r) => r.summaryDescription) }),
    /* @__PURE__ */ e(p, { children: [
      /* @__PURE__ */ e(s, { name: "errorPanel" }),
      i.map(({ formId: r, label: o, items: c }) => {
        if (r !== "summary")
          return /* @__PURE__ */ e(h, { variant: "grouped-secondary", children: [
            /* @__PURE__ */ e("header", { className: k.summaryHeader, children: [
              /* @__PURE__ */ e(b, { el: "h2", variant: "title", children: o }),
              /* @__PURE__ */ e(
                g,
                {
                  variant: "tertiary",
                  icon: "edit",
                  onClick: () => {
                    w({
                      userEvents: d,
                      actionType: "edit",
                      toForm: o,
                      label: "Pencil icon"
                    }), n(r);
                  },
                  ariaLabel: a((m) => m.editForm, { label: o })
                }
              )
            ] }),
            /* @__PURE__ */ e(v, { items: c ?? [] })
          ] }, r);
      }),
      /* @__PURE__ */ e(s, { name: "extraContent" })
    ] })
  ] });
};
export {
  N
};
