import { r as registerInstance, h } from './index-77a9c9e7.js';

const bpSdkPendingProcessCss = ".small-print{font-size:0.75rem}";
const BpSdkPendingProcessStyle0 = bpSdkPendingProcessCss;

const BpSdkPendingProcess = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.pendingProcesses = undefined;
        this.useExternal = false;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-pending-process');
        customElements.whenDefined('bp-sdk-external-pending-process').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-pending-process", { pendingProcesses: this.pendingProcesses });
    }
    renderInternal() {
        var _a;
        const classNaming = (process) => `bp-sdk-pending-process-item__${process.state}`;
        return ((_a = this.pendingProcesses) === null || _a === void 0 ? void 0 : _a.length) ?
            (h("div", { class: "bp-sdk-pending-process__container" }, this.pendingProcesses.map(process => (h("div", { class: classNaming(process) }, h("p", null, process.job_type), h("p", { class: "small-print" }, process.state))))))
            : null;
    }
};
BpSdkPendingProcess.style = BpSdkPendingProcessStyle0;

export { BpSdkPendingProcess as bp_sdk_pending_process };
