/*!
 * Built by ShiftSoftware
 * Copyright (c)
 */
import { Host, h } from "@stencil/core";
import cn from "../../global/lib/cn";
import warrantySchema from "../../locales/vehicleLookup/warranty/type";
import CardsContainer from "./components/CardsContainer";
import XIcon from "~assets/x-mark.svg";
import CheckIcon from "~assets/check.svg";
import { VehicleInfoLayout } from "../../features/vehicle-info-layout/index";
import { smartInvokable } from "../../features/blazor-ref/index";
import { setVehicleLookupData, setVehicleLookupErrorState } from "../../features/vehicle-lookup-component/vehicle-lookup-api-integration";
import { getLocaleLanguage, getSharedLocal, sharedLocalesSchema } from "../../features/multi-lingual/index";
export class VehicleWarrantyDetails {
    constructor() {
        // #region Localization
        this.language = 'en';
        this.locale = Object.assign({ sharedLocales: sharedLocalesSchema.getDefault() }, warrantySchema.getDefault());
        // #endregion
        // #region Vehicle info layout prop
        this.coreOnly = false;
        this.disableVinValidation = false;
        this.headers = {};
        this.queryString = '';
        this.isError = false;
        this.isLoading = false;
        // #endregion
        // #region Component Logic
        this.showSsc = false;
        this.recaptchaKey = '';
        this.mockRecaptcha = false;
        this.showWarranty = false;
        this.unauthorizedSscLookupBaseUrl = '';
        this.unauthorizedSscLookupQueryString = '';
        this.cityId = null;
        this.cityIntegrationId = null;
        this.companyId = null;
        this.companyIntegrationId = null;
        this.companyBranchId = null;
        this.companyBranchIntegrationId = null;
        this.userId = null;
        this.brandIntegrationId = null;
        this.customerName = null;
        this.customerPhone = null;
        this.customerEmail = null;
        this.showRecaptcha = false;
        this.unInvoicedByBrokerName = null;
        this.checkingUnauthorizedSSC = false;
        this.devRecaptchaChecked = false;
        this.recaptchaRes = null;
        this.handleDevRecaptchaClick = async () => {
            if (this.devRecaptchaChecked)
                return;
            if (!this.mockRecaptchaTrigger)
                return;
            this.devRecaptchaChecked = true;
            await this.mockRecaptchaTrigger();
        };
        this.syncRecaptchaPosition = () => {
            if (!this.recaptchaPlaceholderRef || !this.showRecaptcha)
                return;
            const rect = this.recaptchaPlaceholderRef.getBoundingClientRect();
            this.recaptchaPortalEl.style.top = `${rect.top}px`;
            this.recaptchaPortalEl.style.left = `${rect.left}px`;
            const opacity = this.getAncestorOpacity();
            this.recaptchaPortalEl.style.opacity = String(opacity);
            this.recaptchaPortalEl.style.pointerEvents = opacity < 0.1 ? 'none' : 'auto';
            this.positionRAF = requestAnimationFrame(this.syncRecaptchaPosition);
        };
    }
    async componentWillLoad() {
        await this.changeLanguage(this.language);
    }
    async changeLanguage(newLanguage) {
        const [sharedLocales, locale] = await Promise.all([getSharedLocal(newLanguage), getLocaleLanguage(newLanguage, 'vehicleLookup.warranty', warrantySchema)]);
        this.locale = Object.assign({ sharedLocales }, locale);
    }
    async setMockData(newMockData) {
        this.mockData = newMockData;
    }
    async fetchVin(newData, headers = {}) {
        this.recaptchaRes = null;
        this.showRecaptcha = false;
        clearInterval(this.recaptchaIntervalRef);
        await setVehicleLookupData(this, newData, headers, {
            beforeAssignment: async (response, { scopedTimeoutRef }) => {
                var _a, _b, _c;
                if (((_a = response === null || response === void 0 ? void 0 : response.saleInformation) === null || _a === void 0 ? void 0 : _a.broker) !== null && ((_c = (_b = response === null || response === void 0 ? void 0 : response.saleInformation) === null || _b === void 0 ? void 0 : _b.broker) === null || _c === void 0 ? void 0 : _c.invoiceDate) === null)
                    this.unInvoicedByBrokerName = response.saleInformation.broker.brokerName;
                else
                    this.unInvoicedByBrokerName = null;
                await this.handleInitializingRecaptcha(response, scopedTimeoutRef);
                return response;
            },
        });
    }
    async setErrorMessage(message) {
        setVehicleLookupErrorState(this, message);
    }
    async clearData() {
        this.vehicleLookup = undefined;
        this.recaptchaRes = null;
        this.showRecaptcha = false;
        this.devRecaptchaChecked = false;
        this.checkingUnauthorizedSSC = false;
        this.isError = false;
        this.errorMessage = undefined;
        this.isLoading = false;
        clearInterval(this.recaptchaIntervalRef);
    }
    onLoadingChange(newValue) {
        smartInvokable.bind(this)(this.loadingStateChange, newValue);
    }
    async setBlazorRef(newBlazorRef) {
        this.blazorRef = newBlazorRef;
    }
    get useMockRecaptchaWidget() {
        return this.isDev || this.mockRecaptcha;
    }
    async runUnauthorizedSscLookup(newVehicleLookup, recaptchaToken, scopedTimeoutRef) {
        this.checkingUnauthorizedSSC = true;
        if (this.isDev) {
            await new Promise(r => setTimeout(r, 3000));
            this.checkingUnauthorizedSSC = false;
            const randomValue = Math.random();
            const devSscLookupStatus = randomValue < 0.33 ? 0 : (randomValue > 0.33 && randomValue < 0.66) ? 2 : 1;
            this.recaptchaRes = {
                status: devSscLookupStatus === 0 ? 'noRecall' :
                    devSscLookupStatus === 2 ? 'noApplicableVehicleFound' :
                        'recallExists'
            };
            smartInvokable.bind(this)(this.unauthorizedSscLookupResponse, devSscLookupStatus);
            return;
        }
        const response = await fetch(`${this.unauthorizedSscLookupBaseUrl}${newVehicleLookup === null || newVehicleLookup === void 0 ? void 0 : newVehicleLookup.vin}/${newVehicleLookup === null || newVehicleLookup === void 0 ? void 0 : newVehicleLookup.sscLogId}?${this.unauthorizedSscLookupQueryString}`, {
            signal: this.abortController.signal,
            headers: Object.assign(Object.assign({}, this.headers), { 'Ssc-Recaptcha-Token': recaptchaToken }),
        });
        const vinResponse = await response.json();
        if (vinResponse && this.networkTimeoutRef === scopedTimeoutRef) {
            this.checkingUnauthorizedSSC = false;
            this.recaptchaRes = {
                status: vinResponse.sscLookupStatus === 0 ? 'noRecall' :
                    vinResponse.sscLookupStatus === 1 ? 'recallExists' :
                        vinResponse.sscLookupStatus === 2 ? 'noApplicableVehicleFound' : null
            };
            smartInvokable.bind(this)(this.unauthorizedSscLookupResponse, vinResponse.sscLookupStatus);
        }
        else
            throw new Error('wrongResponseFormat');
    }
    async handleInitializingRecaptcha(newVehicleLookup, scopedTimeoutRef) {
        if ((newVehicleLookup === null || newVehicleLookup === void 0 ? void 0 : newVehicleLookup.isAuthorized) === false && this.showSsc && this.recaptchaKey !== '') {
            this.devRecaptchaChecked = false;
            if (this.useMockRecaptchaWidget) {
                this.mockRecaptchaTrigger = () => this.runUnauthorizedSscLookup(newVehicleLookup, 'mock-recaptcha-token', scopedTimeoutRef);
                this.showRecaptcha = true;
                return;
            }
            if (this.recaptchaWidgetId !== undefined) {
                grecaptcha.reset(this.recaptchaWidgetId);
            }
            this.recaptchaIntervalRef = setInterval(async () => {
                const recaptchaResponse = grecaptcha.getResponse(this.recaptchaWidgetId);
                if (recaptchaResponse) {
                    clearInterval(this.recaptchaIntervalRef);
                    await this.runUnauthorizedSscLookup(newVehicleLookup, recaptchaResponse, scopedTimeoutRef);
                }
            }, 500);
            this.showRecaptcha = true;
        }
        else {
            this.showRecaptcha = false;
        }
    }
    async componentDidLoad() {
        if (this.useMockRecaptchaWidget)
            return;
        if (this.recaptchaKey !== '') {
            this.recaptchaPortalEl = document.createElement('div');
            this.recaptchaPortalEl.style.cssText = 'position: fixed; z-index: 1; display: none;';
            document.body.appendChild(this.recaptchaPortalEl);
            const script = document.createElement('script');
            script.src = 'https://www.google.com/recaptcha/api.js?render=explicit';
            script.async = true;
            script.defer = true;
            script.onload = () => {
                grecaptcha.ready(() => {
                    this.recaptchaWidgetId = grecaptcha.render(this.recaptchaPortalEl, { sitekey: this.recaptchaKey });
                });
            };
            document.head.appendChild(script);
        }
    }
    disconnectedCallback() {
        cancelAnimationFrame(this.positionRAF);
        clearInterval(this.recaptchaIntervalRef);
        if (this.recaptchaPortalEl) {
            this.recaptchaPortalEl.remove();
        }
    }
    onShowRecaptchaChange(show) {
        if (!this.recaptchaPortalEl)
            return;
        if (show) {
            this.recaptchaPortalEl.style.display = 'block';
            this.syncRecaptchaPosition();
        }
        else {
            this.recaptchaPortalEl.style.display = 'none';
            cancelAnimationFrame(this.positionRAF);
        }
    }
    getAncestorOpacity() {
        let el = this.el.parentElement;
        while (el && el !== document.body) {
            const opacity = parseFloat(getComputedStyle(el).opacity);
            if (opacity < 1)
                return opacity;
            el = el.parentElement;
        }
        return 1;
    }
    // #endregion
    render() {
        var _a, _b, _c, _d, _e, _f, _g;
        const tableHeaders = [
            {
                width: 200,
                key: 'sscTableCode',
                label: this.locale.sscTableCode,
            },
            {
                width: 400,
                key: 'sscTableDescription',
                label: this.locale.sscTableDescription,
            },
            {
                width: 200,
                key: 'sscTableRepairStatus',
                label: this.locale.sscTableRepairStatus,
            },
            {
                width: 200,
                key: 'sscTableOPCode',
                label: this.locale.sscTableOPCode,
            },
            {
                width: 200,
                key: 'sscTablePartNumber',
                label: this.locale.sscTablePartNumber,
            },
        ];
        const rows = !((_a = this.vehicleLookup) === null || _a === void 0 ? void 0 : _a.ssc)
            ? []
            : (_b = this.vehicleLookup) === null || _b === void 0 ? void 0 : _b.ssc.map(sscItem => ({
                sscTableCode: sscItem === null || sscItem === void 0 ? void 0 : sscItem.sscCode,
                sscTableDescription: sscItem === null || sscItem === void 0 ? void 0 : sscItem.description,
                sscTableRepairStatus: () => (h("div", { class: "table-cell-container" }, h("img", { class: "table-status-icon", src: (sscItem === null || sscItem === void 0 ? void 0 : sscItem.repaired) ? CheckIcon : XIcon }), " ", sscItem === null || sscItem === void 0 ? void 0 :
                    sscItem.repairDate)),
                sscTableOPCode: () => (h("div", { class: "table-cell-container table-cell-labors-container" }, !!(sscItem === null || sscItem === void 0 ? void 0 : sscItem.labors.length)
                    ? sscItem === null || sscItem === void 0 ? void 0 : sscItem.labors.map(labor => (h("div", { key: labor === null || labor === void 0 ? void 0 : labor.laborCode, class: "success" }, labor === null || labor === void 0 ? void 0 : labor.laborCode)))
                    : '...')),
                sscTablePartNumber: () => (h("div", { class: "table-cell-container table-cell-parts-container" }, !!(sscItem === null || sscItem === void 0 ? void 0 : sscItem.parts.length)
                    ? sscItem === null || sscItem === void 0 ? void 0 : sscItem.parts.map(part => (h("div", { key: part === null || part === void 0 ? void 0 : part.partNumber, class: (part === null || part === void 0 ? void 0 : part.isAvailable) ? 'success' : 'reject' }, part === null || part === void 0 ? void 0 : part.partNumber)))
                    : '...')),
            }));
        const templateRow = {
            sscTableOPCode: () => h("div", { key: '90a2b0c7a4affe5554584ccb585f2561f51488f7', class: "h-[25px]" }),
            sscTablePartNumber: () => h("div", { key: 'e9f0b7e15e726ec1a639efe91eb732c0a03a28db', class: "h-[25px]" }),
            sscTableRepairStatus: () => h("div", { key: 'f70ec4452a1a9efdf7a01d5ba4e195d5743493b1', class: "h-[25px]" }),
        };
        return (h(Host, { key: 'd764d2850a71f1d15ee4543e7d4f5dce32410017', translate: "no" }, h(VehicleInfoLayout, { key: '35d4785e3b267b2e967e6b934534864e2296cb38', isError: this.isError, coreOnly: this.coreOnly, isLoading: this.isLoading, header: (_c = this.vehicleLookup) === null || _c === void 0 ? void 0 : _c.vin, direction: this.locale.sharedLocales.direction, errorMessage: this.locale.sharedLocales.errors[this.errorMessage] || this.locale.sharedLocales.errors.wildCard }, h("div", { key: 'eac182adf084b6b6a49ea381bedf1c50c8319ff3', class: "p-[16px]" }, this.showWarranty && (h(CardsContainer, { key: '6be6bef496ba7f54e34355dbba490f876ffe17c7', isLoading: this.isLoading, warrantyLocale: this.locale, vehicleInformation: this.vehicleLookup, isAuthorized: (_d = this.vehicleLookup) === null || _d === void 0 ? void 0 : _d.isAuthorized, unInvoicedByBrokerName: this.unInvoicedByBrokerName })), h("div", { key: '6172355f2c7565acf307b0b75ba3ebd00ce02851', class: "h-[8px]" }), h("flexible-container", { key: '3e4388da62819a4783328a73a587e2d4f0c4aa8e', isOpened: this.showRecaptcha, classes: cn('w-fit mx-auto shift-skeleton', { loading: !this.showRecaptcha || this.isLoading }) }, h("div", { key: '7a4f64004d782330e64e54a54ec7de27d641140c', style: { height: 'auto' }, class: "recaptcha-container" }, this.useMockRecaptchaWidget ? (h("div", { ref: el => (this.recaptchaPlaceholderRef = el), onClick: this.handleDevRecaptchaClick, class: cn('dev-recaptcha', { 'dev-recaptcha-disabled': this.devRecaptchaChecked }) }, h("div", { class: cn('dev-recaptcha-checkbox', { checked: this.devRecaptchaChecked }) }, this.devRecaptchaChecked && h("span", { class: "dev-recaptcha-checkmark" }, "\u2713")), h("div", { class: "dev-recaptcha-label" }, "I'm not a robot"), h("div", { class: "dev-recaptcha-brand" }, h("div", { class: "dev-recaptcha-brand-name" }, "reCAPTCHA"), h("div", { class: "dev-recaptcha-brand-mock" }, "(dev mock)")))) : (h("div", { ref: el => (this.recaptchaPlaceholderRef = el), style: { minWidth: '302px', minHeight: '76px' } }))), this.recaptchaRes && (h("div", { key: 'af8b578b2b544f5bc6c3f9224757b84f1562508e', class: cn('recaptcha-response', ((_e = this.recaptchaRes) === null || _e === void 0 ? void 0 : _e.status) === 'recallExists' ? 'reject-card ' : (((_f = this.recaptchaRes) === null || _f === void 0 ? void 0 : _f.status) === 'noRecall' ? 'success-card ' : 'warning-card ')) }, this.locale[(_g = this.recaptchaRes) === null || _g === void 0 ? void 0 : _g.status])))), h("flexible-container", { key: '7567956557b14f43320fe585227b01f073ccceeb', isOpened: this.checkingUnauthorizedSSC, classes: "w-fit mx-auto" }, h("div", { key: 'acd74928ea20fd4364cb1713c56befa893e97e49', class: "pt-[16px]" }, h("div", { key: '0c77df4ace034c7e58a4a9818e15ad6c2a5708c4', class: "flex shift-skeleton flex-col gap-[8px]" }, h("strong", { key: 'f8b40361fef7fbbf6a93abd83a657dfab7b06350' }, this.locale.checkingTMC), h("div", { key: '68d532179ccbbfd81f9c783bc0087252f44dd355', class: "relative pt-[40px]" }, h("loading-spinner", { key: 'bd0ed2e7d21b994f17b7bd576e9799d4d4c9ccac', isLoading: this.checkingUnauthorizedSSC }))))), this.showSsc && (h("div", { key: '920afd8e0c7db6a9ac935b15375120b94607b35f', class: "mt-[32px] mx-auto w-fit max-w-full" }, h("div", { key: 'bd188533e68b0cc25025708cd567ed3b3de100a9', class: "bg-[#f6f6f6] h-[50px] flex items-center justify-center px-[16px] font-bold text-[18px]" }, this.locale.sscCampings), h("div", { key: '1ae760a4fcc4a09c5fa7940a5ab0f2f0e98436ad', class: "overflow-x-auto" }, h("information-table", { key: '54d8c55e79d717324a10c2b635106b284f4ae99b', isLoading: this.isLoading, templateRow: templateRow, rows: rows, headers: tableHeaders })))))));
    }
    static get is() { return "vehicle-warranty-details"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["vehicle-warranty-details.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["vehicle-warranty-details.css"]
        };
    }
    static get properties() {
        return {
            "language": {
                "type": "string",
                "attribute": "language",
                "mutable": false,
                "complexType": {
                    "original": "LanguageKeys",
                    "resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
                    "references": {
                        "LanguageKeys": {
                            "location": "import",
                            "path": "~features/multi-lingual",
                            "id": "src/features/multi-lingual/index.ts::LanguageKeys"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'en'"
            },
            "coreOnly": {
                "type": "boolean",
                "attribute": "core-only",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "isDev": {
                "type": "boolean",
                "attribute": "is-dev",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "disableVinValidation": {
                "type": "boolean",
                "attribute": "disable-vin-validation",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "baseUrl": {
                "type": "string",
                "attribute": "base-url",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "headers": {
                "type": "unknown",
                "attribute": "headers",
                "mutable": false,
                "complexType": {
                    "original": "object",
                    "resolved": "object",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "{}"
            },
            "queryString": {
                "type": "string",
                "attribute": "query-string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "''"
            },
            "errorCallback": {
                "type": "string",
                "attribute": "error-callback",
                "mutable": false,
                "complexType": {
                    "original": "BlazorInvokableFunction<(errorMessage: ErrorKeys) => void>",
                    "resolved": "((errorMessage: OptionalKeys<{ noBaseUrl: string; invalidVin: string; vinNumberRequired: string; partNumberRequired: string; wrongResponseFormat: string; noPartsFound: string; noServiceAvailable: string; wrongFormStructure: string; wildCard: string; requestFailedPleaseTryAgainLater: string; }>) => void) | string",
                    "references": {
                        "BlazorInvokableFunction": {
                            "location": "import",
                            "path": "~features/blazor-ref",
                            "id": "src/features/blazor-ref/index.ts::BlazorInvokableFunction"
                        },
                        "ErrorKeys": {
                            "location": "import",
                            "path": "~features/multi-lingual",
                            "id": "src/features/multi-lingual/index.ts::ErrorKeys"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "loadingStateChange": {
                "type": "string",
                "attribute": "loading-state-change",
                "mutable": false,
                "complexType": {
                    "original": "BlazorInvokableFunction<(isLoading: boolean) => void>",
                    "resolved": "((isLoading: boolean) => void) | string",
                    "references": {
                        "BlazorInvokableFunction": {
                            "location": "import",
                            "path": "~features/blazor-ref",
                            "id": "src/features/blazor-ref/index.ts::BlazorInvokableFunction"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "loadedResponse": {
                "type": "string",
                "attribute": "loaded-response",
                "mutable": false,
                "complexType": {
                    "original": "BlazorInvokableFunction<(response: VehicleLookupDTO) => void>",
                    "resolved": "((response: VehicleLookupDTO) => void) | string",
                    "references": {
                        "BlazorInvokableFunction": {
                            "location": "import",
                            "path": "~features/blazor-ref",
                            "id": "src/features/blazor-ref/index.ts::BlazorInvokableFunction"
                        },
                        "VehicleLookupDTO": {
                            "location": "import",
                            "path": "~types/generated/vehicle-lookup/vehicle-lookup-dto",
                            "id": "src/global/types/generated/vehicle-lookup/vehicle-lookup-dto.ts::VehicleLookupDTO"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "unauthorizedSscLookupResponse": {
                "type": "string",
                "attribute": "unauthorized-ssc-lookup-response",
                "mutable": false,
                "complexType": {
                    "original": "BlazorInvokableFunction<(sscLookupStatus: number) => void>",
                    "resolved": "((sscLookupStatus: number) => void) | string",
                    "references": {
                        "BlazorInvokableFunction": {
                            "location": "import",
                            "path": "~features/blazor-ref",
                            "id": "src/features/blazor-ref/index.ts::BlazorInvokableFunction"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "showSsc": {
                "type": "boolean",
                "attribute": "show-ssc",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "recaptchaKey": {
                "type": "string",
                "attribute": "recaptcha-key",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "''"
            },
            "mockRecaptcha": {
                "type": "boolean",
                "attribute": "mock-recaptcha",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "showWarranty": {
                "type": "boolean",
                "attribute": "show-warranty",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "unauthorizedSscLookupBaseUrl": {
                "type": "string",
                "attribute": "unauthorized-ssc-lookup-base-url",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "''"
            },
            "unauthorizedSscLookupQueryString": {
                "type": "string",
                "attribute": "unauthorized-ssc-lookup-query-string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "''"
            },
            "cityId": {
                "type": "string",
                "attribute": "city-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "cityIntegrationId": {
                "type": "string",
                "attribute": "city-integration-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "companyId": {
                "type": "string",
                "attribute": "company-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "companyIntegrationId": {
                "type": "string",
                "attribute": "company-integration-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "companyBranchId": {
                "type": "string",
                "attribute": "company-branch-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "companyBranchIntegrationId": {
                "type": "string",
                "attribute": "company-branch-integration-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "userId": {
                "type": "string",
                "attribute": "user-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "brandIntegrationId": {
                "type": "string",
                "attribute": "brand-integration-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "customerName": {
                "type": "string",
                "attribute": "customer-name",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "customerPhone": {
                "type": "string",
                "attribute": "customer-phone",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            },
            "customerEmail": {
                "type": "string",
                "attribute": "customer-email",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "null"
            }
        };
    }
    static get states() {
        return {
            "locale": {},
            "isError": {},
            "errorMessage": {},
            "isLoading": {},
            "vehicleLookup": {},
            "blazorRef": {},
            "showRecaptcha": {},
            "unInvoicedByBrokerName": {},
            "checkingUnauthorizedSSC": {},
            "devRecaptchaChecked": {},
            "recaptchaRes": {}
        };
    }
    static get methods() {
        return {
            "setMockData": {
                "complexType": {
                    "signature": "(newMockData: VehicleLookupMock) => Promise<void>",
                    "parameters": [{
                            "name": "newMockData",
                            "type": "{ [key: string]: VehicleLookupDTO; }",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "VehicleLookupMock": {
                            "location": "import",
                            "path": "~features/vehicle-lookup-component",
                            "id": "src/features/vehicle-lookup-component/index.ts::VehicleLookupMock"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "",
                    "tags": []
                }
            },
            "fetchVin": {
                "complexType": {
                    "signature": "(newData: VehicleLookupDTO | string, headers?: any) => Promise<void>",
                    "parameters": [{
                            "name": "newData",
                            "type": "string | VehicleLookupDTO",
                            "docs": ""
                        }, {
                            "name": "headers",
                            "type": "any",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "VehicleLookupDTO": {
                            "location": "import",
                            "path": "~types/generated/vehicle-lookup/vehicle-lookup-dto",
                            "id": "src/global/types/generated/vehicle-lookup/vehicle-lookup-dto.ts::VehicleLookupDTO"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "",
                    "tags": []
                }
            },
            "setErrorMessage": {
                "complexType": {
                    "signature": "(message: ErrorKeys) => Promise<void>",
                    "parameters": [{
                            "name": "message",
                            "type": "\"noBaseUrl\" | \"invalidVin\" | \"vinNumberRequired\" | \"partNumberRequired\" | \"wrongResponseFormat\" | \"noPartsFound\" | \"noServiceAvailable\" | \"wrongFormStructure\" | \"wildCard\" | \"requestFailedPleaseTryAgainLater\"",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "ErrorKeys": {
                            "location": "import",
                            "path": "~features/multi-lingual",
                            "id": "src/features/multi-lingual/index.ts::ErrorKeys"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "",
                    "tags": []
                }
            },
            "clearData": {
                "complexType": {
                    "signature": "() => Promise<void>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "",
                    "tags": []
                }
            },
            "setBlazorRef": {
                "complexType": {
                    "signature": "(newBlazorRef: DotNetObjectReference) => Promise<void>",
                    "parameters": [{
                            "name": "newBlazorRef",
                            "type": "{ invokeMethodAsync: (methodName: string, ...args: any[]) => Promise<any>; }",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "DotNetObjectReference": {
                            "location": "import",
                            "path": "~features/blazor-ref",
                            "id": "src/features/blazor-ref/index.ts::DotNetObjectReference"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "language",
                "methodName": "changeLanguage"
            }, {
                "propName": "isLoading",
                "methodName": "onLoadingChange"
            }, {
                "propName": "showRecaptcha",
                "methodName": "onShowRecaptchaChange"
            }];
    }
}
