import { h } from "@stencil/core";
export class BpSdkBusinessClassificationSelector {
    constructor() {
        this.answerId = undefined;
        this.questionId = undefined;
        this.code = undefined;
        this.fieldType = undefined;
        this.choiceId = undefined;
        this.choices = [];
        this.selectedChoices = [];
        this.placeholder = '';
        this.required = false;
        this.errors = undefined;
        this.errorText = undefined;
        this.labelId = undefined;
        this.showChoices = false;
        this.touched = false;
        this.pristine = true;
        this.isCompleted = false;
        this.isReadOnly = false;
        this.label = undefined;
        this.labelledBy = undefined;
        this.showNaicsCode = undefined;
        this.showConfidence = undefined;
        this.helpText = undefined;
        this.answeredBySource = undefined;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-business-classification-selector');
        customElements.whenDefined('bp-sdk-external-business-classification-selector').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (h("bp-sdk-external-business-classification-selector", { answerId: this.answerId, choiceId: this.choiceId, choices: this.choices, code: this.code, errors: this.errors, errorText: this.errorText, fieldType: this.fieldType, helpText: this.helpText, answeredBySource: this.answeredBySource, isCompleted: this.isCompleted, isReadOnly: this.isReadOnly, label: this.label, labelId: this.labelId, labelledBy: this.labelledBy, placeholder: this.placeholder, pristine: this.pristine, questionId: this.questionId, required: this.required, selectedChoices: this.selectedChoices, showChoices: this.showChoices, showConfidence: this.showConfidence, showNaicsCode: this.showNaicsCode, touched: this.touched }));
    }
    renderInternal() {
        var _a;
        return (h("div", { class: "bp-sdk-business-classification-selector__container" }, h("bp-sdk-autocomplete-input", { answerId: this.answerId, choiceId: this.choiceId, choices: this.selectedChoices, disableDropdown: true, errors: this.errors, errorText: this.errorText, answeredBySource: this.answeredBySource, fieldType: this.fieldType, isCompleted: this.isCompleted, isReadOnly: this.isReadOnly, label: this.label, labelId: this.labelId, labelledBy: this.labelledBy, placeholder: this.placeholder, pristine: this.pristine, questionId: this.questionId, required: this.required, touched: this.touched }), this.showChoices && !!((_a = this.choices) === null || _a === void 0 ? void 0 : _a.length) && !this.isReadOnly && (h("bp-sdk-business-classification-selector-list-container", { choices: this.choices, choiceId: this.choiceId, showNaicsCode: this.showNaicsCode, showConfidence: this.showConfidence }))));
    }
    static get is() { return "bp-sdk-business-classification-selector"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-business-classification-selector.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-business-classification-selector.css"]
        };
    }
    static get properties() {
        return {
            "answerId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Answer id"
                },
                "attribute": "answer-id",
                "reflect": false
            },
            "questionId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Question id"
                },
                "attribute": "question_id",
                "reflect": false
            },
            "code": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Question code"
                },
                "attribute": "code",
                "reflect": false
            },
            "fieldType": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Field type"
                },
                "attribute": "field_type",
                "reflect": false
            },
            "choiceId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "*\nSelected choice id"
                },
                "attribute": "choice_id",
                "reflect": false
            },
            "choices": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IChoice[]",
                    "resolved": "IChoice[]",
                    "references": {
                        "IChoice": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IChoice"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "*\nChoices to display"
                },
                "defaultValue": "[]"
            },
            "selectedChoices": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IChoice[]",
                    "resolved": "IChoice[]",
                    "references": {
                        "IChoice": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IChoice"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Selected answer choice, wrapped in an array"
                },
                "defaultValue": "[]"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Placeholder to display"
                },
                "attribute": "placeholder",
                "reflect": false,
                "defaultValue": "''"
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Is required"
                },
                "attribute": "required",
                "reflect": false,
                "defaultValue": "false"
            },
            "errors": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "string[] | undefined",
                    "resolved": "string[]",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Error messages"
                }
            },
            "errorText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string | undefined",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Error text"
                },
                "attribute": "error_text",
                "reflect": false
            },
            "labelId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Aria label id's that describes input for screen readers"
                },
                "attribute": "label-id",
                "reflect": false
            },
            "showChoices": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Show choices"
                },
                "attribute": "show_choices",
                "reflect": false,
                "defaultValue": "false"
            },
            "touched": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Is touched"
                },
                "attribute": "touched",
                "reflect": false,
                "defaultValue": "false"
            },
            "pristine": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Is pristine"
                },
                "attribute": "pristine",
                "reflect": false,
                "defaultValue": "true"
            },
            "isCompleted": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Is answer in complete state"
                },
                "attribute": "is_completed",
                "reflect": false,
                "defaultValue": "false"
            },
            "isReadOnly": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "When true, the field will be readonly. It will display only the label and value as plain text."
                },
                "attribute": "is-read-only",
                "reflect": false,
                "defaultValue": "false"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Label to use"
                },
                "attribute": "label",
                "reflect": false
            },
            "labelledBy": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Labels that describe group"
                },
                "attribute": "labelled-by",
                "reflect": false
            },
            "showNaicsCode": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Should show Naics code"
                },
                "attribute": "show-naics-code",
                "reflect": false
            },
            "showConfidence": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Should show confidence"
                },
                "attribute": "show-confidence",
                "reflect": false
            },
            "helpText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Help text"
                },
                "attribute": "help-text",
                "reflect": false
            },
            "answeredBySource": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string | undefined",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Specifically how the question was answered (ie. \"ACORD 126\")"
                },
                "attribute": "answered-by-source",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
