"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const React = __importStar(require("react"));
const prop_types_1 = __importDefault(require("prop-types"));
const react_stripe_elements_1 = require("react-stripe-elements");
const withStyles_1 = __importDefault(require("components/hoc/withStyles"));
const CardSection_1 = __importDefault(require("./CardSection"));
const styles_1 = __importDefault(require("./styles"));
class CreditCardDetailForm extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            elementFontSize: window.innerWidth < 450 ? "14px" : "18px"
        };
        window.addEventListener("resize", () => {
            if (window.innerWidth < 450 && this.state.elementFontSize !== "14px") {
                this.setState({ elementFontSize: "14px" });
            }
            else if (window.innerWidth >= 450 &&
                this.state.elementFontSize !== "18px") {
                this.setState({ elementFontSize: "18px" });
            }
        });
    }
    render() {
        const { classes } = this.props;
        const { elementFontSize } = this.state;
        return (React.createElement(react_stripe_elements_1.Elements, { fontSize: elementFontSize },
            React.createElement(CardSection_1.default, { classes: classes, fontSize: elementFontSize })));
    }
}
CreditCardDetailForm.propTypes = {
    classes: prop_types_1.default.any
};
exports.default = withStyles_1.default(styles_1.default)(CreditCardDetailForm);
//# sourceMappingURL=index.js.map