import { h, Host } from "@stencil/core";
import { checkoutStore } from "../../../store/checkout.store";
export class SaveNewPaymentMethod {
    constructor() {
        this.label = 'Save New Payment Method';
        this.isChecked = false;
        this.handleCheckboxChange = (_name, value) => {
            this.isChecked = value;
            checkoutStore.savePaymentMethod = value;
            this.checkboxChanged.emit(this.isChecked);
        };
    }
    render() {
        return (h(Host, { key: 'a5ecfa60f9f55bdb91343394c1dd5bea542c20ed', hidden: this.hidden }, h("form-control-checkbox", { key: '282476dea11415eeec68336577ff17a5c03baad2', label: this.label || 'Save New Payment Method', name: "saveNewPaymentMethod", checked: this.isChecked, inputHandler: this.handleCheckboxChange })));
    }
    static get is() { return "save-new-payment-method"; }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label",
                "defaultValue": "'Save New Payment Method'"
            },
            "hidden": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "hidden"
            }
        };
    }
    static get states() {
        return {
            "isChecked": {}
        };
    }
    static get events() {
        return [{
                "method": "checkboxChanged",
                "name": "checkboxChanged",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                }
            }];
    }
}
