"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var formik_1 = require("formik");
var InvoicingAddressForm = /** @class */ (function (_super) {
    __extends(InvoicingAddressForm, _super);
    function InvoicingAddressForm() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    InvoicingAddressForm.prototype.render = function () {
        var _a = this.props, errors = _a.errors, handleChange = _a.handleChange, setFieldTouched = _a.setFieldTouched, touched = _a.touched, values = _a.values;
        return (React.createElement(React.Fragment, null,
            React.createElement("div", { className: "row" },
                React.createElement("div", { className: "col-lg-6" },
                    React.createElement("div", { className: "checkout__input" },
                        React.createElement("p", null,
                            "Jm\u00E9no",
                            React.createElement("span", null, "*")),
                        React.createElement(formik_1.Field, { name: "invoicingAddress.firstName", placeholder: "Jm\u00E9no", value: values.firstName || '', onChange: function (event) {
                                setFieldTouched("invoicingAddress.firstName");
                                handleChange(event);
                            }, className: ((touched === null || touched === void 0 ? void 0 : touched.firstName) && (errors === null || errors === void 0 ? void 0 : errors.firstName))
                                ? 'input__error'
                                : (values.firstName && !(errors === null || errors === void 0 ? void 0 : errors.firstName) ? 'input__success' : '') }),
                        (errors === null || errors === void 0 ? void 0 : errors.firstName) && (touched === null || touched === void 0 ? void 0 : touched.firstName) && React.createElement("label", { className: "error-message" }, errors.firstName))),
                React.createElement("div", { className: "col-lg-6" },
                    React.createElement("div", { className: "checkout__input" },
                        React.createElement("p", null,
                            "P\u0159\u00EDjmen\u00ED",
                            React.createElement("span", null, "*")),
                        React.createElement(formik_1.Field, { name: "invoicingAddress.lastName", placeholder: "P\u0159\u00EDjmen\u00ED", value: values.lastName || '', onChange: function (event) {
                                setFieldTouched("invoicingAddress.lastName");
                                handleChange(event);
                            }, className: ((touched === null || touched === void 0 ? void 0 : touched.lastName) && (errors === null || errors === void 0 ? void 0 : errors.lastName))
                                ? 'input__error'
                                : (values.lastName && !(errors === null || errors === void 0 ? void 0 : errors.lastName) ? 'input__success' : '') }),
                        (errors === null || errors === void 0 ? void 0 : errors.lastName) && (touched === null || touched === void 0 ? void 0 : touched.lastName) && React.createElement("label", { className: "error-message" }, errors.lastName)))),
            React.createElement("div", { className: "checkout__input" },
                React.createElement("p", null,
                    "M\u011Bsto a ulice",
                    React.createElement("span", null, "*")),
                React.createElement(formik_1.Field, { name: "invoicingAddress.city", placeholder: "M\u011Bsto", value: values.city || '', onChange: function (event) {
                        setFieldTouched("invoicingAddress.city");
                        handleChange(event);
                    }, className: ((touched === null || touched === void 0 ? void 0 : touched.city) && (errors === null || errors === void 0 ? void 0 : errors.city))
                        ? 'checkout__input__add input__error'
                        : (values.city && !(errors === null || errors === void 0 ? void 0 : errors.city) ? 'checkout__input__add input__success' : 'checkout__input__add') }),
                (errors === null || errors === void 0 ? void 0 : errors.city) && (touched === null || touched === void 0 ? void 0 : touched.city) && React.createElement("label", { className: "error-message" }, errors.city),
                React.createElement(formik_1.Field, { name: "invoicingAddress.street", placeholder: "Ulice", value: values.street || '', onChange: function (event) {
                        setFieldTouched("invoicingAddress.street");
                        handleChange(event);
                    }, className: ((touched === null || touched === void 0 ? void 0 : touched.street) && (errors === null || errors === void 0 ? void 0 : errors.street))
                        ? 'input__error'
                        : (values.street && !(errors === null || errors === void 0 ? void 0 : errors.street) ? 'input__success' : '') }),
                (errors === null || errors === void 0 ? void 0 : errors.street) && (touched === null || touched === void 0 ? void 0 : touched.street) && React.createElement("label", { className: "error-message" }, errors.street)),
            React.createElement("div", { className: "checkout__input" },
                React.createElement("p", null,
                    "PS\u010C",
                    React.createElement("span", null, "*")),
                React.createElement(formik_1.Field, { name: "invoicingAddress.zipCode", placeholder: "Po\u0161tovn\u00ED sm\u011Brovac\u00ED \u010D\u00EDslo", value: values.zipCode || '', onChange: function (event) {
                        setFieldTouched("invoicingAddress.zipCode");
                        handleChange(event);
                    }, className: ((touched === null || touched === void 0 ? void 0 : touched.zipCode) && (errors === null || errors === void 0 ? void 0 : errors.zipCode))
                        ? 'input__error'
                        : (values.zipCode && !(errors === null || errors === void 0 ? void 0 : errors.zipCode) ? 'input__success' : '') }),
                (errors === null || errors === void 0 ? void 0 : errors.zipCode) && (touched === null || touched === void 0 ? void 0 : touched.zipCode) && React.createElement("label", { className: "error-message" }, errors.zipCode)),
            React.createElement("div", { className: "row" },
                React.createElement("div", { className: "col-lg-6" },
                    React.createElement("div", { className: "checkout__input" },
                        React.createElement("p", null,
                            "Telefonn\u00ED \u010D\u00EDslo",
                            React.createElement("span", null, "*")),
                        React.createElement(formik_1.Field, { name: "invoicingAddress.phoneNumber", placeholder: "Telefonn\u00ED \u010D\u00EDslo", value: values.phoneNumber || '', onChange: function (event) {
                                setFieldTouched("invoicingAddress.phoneNumber");
                                handleChange(event);
                            }, className: ((touched === null || touched === void 0 ? void 0 : touched.phoneNumber) && (errors === null || errors === void 0 ? void 0 : errors.phoneNumber))
                                ? 'input__error'
                                : (values.phoneNumber && !(errors === null || errors === void 0 ? void 0 : errors.phoneNumber) ? 'input__success' : '') }),
                        (errors === null || errors === void 0 ? void 0 : errors.phoneNumber) && (touched === null || touched === void 0 ? void 0 : touched.phoneNumber) && React.createElement("label", { className: "error-message" }, errors.phoneNumber))),
                React.createElement("div", { className: "col-lg-6" },
                    React.createElement("div", { className: "checkout__input" },
                        React.createElement("p", null,
                            "Email",
                            React.createElement("span", null, "*")),
                        React.createElement(formik_1.Field, { name: "invoicingAddress.email", type: "email", placeholder: "Email", value: values.email || '', onChange: function (event) {
                                setFieldTouched("invoicingAddress.email");
                                handleChange(event);
                            }, className: ((touched === null || touched === void 0 ? void 0 : touched.email) && (errors === null || errors === void 0 ? void 0 : errors.email))
                                ? 'input__error'
                                : (values.email && !(errors === null || errors === void 0 ? void 0 : errors.email) ? 'input__success' : '') }),
                        (errors === null || errors === void 0 ? void 0 : errors.email) && (touched === null || touched === void 0 ? void 0 : touched.email) && React.createElement("label", { className: "error-message" }, errors.email))))));
    };
    return InvoicingAddressForm;
}(React.Component));
exports.default = InvoicingAddressForm;
//# sourceMappingURL=InvoicingAddressForm.js.map