import { getStore, setWebSocketConfig } from "@boldpenguin/sdk-redux";
import { h } from "@stencil/core";
export class BpSdkRoot {
    constructor() {
        this.completedAt = undefined;
        this.disableWebSocket = false;
        this.enableLifecycleEvents = false;
        this.disableToolbar = false;
        this.storeLoaded = false;
    }
    onDisabledWebSocket(disableWebSocket) {
        getStore().dispatch(setWebSocketConfig({ enableWebsocket: !disableWebSocket }));
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.onDisabledWebSocket(this.disableWebSocket);
    }
    render() {
        return (h("bp-sdk-setup-container", { key: 'a132362f4aac425e45d1f0d56c699c7af6e88a62' }, h("bp-sdk-queue-container", { key: '59f6daf706464c8e10b80acf0392fba1770c9df7' }), [!!this.enableLifecycleEvents && h("bp-sdk-custom-event-container", { key: '107a066b011fff28ef51b27a2938a2e4dcc3fbe7' }), !this.disableToolbar && h("bp-sdk-interview-toolbar", { key: 'e863056c656bf26f3bc721cb2d9418da8b384c18' })], h("slot", { key: '9cd9dec6e53b5bbbb86c9c1bc12186ee3ca3db33' })));
    }
    static get is() { return "bp-sdk-root"; }
    static get properties() {
        return {
            "completedAt": {
                "type": "unknown",
                "mutable": true,
                "complexType": {
                    "original": "Date",
                    "resolved": "Date",
                    "references": {
                        "Date": {
                            "location": "global",
                            "id": "global::Date"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                }
            },
            "disableWebSocket": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Disable web socket"
                },
                "attribute": "disable-web-socket",
                "reflect": false,
                "defaultValue": "false"
            },
            "enableLifecycleEvents": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Disable lifecycle events, false by default"
                },
                "attribute": "enable-lifecycle-events",
                "reflect": false,
                "defaultValue": "false"
            },
            "disableToolbar": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Disable toolbar"
                },
                "attribute": "disable-toolbar",
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
    static get states() {
        return {
            "storeLoaded": {}
        };
    }
    static get watchers() {
        return [{
                "propName": "disableWebSocket",
                "methodName": "onDisabledWebSocket"
            }];
    }
}
