import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { J as JustifiAnalytics } from './Analytics.js';
import { c as checkPkgVersion } from './check-pkg-version.js';
import { w as waitForConfig } from './config-state.js';
import { S as StyledHost } from './styled-host.js';
import './justifi-details2.js';
import './event-types.js';
import './justifi-radio-list-item2.js';
import { d as defineCustomElement$5 } from './bank-account-billing-form-simple2.js';
import { d as defineCustomElement$4 } from './custom-popper2.js';
import { d as defineCustomElement$3 } from './form-control-text2.js';
import { d as defineCustomElement$2 } from './form-control-tooltip2.js';

const JustifiBankAccountBillingFormSimple$1 = /*@__PURE__*/ proxyCustomElement(class JustifiBankAccountBillingFormSimple extends HTMLElement {
    constructor(registerHost) {
        super();
        if (registerHost !== false) {
            this.__registerHost();
        }
        this.__attachShadow();
    }
    async componentWillLoad() {
        await waitForConfig();
        checkPkgVersion();
        this.analytics = new JustifiAnalytics(this);
    }
    disconnectedCallback() {
        var _a;
        (_a = this.analytics) === null || _a === void 0 ? void 0 : _a.cleanup();
    }
    async getValues() {
        var _a, _b;
        return (_b = (_a = this.bankAccountBillingFormSimpleRef) === null || _a === void 0 ? void 0 : _a.getValues()) !== null && _b !== void 0 ? _b : {};
    }
    async validate() {
        var _a, _b;
        return (_b = (_a = this.bankAccountBillingFormSimpleRef) === null || _a === void 0 ? void 0 : _a.validate()) !== null && _b !== void 0 ? _b : { isValid: false, errors: {} };
    }
    render() {
        return (h(StyledHost, { key: '669227ed02e4f0791882b95ed814ea1865db80de' }, h("bank-account-billing-form-simple", { key: '97cbe9637d8969023b1f7d3a6b3091a246112032', legend: this.legend, ref: (el) => (this.bankAccountBillingFormSimpleRef = el) })));
    }
}, [257, "justifi-bank-account-billing-form-simple", {
        "legend": [1025],
        "getValues": [64],
        "validate": [64]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["justifi-bank-account-billing-form-simple", "bank-account-billing-form-simple", "custom-popper", "form-control-text", "form-control-tooltip"];
    components.forEach(tagName => { switch (tagName) {
        case "justifi-bank-account-billing-form-simple":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, JustifiBankAccountBillingFormSimple$1);
            }
            break;
        case "bank-account-billing-form-simple":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "custom-popper":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "form-control-text":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "form-control-tooltip":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}
defineCustomElement$1();

const JustifiBankAccountBillingFormSimple = JustifiBankAccountBillingFormSimple$1;
const defineCustomElement = defineCustomElement$1;

export { JustifiBankAccountBillingFormSimple, defineCustomElement };
