import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import React, { useState } from "react";
import { Checkbox, InputNumber } from "antd";
import { locales } from "@pisell/utils";
//#region src/components/authentication/admin/AuthMethods/components/PasswordRulesSettingsContent.tsx
const PasswordRulesSettingsContent = ({ onSettingsChange, initialSettings }) => {
	const [settings, setSettings] = useState(initialSettings !== null && initialSettings !== void 0 ? initialSettings : {
		minLength: 8,
		requireUppercase: false,
		requireLowercase: false,
		requireNumbers: false,
		requireSpecialChars: false
	});
	const updateSettings = (updates) => {
		const newSettings = _objectSpread2(_objectSpread2({}, settings), updates);
		setSettings(newSettings);
		onSettingsChange === null || onSettingsChange === void 0 || onSettingsChange(newSettings);
	};
	return /* @__PURE__ */ React.createElement("div", { className: "settings-section" }, /* @__PURE__ */ React.createElement("div", { className: "settings-section-title" }, locales.getText("auth.password.requirements.title")), /* @__PURE__ */ React.createElement("div", { className: "settings-section-description" }, locales.getText("auth.password.requirements.description")), /* @__PURE__ */ React.createElement("div", {
		className: "settings-item",
		style: {
			display: "flex",
			alignItems: "flex-start",
			gap: 32
		}
	}, /* @__PURE__ */ React.createElement("div", {
		className: "settings-item-content",
		style: { flex: "0 0 240px" }
	}, /* @__PURE__ */ React.createElement("div", { className: "settings-item-title" }, locales.getText("auth.password.min.length")), /* @__PURE__ */ React.createElement("div", { className: "settings-item-description" }, locales.getText("auth.password.min.length.description"))), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(InputNumber, {
		min: 6,
		max: 20,
		value: settings.minLength,
		onChange: (value) => updateSettings({ minLength: value || 8 }),
		style: {
			width: "100%",
			maxWidth: 400
		}
	}))), /* @__PURE__ */ React.createElement("div", {
		className: "settings-item",
		style: {
			display: "flex",
			alignItems: "flex-start",
			gap: 32
		}
	}, /* @__PURE__ */ React.createElement("div", {
		className: "settings-item-content",
		style: { flex: "0 0 240px" }
	}, /* @__PURE__ */ React.createElement("div", { className: "settings-item-title" }, locales.getText("auth.password.requirements")), /* @__PURE__ */ React.createElement("div", { className: "settings-item-description" }, locales.getText("auth.password.requirements.character"))), /* @__PURE__ */ React.createElement("div", { style: {
		flex: 1,
		display: "flex",
		flexDirection: "column",
		gap: 16
	} }, /* @__PURE__ */ React.createElement(Checkbox, {
		checked: settings.requireUppercase,
		onChange: (e) => updateSettings({ requireUppercase: e.target.checked })
	}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: {
		fontWeight: 500,
		fontSize: "14px",
		color: "#262626"
	} }, locales.getText("auth.password.require.uppercase")), /* @__PURE__ */ React.createElement("div", { style: {
		fontSize: "13px",
		color: "#8c8c8c"
	} }, locales.getText("auth.password.require.uppercase.description")))), /* @__PURE__ */ React.createElement(Checkbox, {
		checked: settings.requireLowercase,
		onChange: (e) => updateSettings({ requireLowercase: e.target.checked })
	}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: {
		fontWeight: 500,
		fontSize: "14px",
		color: "#262626"
	} }, locales.getText("auth.password.require.lowercase")), /* @__PURE__ */ React.createElement("div", { style: {
		fontSize: "13px",
		color: "#8c8c8c"
	} }, locales.getText("auth.password.require.lowercase.description")))), /* @__PURE__ */ React.createElement(Checkbox, {
		checked: settings.requireNumbers,
		onChange: (e) => updateSettings({ requireNumbers: e.target.checked })
	}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: {
		fontWeight: 500,
		fontSize: "14px",
		color: "#262626"
	} }, locales.getText("auth.password.require.numbers")), /* @__PURE__ */ React.createElement("div", { style: {
		fontSize: "13px",
		color: "#8c8c8c"
	} }, locales.getText("auth.password.require.numbers.description")))), /* @__PURE__ */ React.createElement(Checkbox, {
		checked: settings.requireSpecialChars,
		onChange: (e) => updateSettings({ requireSpecialChars: e.target.checked })
	}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: {
		fontWeight: 500,
		fontSize: "14px",
		color: "#262626"
	} }, locales.getText("auth.password.require.special")), /* @__PURE__ */ React.createElement("div", { style: {
		fontSize: "13px",
		color: "#8c8c8c"
	} }, locales.getText("auth.password.require.special.description")))))));
};
//#endregion
export { PasswordRulesSettingsContent as default };
