import { h } from "@stencil/core";
export class BpSdkBusinessClassificationSelectorNudge {
    constructor() {
        this.onYesClick = (evt) => {
            var _a;
            this.handleYesClick((_a = this.refilter) === null || _a === void 0 ? void 0 : _a.key, evt);
        };
        this.onNoClick = (evt) => {
            var _a;
            this.handleNoClick((_a = this.refilter) === null || _a === void 0 ? void 0 : _a.key, evt);
        };
        this.useExternal = false;
        this.refilter = undefined;
        this.handleYesClick = undefined;
        this.handleNoClick = undefined;
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-business-classification-selector-nudge');
        customElements.whenDefined('bp-sdk-external-business-classification-selector-nudge').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (h("bp-sdk-external-business-classification-selector-nudge", { refilter: this.refilter, handleYesClick: this.handleYesClick, handleNoClick: this.handleNoClick }));
    }
    renderInternal() {
        var _a;
        return (h("div", { class: "bp-sdk-business-classification-selector-nudge__container" }, h("span", { class: "bp-sdk-business-classification-selector-nudge__question" }, (_a = this.refilter) === null || _a === void 0 ? void 0 : _a.text), h("button", { class: "bp-sdk-business-classification-selector-nudge__btn bp-sdk-business-classification-selector-nudge__btn--yes", onClick: this.onYesClick }, "Yes"), h("button", { class: "bp-sdk-business-classification-selector-nudge__btn bp-sdk-business-classification-selector-nudge__btn--no", onClick: this.onNoClick }, "No")));
    }
    static get is() { return "bp-sdk-business-classification-selector-nudge"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-business-classification-selector-nudge.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-business-classification-selector-nudge.css"]
        };
    }
    static get properties() {
        return {
            "refilter": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IRefilter",
                    "resolved": "IRefilter",
                    "references": {
                        "IRefilter": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IRefilter"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Refilter/nudge item"
                }
            },
            "handleYesClick": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "(key: number, evt?: MouseEvent) => void",
                    "resolved": "(key: number, evt?: MouseEvent) => void",
                    "references": {
                        "MouseEvent": {
                            "location": "global",
                            "id": "global::MouseEvent"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Function passed in from container that should be called when a user answers the \"yes\" question"
                }
            },
            "handleNoClick": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "(key: number, evt?: MouseEvent) => void",
                    "resolved": "(key: number, evt?: MouseEvent) => void",
                    "references": {
                        "MouseEvent": {
                            "location": "global",
                            "id": "global::MouseEvent"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Function passed in from container that should be called when a user answers the \"no\" question"
                }
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
