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] = "f175e55c-84d3-41c0-822a-11ffe4e3362f", e._sentryDebugIdIdentifier = "sentry-dbid-f175e55c-84d3-41c0-822a-11ffe4e3362f");
} catch (e) {}
import { t as useAnalyticsContext } from "./useAnalyticsContext-DfTXpZbA.js";
import cx from "classnames";
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
//#region src/components/ui/atoms/Checkbox/Checkbox.tsx
function Checkbox({ id, name, value, className, label, isInvalid, onChange, helper, checked, readonly, disabled, enableTracking = false, "aria-required": ariaRequired, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy }) {
	const userEvents = useAnalyticsContext();
	const handleChange = (newValue) => {
		if (enableTracking) userEvents.addFieldEvent("Interacted with form field", {
			actionType: "input",
			field: name,
			returnValue: String(newValue)
		});
		onChange(newValue);
	};
	const helperId = `${id}-helper`;
	return /* @__PURE__ */ jsxs(Fragment, { children: [
		/* @__PURE__ */ jsx("input", {
			id,
			name,
			value,
			"aria-describedby": `${helper ? helperId : ""} ${ariaDescribedBy ?? ""}`.trim(),
			"aria-invalid": ariaInvalid || isInvalid,
			"aria-required": ariaRequired,
			readOnly: readonly,
			disabled,
			checked,
			className: cx([
				"adyen-kyc-checkbox__input",
				[className],
				{ "adyen-kyc-checkbox__input--invalid": isInvalid }
			]),
			type: "checkbox",
			onClick: (event) => {
				event.stopPropagation();
				handleChange(!checked);
			}
		}),
		/* @__PURE__ */ jsx("label", {
			htmlFor: id,
			className: "adyen-kyc-checkbox__label",
			children: label
		}),
		helper && /* @__PURE__ */ jsx("span", {
			id: helperId,
			className: "adyen-kyc-checkbox__helper-text",
			children: helper
		})
	] });
}
//#endregion
export { Checkbox as t };
