/*!
 * Built by ShiftSoftware
 * Copyright (c)
 */
'use strict';

var index = require('./index-CmK48vN3.js');
var type = require('./type-BkehR16K.js');
var getMockFiles = require('./get-mock-files-DUVbI-Ch.js');
var vehicleInfoLayout = require('./vehicle-info-layout-UI-nhp1I.js');
var smartInvokable = require('./smart-invokable-BdyCLX9_.js');
var fetchFrom = require('./fetch-from-CDC_gRf3.js');
var types = require('./types-DV_cOCRi.js');
var getLocalLanguage = require('./get-local-language-d1KUONiZ.js');
var arrowUpIcon = require('./arrow-up-icon-BtMHdVU9.js');
var emptyTableIcon = require('./empty-table-icon-QLsRUBY_.js');
var cn = require('./cn-BHnqYtun.js');
var materialCard = require('./material-card-CaO7lBGp.js');
var type$1 = require('./type-CjTn3Uuy.js');

const setPartLookupData = async (context, newData, { beforeAssignment } = {}) => {
    // @ts-ignore
    const loadingKey = (context === null || context === void 0 ? void 0 : context.localLoadingName) ? context === null || context === void 0 ? void 0 : context.localLoadingName : 'isLoading';
    if (newData === null || newData === undefined)
        newData = (context === null || context === void 0 ? void 0 : context.searchString) || '';
    // clears network timeoutRef which serves as await for animation
    clearTimeout(context.networkTimeoutRef);
    // handles request spam by canceling the previous ones
    if (context.abortController)
        context.abortController.abort();
    context.abortController = new AbortController();
    // syncing the internal timeout ref with external network ref
    let scopedTimeoutRef;
    const isSearchRequest = typeof newData === 'string';
    const searchString = typeof newData === 'string' ? newData : newData === null || newData === void 0 ? void 0 : newData.partNumber;
    try {
        if (!searchString || searchString.trim().length === 0) {
            context.isError = false;
            context[loadingKey] = false;
            context.searchString = '';
            context.partLookup = undefined;
            return;
        }
        context[loadingKey] = true;
        await new Promise(r => {
            scopedTimeoutRef = setTimeout(r, 1000);
            context.networkTimeoutRef = scopedTimeoutRef;
        });
        context.searchString = searchString;
        const partResponse = isSearchRequest ? await getPartLookup(context, { scopedTimeoutRef }) : newData;
        if (context.networkTimeoutRef === scopedTimeoutRef) {
            if (!partResponse)
                throw new Error('wrongResponseFormat');
            if (beforeAssignment)
                context.partLookup = await beforeAssignment(partResponse, { scopedTimeoutRef });
            else
                context.partLookup = partResponse;
            // Fire loadedResponse after partLookup is set to ensure consistent state
            // Only for search requests — DTO distribution should not re-trigger the callback chain
            if (isSearchRequest) {
                smartInvokable.smartInvokable.bind(context)(context === null || context === void 0 ? void 0 : context.loadedResponse, partResponse);
            }
        }
        context.errorMessage = null;
        context[loadingKey] = false;
        context.isError = false;
    }
    catch (error) {
        if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
            return;
        smartInvokable.smartInvokable.bind(context)(context.errorCallback, error.message);
        console.error(error);
        context.setErrorMessage(error.message);
    }
};
const setPartLookupErrorState = (context, message) => {
    // @ts-ignore
    const loadingKey = (context === null || context === void 0 ? void 0 : context.localLoadingName) ? context === null || context === void 0 ? void 0 : context.localLoadingName : 'isLoading';
    context.isError = true;
    context[loadingKey] = false;
    context.errorMessage = message;
    context.partLookup = undefined;
};
async function getPartLookup(context, generalProps) {
    const { scopedTimeoutRef } = generalProps;
    const handleResult = (newPartLookup) => {
        if ((context === null || context === void 0 ? void 0 : context.networkTimeoutRef) === scopedTimeoutRef) {
            if (!newPartLookup && (context === null || context === void 0 ? void 0 : context.searchString))
                throw new Error('wrongResponseFormat');
            return newPartLookup;
        }
    };
    if (context === null || context === void 0 ? void 0 : context.isDev) {
        const newData = context === null || context === void 0 ? void 0 : context.mockData[context === null || context === void 0 ? void 0 : context.searchString];
        return handleResult(newData);
    }
    else {
        if (!(context === null || context === void 0 ? void 0 : context.endpoint))
            throw new Error('noBaseUrl');
        const fetchConfig = { signal: context === null || context === void 0 ? void 0 : context.abortController.signal, additionalPath: '/' + context.searchString };
        const response = await fetchFrom.fetchFrom(context.endpoint, fetchConfig);
        if (response.status === 204)
            throw new Error('noPartsFound');
        if (!response.ok)
            throw new Error('wildCard');
        const newData = (await response.json());
        return handleResult(newData);
    }
}

const DeadStockItem = ({ isOpened, item, key, icon, locale, toggleAccordion }) => {
    var _a, _b, _c;
    return (index.h("div", { key: key, class: "dead-stock-item" },
        index.h("button", { onClick: () => toggleAccordion(item === null || item === void 0 ? void 0 : item.companyName), class: cn.cn('button', {
                'cursor-default': !((_a = item === null || item === void 0 ? void 0 : item.branchDeadStock) === null || _a === void 0 ? void 0 : _a.length),
                'bg-slate-100': isOpened,
            }) },
            index.h("div", { class: "shift-skeleton flex-1 header" }, (item === null || item === void 0 ? void 0 : item.companyName) ? item === null || item === void 0 ? void 0 : item.companyName : index.h("span", null, "\u00A0")),
            index.h("div", { class: cn.cn('shift-skeleton icon-container', {
                    'rotate-0': isOpened,
                }) }, icon)),
        !!((_b = item === null || item === void 0 ? void 0 : item.branchDeadStock) === null || _b === void 0 ? void 0 : _b.length) && (index.h("flexible-container", { isOpened: isOpened },
            index.h("table", { class: "dead-stock-table" },
                index.h("thead", null,
                    index.h("tr", null,
                        index.h("th", { class: "dead-stock-table-header" }, locale.branch),
                        index.h("th", { class: "dead-stock-table-header" }, locale.availableQuantity))),
                index.h("tbody", null, (_c = item === null || item === void 0 ? void 0 : item.branchDeadStock) === null || _c === void 0 ? void 0 : _c.map(branchDeadStock => (index.h("tr", { class: "dead-stock-table-row", 
                    // @ts-ignore
                    key: branchDeadStock === null || branchDeadStock === void 0 ? void 0 : branchDeadStock.companyBranchIntegrationID },
                    index.h("td", null,
                        index.h("span", { class: "shift-skeleton" }, branchDeadStock === null || branchDeadStock === void 0 ? void 0 : branchDeadStock.companyBranchName)),
                    index.h("td", null,
                        index.h("strong", { class: "shift-skeleton" }, branchDeadStock === null || branchDeadStock === void 0 ? void 0 : branchDeadStock.quantity)))))))))));
};

const deadStockLookupCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.\\!pointer-events-none{pointer-events:none!important}.collapse{visibility:collapse}.absolute{position:absolute}.\\!relative{position:relative!important}.relative{position:relative}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.block{display:block}.flex{display:flex}.hidden{display:none}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.origin-left{transform-origin:left}.rotate-0{--tw-rotate:0deg}.rotate-0,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.\\!overflow-hidden{overflow:hidden!important}.rounded-\\[4px\\]{border-radius:4px}.border{border-width:1px}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.shift-skeleton{border-radius:4px;position:relative!important}.loading .shift-skeleton,.loading.shift-skeleton{border-style:none!important;overflow:hidden!important;pointer-events:none!important;position:relative!important}.shift-skeleton:after{background:linear-gradient(-45deg,#d4d8de,#e2e5e9,#d4d8de);background-size:300% 300%;border-radius:inherit!important;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transform-origin:left;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;z-index:10}.loading .shift-skeleton:after,.loading.shift-skeleton:after{--tw-scale-x:1;animation:shimmer 2s ease-in-out infinite;opacity:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes shimmer{0%{background-position:100% 0}50%{background-position:0 100%}to{background-position:100% 0}}.dead-stock-item{border:1px solid #d6d8dc;border-radius:6px;overflow:hidden}.dead-stock-item>.button{align-items:center;display:flex;gap:50px;height:50px;justify-content:space-between;padding:0 16px;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%}.dead-stock-item>.button.cursor-default{cursor:default}.dead-stock-item>.button.bg-slate-100{background-color:#f1f5f9}.dead-stock-item .header{flex-shrink:0;font-size:20px;font-weight:700;text-align:start}.dead-stock-item .icon-container{align-items:center;display:flex;flex-shrink:0;height:30px;justify-content:center;transform:rotate(180deg);transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:30px}.dead-stock-item .icon-container.rotate-0{transform:rotate(0deg)}.dead-stock-item .dead-stock-table{border-collapse:collapse;overflow:auto;padding:20px;width:100%}.dead-stock-item .dead-stock-table-header{border-bottom:1px solid #d6d8dc;padding:20px 10px;text-align:start;white-space:nowrap}.dead-stock-item .dead-stock-table-row{border-bottom:1px solid #d6d8dc;transition-duration:.1s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dead-stock-item .dead-stock-table-row:last-child{border:none}.dead-stock-item .dead-stock-table-row:hover{background-color:#f1f5f9}.dead-stock-item .dead-stock-table-row td{padding:20px 10px;text-align:start;white-space:nowrap}@keyframes showAfterDelay{0%{opacity:0}99.9%{opacity:0}to{opacity:1}}.show-after-delay{animation:showAfterDelay .5s forwards;opacity:0}.vehicle-info-container{background-color:#fdfdfd;border:1px solid #dcdcdc;border-radius:5px;box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 hsla(0,0%,100%,.1);overflow:hidden;padding:0;position:relative;transition-duration:.5s;transition-property:all}::-webkit-scrollbar{height:10px;width:10px}::-webkit-scrollbar-track{background:#f6f6f6;border-radius:5px;border-top:1px solid #dcdcdc;border-top-left-radius:0;border-top-right-radius:0}::-webkit-scrollbar-thumb{background:#c5c5c5;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:#a1a1a1}.hide-scroll ::-webkit-scrollbar-thumb,.hide-scroll::-webkit-scrollbar-thumb,.loading ::-webkit-scrollbar-thumb{background:transparent}.vehicle-info-body{display:flex;flex-direction:column;overflow:hidden;position:relative;transition-duration:.5s;transition-property:all;transition-timing-function:ease-in-out}.vehicle-info-content{transition-duration:.5s;transition-property:all;width:100%}.vehicle-info-header{align-items:center;background-color:#f6f6f6;border:1px solid #ededed;display:flex;height:54px;justify-content:center;position:relative;text-align:center}.vehicle-info-header-action{align-items:center;display:flex;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.vehicle-info-header-vin{display:inline-block;font-size:16px;transition-duration:.5s;transition-property:all}.vehicle-info-header-vin span{color:#ef4444}.loading .vehicle-info-header-vin{opacity:0;transform:scale(1.5);visibility:hidden}:host{all:initial!important;display:block;font-family:inherit!important;font-family:Noto Kufi Arabic,Nunito,Roboto,Arial,sans-serif!important}*,:host *{font-family:inherit!important}.static{position:static}.h-\\[200px\\]{height:200px}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.text-\\[26px\\]{font-size:26px}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.flex-col{flex-direction:column}.gap-\\[16px\\]{gap:16px}.p-\\[16px\\]{padding:16px}.pb-\\[16px\\]{padding-bottom:16px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.mx-auto{margin-left:auto;margin-right:auto}.me-2{margin-inline-end:.5rem}.ml-1{margin-left:.25rem}.mt-2{margin-top:.5rem}.mt-\\[32px\\]{margin-top:32px}.inline-flex{display:inline-flex}.h-\\[50px\\]{height:50px}.w-fit{width:fit-content}.max-w-full{max-width:100%}.flex-wrap{flex-wrap:wrap}.items-stretch{align-items:stretch}.gap-\\[8px\\]{gap:8px}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.rounded-lg{border-radius:.5rem}.border-red-300{--tw-border-opacity:1;border-color:rgb(252 165 165/var(--tw-border-opacity,1))}.bg-\\[\\#f6f6f6\\]{--tw-bg-opacity:1;background-color:rgb(246 246 246/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.p-\\[2px\\]{padding:2px}.px-3{padding-left:.75rem;padding-right:.75rem}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-1{padding-bottom:.25rem;padding-top:.25rem}.text-\\[16px\\]{font-size:16px}.text-\\[18px\\]{font-size:18px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\\[green\\]{--tw-text-opacity:1;color:rgb(0 128 0/var(--tw-text-opacity,1))}.text-\\[orange\\]{--tw-text-opacity:1;color:rgb(255 165 0/var(--tw-text-opacity,1))}.text-\\[red\\]{--tw-text-opacity:1;color:rgb(255 0 0/var(--tw-text-opacity,1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}@media (min-width:768px){.md\\:justify-between{justify-content:space-between}}.\\[\\&\\>div\\]\\:grow>div{flex-grow:1}.me-1{margin-inline-end:.25rem}.mb-\\[12px\\]{margin-bottom:12px}.w-\\[500px\\]{width:500px}.max-w-\\[250px\\]{max-width:250px}.max-w-\\[96vw\\]{max-width:96vw}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.gap-2{gap:.5rem}.gap-\\[32px\\]{gap:32px}.rounded-md{border-radius:.375rem}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[12px\\]{padding-bottom:12px}.pt-\\[12px\\],.py-\\[12px\\]{padding-top:12px}.pt-\\[32px\\]{padding-top:32px}.pt-\\[8px\\]{padding-top:8px}.text-center{text-align:center}.text-\\[20px\\]{font-size:20px}.text-xl{font-size:1.25rem;line-height:1.75rem}.even\\:bg-slate-100:nth-child(2n){--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:bg-sky-100\\/50:hover{background-color:rgba(224,242,254,.5)}.\\!h-auto{height:auto!important}.min-w-full{min-width:100%}.resize{resize:both}.overflow-hidden{overflow:hidden}.\\!transition-none{transition-property:none!important}.\\!duration-0{transition-duration:0s!important}.\\!duration-500{transition-duration:.5s!important}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\\!w-full{width:100%!important}.translate-x-\\[-200\\%\\]{--tw-translate-x:-200%}.translate-x-\\[-200\\%\\],.translate-y-\\[200\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[200\\%\\]{--tw-translate-y:200%}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\[\\&_\\*\\]\\:\\!pointer-events-none *{pointer-events:none!important}.my-auto{margin-bottom:auto;margin-top:auto}.table{display:table}.grid{display:grid}.size-\\[20px\\]{height:20px;width:20px}.size-\\[32px\\]{height:32px;width:32px}.size-full{height:100%;width:100%}.rotate-180{--tw-rotate:180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.place-items-center{place-items:center}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.bg-sky-100{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity,1))}.bg-sky-200{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity,1))}.bg-slate-200\\/70{background-color:rgba(226,232,240,.7)}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[6px\\]{padding-left:6px;padding-right:6px}.px-\\[8px\\]{padding-left:8px;padding-right:8px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-\\[13px\\]{font-size:13px}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1))}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.last\\:border-b-0:last-child{border-bottom-width:0}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-sky-200:hover{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity,1))}.hover\\:bg-slate-200\\/70:hover{background-color:rgba(226,232,240,.7)}";

const DeadStockLookup = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        // #region Localization
        this.language = 'en';
        this.locale = Object.assign({ sharedLocales: types.sharedLocalesSchema.getDefault() }, type.deadStockSchema.getDefault());
        // #endregion
        // #region Vehicle info layout prop
        this.coreOnly = false;
        // #endregion
        // #region Part Lookup Component Shared Logic
        this.mockUrl = '';
        this.isError = false;
        this.isLoading = false;
        // #endregion
        // #region Component Logic
        this.openedAccordions = [];
        this.newItemsHasBeenRendered = false;
        this.toggleAccordion = (header) => {
            if (this.isLoading)
                return;
            if (this.openedAccordions.includes(header)) {
                this.openedAccordions = this.openedAccordions.filter(item => item !== header);
            }
            else {
                this.openedAccordions = [...this.openedAccordions, header];
            }
        };
    }
    async componentWillLoad() {
        await Promise.all([this.changeLanguage(this.language), this.onIsDevChange(this.isDev)]);
    }
    async changeLanguage(newLanguage) {
        const [sharedLocales, locale] = await Promise.all([getLocalLanguage.getSharedLocal(newLanguage), getLocalLanguage.getLocaleLanguage(newLanguage, 'partLookup.deadStock', type.deadStockSchema)]);
        this.locale = Object.assign({ sharedLocales }, locale);
    }
    async setBlazorRef(newBlazorRef) {
        this.blazorRef = newBlazorRef;
    }
    async setMockData(newMockData) {
        this.mockData = newMockData;
        smartInvokable.smartInvokable.bind(this)(this.loadedMockDatas, newMockData);
    }
    async getMockData() {
        return this.mockData;
    }
    async onIsDevChange(isDev) {
        if (!isDev)
            return;
        const mockData = await getMockFiles.getMockFile('part-lookup', this.mockUrl);
        await this.setMockData(mockData);
    }
    async fetchData(newData) {
        await setPartLookupData(this, newData, {
            beforeAssignment: async (response) => {
                await new Promise(r => setTimeout(r, 500));
                this.openedAccordions = [];
                await new Promise(r => setTimeout(r, 500));
                return response;
            },
        });
    }
    async setErrorMessage(message) {
        setPartLookupErrorState(this, message);
    }
    onLoadingChange(newValue) {
        smartInvokable.smartInvokable.bind(this)(this.loadingStateChange, newValue);
    }
    async loadingListener(newIsLoading) {
        if (newIsLoading)
            this.newItemsHasBeenRendered = false;
        else {
            await new Promise(r => setTimeout(r, 100));
            this.newItemsHasBeenRendered = true;
        }
    }
    // #endregion
    render() {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
        return (index.h(index.Host, { key: 'd62c70833921bd1b5765a2d7e072bbc5dbded2ac', translate: "no" }, index.h(vehicleInfoLayout.VehicleInfoLayout, { key: '309b40614e429189a8369c1248f6f273269f4955', isError: this.isError, coreOnly: this.coreOnly, isLoading: this.isLoading, header: (_a = this.partLookup) === null || _a === void 0 ? void 0 : _a.partNumber, direction: this.locale.sharedLocales.direction, errorMessage: this.locale.sharedLocales.errors[this.errorMessage] || this.locale.sharedLocales.errors.wildCard }, index.h("div", { key: '080259257a66be6dfd2b9c750cdd4a71f070dc04', class: "p-[16px]" }, index.h("div", { key: 'd101e493bf7127a8da1614603fe920e60151d8ad', class: "pb-[16px]" }, index.h(DeadStockItem, { locale: this.locale, key: "first-dead-stock", toggleAccordion: this.toggleAccordion, isOpened: !this.isLoading && ((_c = (_b = this.partLookup) === null || _b === void 0 ? void 0 : _b.deadStock) === null || _c === void 0 ? void 0 : _c.length) > 0 ? this.openedAccordions.includes((_e = (_d = this.partLookup) === null || _d === void 0 ? void 0 : _d.deadStock[0]) === null || _e === void 0 ? void 0 : _e.companyName) : false, item: ((_g = (_f = this.partLookup) === null || _f === void 0 ? void 0 : _f.deadStock) === null || _g === void 0 ? void 0 : _g.length) > 0
                ? (_h = this.partLookup) === null || _h === void 0 ? void 0 : _h.deadStock[0]
                : { companyName: !!this.partLookup && !((_j = this.partLookup) === null || _j === void 0 ? void 0 : _j.deadStock) ? this.locale.sharedLocales.noData : '' }, icon: (!this.partLookup && !((_k = this.partLookup) === null || _k === void 0 ? void 0 : _k.deadStock) && index.h("div", null)) ||
                (!!this.partLookup && !((_l = this.partLookup) === null || _l === void 0 ? void 0 : _l.deadStock) && index.h(emptyTableIcon.EmptyTableIcon, null)) ||
                (!!this.partLookup && !!((_m = this.partLookup) === null || _m === void 0 ? void 0 : _m.deadStock) && index.h(arrowUpIcon.ArrowUpIcon, null)) })), index.h("flexible-container", { key: 'ee3802a22b13bfa0ebec4bdd67e8f9c4f2c3f706', isOpened: this.newItemsHasBeenRendered }, index.h("div", { key: 'c68340e2c11be77e5cde04ece671c8a6df8b8289', class: "flex flex-col gap-[16px]" }, ((_p = (_o = this.partLookup) === null || _o === void 0 ? void 0 : _o.deadStock) === null || _p === void 0 ? void 0 : _p.length) > 1 &&
            ((_q = this.partLookup) === null || _q === void 0 ? void 0 : _q.deadStock.slice(1).map(deadStock => (index.h(DeadStockItem, { item: deadStock, locale: this.locale, icon: index.h(arrowUpIcon.ArrowUpIcon, null), toggleAccordion: this.toggleAccordion, isOpened: this.openedAccordions.includes(deadStock === null || deadStock === void 0 ? void 0 : deadStock.companyName) }))))))))));
    }
    get el() { return index.getElement(this); }
    static get watchers() { return {
        "language": ["changeLanguage"],
        "isDev": ["onIsDevChange"],
        "isLoading": ["onLoadingChange", "loadingListener"]
    }; }
};
DeadStockLookup.style = deadStockLookupCss;

const distributorLookupCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.\\!pointer-events-none{pointer-events:none!important}.absolute{position:absolute}.\\!relative{position:relative!important}.relative{position:relative}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.block{display:block}.flex{display:flex}.hidden{display:none}.origin-left{transform-origin:left}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\!overflow-hidden{overflow:hidden!important}.rounded-\\[4px\\]{border-radius:4px}.border{border-width:1px}.opacity-0{opacity:0}.opacity-100{opacity:1}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.shift-skeleton{border-radius:4px;position:relative!important}.loading .shift-skeleton,.loading.shift-skeleton{border-style:none!important;overflow:hidden!important;pointer-events:none!important;position:relative!important}.shift-skeleton:after{background:linear-gradient(-45deg,#d4d8de,#e2e5e9,#d4d8de);background-size:300% 300%;border-radius:inherit!important;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transform-origin:left;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;z-index:10}.loading .shift-skeleton:after,.loading.shift-skeleton:after{--tw-scale-x:1;animation:shimmer 2s ease-in-out infinite;opacity:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes shimmer{0%{background-position:100% 0}50%{background-position:0 100%}to{background-position:100% 0}}.vehicle-info-container{background-color:#fdfdfd;border:1px solid #dcdcdc;border-radius:5px;box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 hsla(0,0%,100%,.1);overflow:hidden;padding:0;position:relative;transition-duration:.5s;transition-property:all}::-webkit-scrollbar{height:10px;width:10px}::-webkit-scrollbar-track{background:#f6f6f6;border-radius:5px;border-top:1px solid #dcdcdc;border-top-left-radius:0;border-top-right-radius:0}::-webkit-scrollbar-thumb{background:#c5c5c5;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:#a1a1a1}.hide-scroll ::-webkit-scrollbar-thumb,.hide-scroll::-webkit-scrollbar-thumb,.loading ::-webkit-scrollbar-thumb{background:transparent}.vehicle-info-body{display:flex;flex-direction:column;overflow:hidden;position:relative;transition-duration:.5s;transition-property:all;transition-timing-function:ease-in-out}.vehicle-info-content{transition-duration:.5s;transition-property:all;width:100%}.vehicle-info-header{align-items:center;background-color:#f6f6f6;border:1px solid #ededed;display:flex;height:54px;justify-content:center;position:relative;text-align:center}.vehicle-info-header-action{align-items:center;display:flex;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.vehicle-info-header-vin{display:inline-block;font-size:16px;transition-duration:.5s;transition-property:all}.vehicle-info-header-vin span{color:#ef4444}.loading .vehicle-info-header-vin{opacity:0;transform:scale(1.5);visibility:hidden}:host{all:initial!important;display:block;font-family:inherit!important;font-family:Noto Kufi Arabic,Nunito,Roboto,Arial,sans-serif!important}*,:host *{font-family:inherit!important}.static{position:static}.h-\\[200px\\]{height:200px}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.text-\\[26px\\]{font-size:26px}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.flex-col{flex-direction:column}.gap-\\[16px\\]{gap:16px}.p-\\[16px\\]{padding:16px}.pb-\\[16px\\]{padding-bottom:16px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.mx-auto{margin-left:auto;margin-right:auto}.me-2{margin-inline-end:.5rem}.ml-1{margin-left:.25rem}.mt-2{margin-top:.5rem}.mt-\\[32px\\]{margin-top:32px}.inline-flex{display:inline-flex}.h-\\[50px\\]{height:50px}.w-fit{width:fit-content}.max-w-full{max-width:100%}.flex-wrap{flex-wrap:wrap}.items-stretch{align-items:stretch}.gap-\\[8px\\]{gap:8px}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.rounded-lg{border-radius:.5rem}.border-red-300{--tw-border-opacity:1;border-color:rgb(252 165 165/var(--tw-border-opacity,1))}.bg-\\[\\#f6f6f6\\]{--tw-bg-opacity:1;background-color:rgb(246 246 246/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.p-\\[2px\\]{padding:2px}.px-3{padding-left:.75rem;padding-right:.75rem}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-1{padding-bottom:.25rem;padding-top:.25rem}.text-\\[16px\\]{font-size:16px}.text-\\[18px\\]{font-size:18px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\\[green\\]{--tw-text-opacity:1;color:rgb(0 128 0/var(--tw-text-opacity,1))}.text-\\[orange\\]{--tw-text-opacity:1;color:rgb(255 165 0/var(--tw-text-opacity,1))}.text-\\[red\\]{--tw-text-opacity:1;color:rgb(255 0 0/var(--tw-text-opacity,1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}@media (min-width:768px){.md\\:justify-between{justify-content:space-between}}.\\[\\&\\>div\\]\\:grow>div{flex-grow:1}.me-1{margin-inline-end:.25rem}.mb-\\[12px\\]{margin-bottom:12px}.w-\\[500px\\]{width:500px}.max-w-\\[250px\\]{max-width:250px}.max-w-\\[96vw\\]{max-width:96vw}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.gap-2{gap:.5rem}.gap-\\[32px\\]{gap:32px}.rounded-md{border-radius:.375rem}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[12px\\]{padding-bottom:12px}.pt-\\[12px\\],.py-\\[12px\\]{padding-top:12px}.pt-\\[32px\\]{padding-top:32px}.pt-\\[8px\\]{padding-top:8px}.text-center{text-align:center}.text-\\[20px\\]{font-size:20px}.text-xl{font-size:1.25rem;line-height:1.75rem}.even\\:bg-slate-100:nth-child(2n){--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:bg-sky-100\\/50:hover{background-color:rgba(224,242,254,.5)}.\\!h-auto{height:auto!important}.min-w-full{min-width:100%}.resize{resize:both}.overflow-hidden{overflow:hidden}.\\!transition-none{transition-property:none!important}.\\!duration-0{transition-duration:0s!important}.\\!duration-500{transition-duration:.5s!important}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\\!w-full{width:100%!important}.translate-x-\\[-200\\%\\]{--tw-translate-x:-200%}.translate-x-\\[-200\\%\\],.translate-y-\\[200\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[200\\%\\]{--tw-translate-y:200%}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\[\\&_\\*\\]\\:\\!pointer-events-none *{pointer-events:none!important}.my-auto{margin-bottom:auto;margin-top:auto}.table{display:table}.grid{display:grid}.size-\\[20px\\]{height:20px;width:20px}.size-\\[32px\\]{height:32px;width:32px}.size-full{height:100%;width:100%}.rotate-180{--tw-rotate:180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.place-items-center{place-items:center}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.bg-sky-100{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity,1))}.bg-sky-200{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity,1))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.bg-slate-200\\/70{background-color:rgba(226,232,240,.7)}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[6px\\]{padding-left:6px;padding-right:6px}.px-\\[8px\\]{padding-left:8px;padding-right:8px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-\\[13px\\]{font-size:13px}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1))}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.last\\:border-b-0:last-child{border-bottom-width:0}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-sky-200:hover{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity,1))}.hover\\:bg-slate-200\\/70:hover{background-color:rgba(226,232,240,.7)}";

const DistributorLookup = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        // #region Localization
        this.language = 'en';
        this.locale = Object.assign({ sharedLocales: types.sharedLocalesSchema.getDefault() }, type$1.distributerSchema.getDefault());
        // #endregion
        // #region Vehicle info layout prop
        this.coreOnly = false;
        // #endregion
        // #region Part Lookup Component Shared Logic
        this.mockUrl = '';
        this.isError = false;
        this.isLoading = false;
        // #region Component Logic
        // ===== Start Component Logic
        this.hiddenFields = '';
        this.localizationName = '';
    }
    async componentWillLoad() {
        await Promise.all([this.changeLanguage(this.language), this.onIsDevChange(this.isDev)]);
    }
    async changeLanguage(newLanguage) {
        const [sharedLocales, locale] = await Promise.all([getLocalLanguage.getSharedLocal(newLanguage), getLocalLanguage.getLocaleLanguage(newLanguage, 'partLookup.distributor', type$1.distributerSchema)]);
        this.locale = Object.assign({ sharedLocales }, locale);
    }
    async setMockData(newMockData) {
        this.mockData = newMockData;
        smartInvokable.smartInvokable.bind(this)(this.loadedMockDatas, newMockData);
    }
    async getMockData() {
        return this.mockData;
    }
    async onIsDevChange(isDev) {
        if (!isDev)
            return;
        const mockData = await getMockFiles.getMockFile('part-lookup', this.mockUrl);
        await this.setMockData(mockData);
    }
    async fetchData(newData) {
        await setPartLookupData(this, newData);
    }
    async setErrorMessage(message) {
        setPartLookupErrorState(this, message);
    }
    onLoadingChange(newValue) {
        smartInvokable.smartInvokable.bind(this)(this.loadingStateChange, newValue);
    }
    async setBlazorRef(newBlazorRef) {
        this.blazorRef = newBlazorRef;
    }
    // #endregion
    render() {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
        const localName = this.partLookup ? this.localizationName || 'russian' : 'russian';
        const hiddenFields = ((_b = (_a = this.hiddenFields) === null || _a === void 0 ? void 0 : _a.split(',')) === null || _b === void 0 ? void 0 : _b.map(field => field.trim())) || [];
        const partsInformation = [
            { label: this.locale.description, key: 'partDescription', value: (_c = this.partLookup) === null || _c === void 0 ? void 0 : _c.partDescription },
            { label: this.locale.productGroup, key: 'productGroup', value: (_d = this.partLookup) === null || _d === void 0 ? void 0 : _d.productGroup },
            {
                key: 'localDescription',
                value: (_e = this.partLookup) === null || _e === void 0 ? void 0 : _e.localDescription,
                label: this.locale.localDescription.replace('$', localName),
            },
            {
                key: 'purchasePrice',
                label: this.locale.dealerPurchasePrice,
                values: (_g = (_f = this.partLookup) === null || _f === void 0 ? void 0 : _f.prices) === null || _g === void 0 ? void 0 : _g.map(price => { var _a; return ({ header: price === null || price === void 0 ? void 0 : price.countryName, body: (_a = price === null || price === void 0 ? void 0 : price.purchasePrice) === null || _a === void 0 ? void 0 : _a.formattedValue }); }),
            },
            {
                key: 'retailPrice',
                label: this.locale.recommendedRetailPrice,
                values: (_j = (_h = this.partLookup) === null || _h === void 0 ? void 0 : _h.prices) === null || _j === void 0 ? void 0 : _j.map(price => { var _a; return ({ header: price === null || price === void 0 ? void 0 : price.countryName, body: (_a = price === null || price === void 0 ? void 0 : price.retailPrice) === null || _a === void 0 ? void 0 : _a.formattedValue }); }),
            },
            {
                key: 'supersededTo',
                label: this.locale.supersessions,
                values: (_l = (_k = this.partLookup) === null || _k === void 0 ? void 0 : _k.supersededTo) === null || _l === void 0 ? void 0 : _l.map(part => ({ header: null, body: part })),
            },
        ];
        const displayedFields = partsInformation.filter(part => !hiddenFields.includes(part.key));
        const tableHeaders = [
            {
                width: 300,
                key: 'locationName',
                label: this.locale.location,
            },
            {
                width: 300,
                key: 'quantityLookUpResult',
                label: this.locale.availability,
            },
        ];
        const displayDistributer = !((_m = this.partLookup) === null || _m === void 0 ? void 0 : _m.stockParts.some(({ quantityLookUpResult }) => quantityLookUpResult === 'LookupIsSkipped' || quantityLookUpResult === 'QuantityNotWithinLookupThreshold'));
        const rows = displayDistributer
            ? (_o = this.partLookup) === null || _o === void 0 ? void 0 : _o.stockParts.map(stock => ({
                locationName: stock.locationName,
                quantityLookUpResult: () => (index.h("div", { class: cn.cn('text-[red]', {
                        'text-[green]': stock.quantityLookUpResult === 'Available',
                        'text-[orange]': stock.quantityLookUpResult === 'PartiallyAvailable',
                    }) }, index.h("strong", null, stock.quantityLookUpResult === 'Available'
                    ? this.locale.available
                    : stock.quantityLookUpResult === 'PartiallyAvailable'
                        ? this.locale.partiallyAvailable
                        : this.locale.notAvailable))),
            }))
            : [];
        return (index.h(index.Host, { key: '54e7fd2049ea95fefabeda4d5fe45c3860bdf38d', translate: "no" }, index.h(vehicleInfoLayout.VehicleInfoLayout, { key: '3131507652e0a6f6f3abc731c8b61630faa1810d', isError: this.isError, coreOnly: this.coreOnly, isLoading: this.isLoading, header: (_p = this.partLookup) === null || _p === void 0 ? void 0 : _p.partNumber, direction: this.locale.sharedLocales.direction, errorMessage: this.locale.sharedLocales.errors[this.errorMessage] || this.locale.sharedLocales.errors.wildCard }, index.h("div", { key: '208500ae7e09a0fa365ba671abd55de9d76eaa25', class: "p-[16px]" }, index.h("div", { key: 'c105c303a592e061a36aad350e1ae3a226eb592a' }, index.h("flexible-container", { key: '7607e09a5775227a32da185b95fb767677d66037' }, index.h("div", { key: '06c646fa37e64366c99fc16305a00d000561f412', class: "flex [&>div]:grow overflow-auto gap-[16px] items-stretch justify-center md:justify-between flex-wrap" }, displayedFields.map(({ label, value, values }) => values ? (index.h(materialCard.MaterialCard, { title: label, minWidth: "250px" }, index.h(materialCard.MaterialCardChildren, { class: "flex flex-wrap gap-[8px] p-[2px]" }, values
            .filter(x => x.body)
            .map(x => (index.h("span", { class: "inline-flex items-center bg-red-50 text-red-800 font-medium px-3 text-[16px] py-1 me-2 mt-2 rounded-lg border border-red-300" }, x.header && index.h("span", { class: "font-semibold" }, x.header, ":"), index.h("span", { class: "ml-1" }, x.body))))))) : (index.h(materialCard.MaterialCard, { desc: (value === null || value === void 0 ? void 0 : value.toString()) || '', title: label, minWidth: "250px" }))))), index.h("div", { key: 'cd1781bee592f7ed81f336798b19a61b657d400d', class: "mt-[32px] mx-auto w-fit max-w-full" }, index.h("div", { key: '9b37c8178c694aa144b212ff91289effc8a8cc3e', class: "bg-[#f6f6f6] h-[50px] flex items-center justify-center px-[16px] font-bold text-[18px]" }, this.locale.distributorStock), index.h("div", { key: '536900eb0969664b169b259d5e753509c4b9e5dd', class: "overflow-x-auto" }, index.h("information-table", { key: '019adc50fa83cd3ba3264f2aa0736830e69f54f7', isLoading: this.isLoading, rows: rows, headers: tableHeaders })))), index.h("manufacturer-part-lookup", { key: '91590830c0a91119b45456a8033751a71289d6af', standAlone: false, isDev: this.isDev, partLookup: this.partLookup, logId: (_q = this.partLookup) === null || _q === void 0 ? void 0 : _q.logId, closeManufacturerPartLookup: this.isLoading, manufacturerPartLookupTitle: this.manufacturerPartLookupTitle, manufacturerPartLookupEndpoint: this.manufacturerPartLookupEndpoint })))));
    }
    get el() { return index.getElement(this); }
    static get watchers() { return {
        "language": ["changeLanguage"],
        "isDev": ["onIsDevChange"],
        "isLoading": ["onLoadingChange"]
    }; }
};
DistributorLookup.style = distributorLookupCss;

const manufacturerLookupCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.\\!pointer-events-none{pointer-events:none!important}.absolute{position:absolute}.\\!relative{position:relative!important}.relative{position:relative}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.block{display:block}.flex{display:flex}.hidden{display:none}.origin-left{transform-origin:left}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\!overflow-hidden{overflow:hidden!important}.rounded-\\[4px\\]{border-radius:4px}.border{border-width:1px}.opacity-0{opacity:0}.opacity-100{opacity:1}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.shift-skeleton{border-radius:4px;position:relative!important}.loading .shift-skeleton,.loading.shift-skeleton{border-style:none!important;overflow:hidden!important;pointer-events:none!important;position:relative!important}.shift-skeleton:after{background:linear-gradient(-45deg,#d4d8de,#e2e5e9,#d4d8de);background-size:300% 300%;border-radius:inherit!important;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transform-origin:left;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;z-index:10}.loading .shift-skeleton:after,.loading.shift-skeleton:after{--tw-scale-x:1;animation:shimmer 2s ease-in-out infinite;opacity:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes shimmer{0%{background-position:100% 0}50%{background-position:0 100%}to{background-position:100% 0}}.vehicle-info-container{background-color:#fdfdfd;border:1px solid #dcdcdc;border-radius:5px;box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 hsla(0,0%,100%,.1);overflow:hidden;padding:0;position:relative;transition-duration:.5s;transition-property:all}::-webkit-scrollbar{height:10px;width:10px}::-webkit-scrollbar-track{background:#f6f6f6;border-radius:5px;border-top:1px solid #dcdcdc;border-top-left-radius:0;border-top-right-radius:0}::-webkit-scrollbar-thumb{background:#c5c5c5;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:#a1a1a1}.hide-scroll ::-webkit-scrollbar-thumb,.hide-scroll::-webkit-scrollbar-thumb,.loading ::-webkit-scrollbar-thumb{background:transparent}.vehicle-info-body{display:flex;flex-direction:column;overflow:hidden;position:relative;transition-duration:.5s;transition-property:all;transition-timing-function:ease-in-out}.vehicle-info-content{transition-duration:.5s;transition-property:all;width:100%}.vehicle-info-header{align-items:center;background-color:#f6f6f6;border:1px solid #ededed;display:flex;height:54px;justify-content:center;position:relative;text-align:center}.vehicle-info-header-action{align-items:center;display:flex;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.vehicle-info-header-vin{display:inline-block;font-size:16px;transition-duration:.5s;transition-property:all}.vehicle-info-header-vin span{color:#ef4444}.loading .vehicle-info-header-vin{opacity:0;transform:scale(1.5);visibility:hidden}:host{all:initial!important;display:block;font-family:inherit!important;font-family:Noto Kufi Arabic,Nunito,Roboto,Arial,sans-serif!important}*,:host *{font-family:inherit!important}.static{position:static}.h-\\[200px\\]{height:200px}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.text-\\[26px\\]{font-size:26px}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.flex-col{flex-direction:column}.gap-\\[16px\\]{gap:16px}.p-\\[16px\\]{padding:16px}.pb-\\[16px\\]{padding-bottom:16px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.mx-auto{margin-left:auto;margin-right:auto}.me-2{margin-inline-end:.5rem}.ml-1{margin-left:.25rem}.mt-2{margin-top:.5rem}.mt-\\[32px\\]{margin-top:32px}.inline-flex{display:inline-flex}.h-\\[50px\\]{height:50px}.w-fit{width:fit-content}.max-w-full{max-width:100%}.flex-wrap{flex-wrap:wrap}.items-stretch{align-items:stretch}.gap-\\[8px\\]{gap:8px}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.rounded-lg{border-radius:.5rem}.border-red-300{--tw-border-opacity:1;border-color:rgb(252 165 165/var(--tw-border-opacity,1))}.bg-\\[\\#f6f6f6\\]{--tw-bg-opacity:1;background-color:rgb(246 246 246/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.p-\\[2px\\]{padding:2px}.px-3{padding-left:.75rem;padding-right:.75rem}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-1{padding-bottom:.25rem;padding-top:.25rem}.text-\\[16px\\]{font-size:16px}.text-\\[18px\\]{font-size:18px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\\[green\\]{--tw-text-opacity:1;color:rgb(0 128 0/var(--tw-text-opacity,1))}.text-\\[orange\\]{--tw-text-opacity:1;color:rgb(255 165 0/var(--tw-text-opacity,1))}.text-\\[red\\]{--tw-text-opacity:1;color:rgb(255 0 0/var(--tw-text-opacity,1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}@media (min-width:768px){.md\\:justify-between{justify-content:space-between}}.\\[\\&\\>div\\]\\:grow>div{flex-grow:1}.me-1{margin-inline-end:.25rem}.mb-\\[12px\\]{margin-bottom:12px}.w-\\[500px\\]{width:500px}.max-w-\\[250px\\]{max-width:250px}.max-w-\\[96vw\\]{max-width:96vw}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.gap-2{gap:.5rem}.gap-\\[32px\\]{gap:32px}.rounded-md{border-radius:.375rem}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[12px\\]{padding-bottom:12px}.pt-\\[12px\\],.py-\\[12px\\]{padding-top:12px}.pt-\\[32px\\]{padding-top:32px}.pt-\\[8px\\]{padding-top:8px}.text-center{text-align:center}.text-\\[20px\\]{font-size:20px}.text-xl{font-size:1.25rem;line-height:1.75rem}.even\\:bg-slate-100:nth-child(2n){--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:bg-sky-100\\/50:hover{background-color:rgba(224,242,254,.5)}.\\!h-auto{height:auto!important}.min-w-full{min-width:100%}.resize{resize:both}.overflow-hidden{overflow:hidden}.\\!transition-none{transition-property:none!important}.\\!duration-0{transition-duration:0s!important}.\\!duration-500{transition-duration:.5s!important}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\\!w-full{width:100%!important}.translate-x-\\[-200\\%\\]{--tw-translate-x:-200%}.translate-x-\\[-200\\%\\],.translate-y-\\[200\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[200\\%\\]{--tw-translate-y:200%}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\[\\&_\\*\\]\\:\\!pointer-events-none *{pointer-events:none!important}.my-auto{margin-bottom:auto;margin-top:auto}.table{display:table}.grid{display:grid}.size-\\[20px\\]{height:20px;width:20px}.size-\\[32px\\]{height:32px;width:32px}.size-full{height:100%;width:100%}.rotate-180{--tw-rotate:180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.place-items-center{place-items:center}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.bg-sky-100{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity,1))}.bg-sky-200{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity,1))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.bg-slate-200\\/70{background-color:rgba(226,232,240,.7)}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[6px\\]{padding-left:6px;padding-right:6px}.px-\\[8px\\]{padding-left:8px;padding-right:8px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-\\[13px\\]{font-size:13px}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1))}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.last\\:border-b-0:last-child{border-bottom-width:0}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-sky-200:hover{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity,1))}.hover\\:bg-slate-200\\/70:hover{background-color:rgba(226,232,240,.7)}";

const ManufacturerLookup = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        // #region Localization
        this.language = 'en';
        this.locale = Object.assign({ sharedLocales: types.sharedLocalesSchema.getDefault() }, type.manufacturerSchema.getDefault());
        // #endregion
        // #region Vehicle info layout prop
        this.coreOnly = false;
        // #endregion
        // #region Part Lookup Component Shared Logic
        this.mockUrl = '';
        this.isError = false;
        this.isLoading = false;
        // #endregion
        // #region Component Logic
        this.hiddenFields = '';
        this.localizationName = '';
    }
    async componentWillLoad() {
        await Promise.all([this.changeLanguage(this.language), this.onIsDevChange(this.isDev)]);
    }
    async changeLanguage(newLanguage) {
        const [sharedLocales, locale] = await Promise.all([getLocalLanguage.getSharedLocal(newLanguage), getLocalLanguage.getLocaleLanguage(newLanguage, 'partLookup.manufacturer', type.manufacturerSchema)]);
        this.locale = Object.assign({ sharedLocales }, locale);
    }
    async setMockData(newMockData) {
        this.mockData = newMockData;
        smartInvokable.smartInvokable.bind(this)(this.loadedMockDatas, newMockData);
    }
    async getMockData() {
        return this.mockData;
    }
    async onIsDevChange(isDev) {
        if (!isDev)
            return;
        const mockData = await getMockFiles.getMockFile('part-lookup', this.mockUrl);
        await this.setMockData(mockData);
    }
    async fetchData(newData) {
        await setPartLookupData(this, newData);
    }
    async setErrorMessage(message) {
        setPartLookupErrorState(this, message);
    }
    onLoadingChange(newValue) {
        smartInvokable.smartInvokable.bind(this)(this.loadingStateChange, newValue);
    }
    async setBlazorRef(newBlazorRef) {
        this.blazorRef = newBlazorRef;
    }
    // #endregion
    render() {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
        const localName = this.localizationName || '';
        const hiddenFields = ((_a = this.hiddenFields) === null || _a === void 0 ? void 0 : _a.split(',').map(field => field === null || field === void 0 ? void 0 : field.trim())) || [];
        const manufacturerData = [
            { label: this.locale.origin, key: 'origin', value: (_b = this.partLookup) === null || _b === void 0 ? void 0 : _b.origin },
            {
                label: this.locale.warrantyPrice,
                key: 'warrantyPrice',
                values: (_c = this.partLookup) === null || _c === void 0 ? void 0 : _c.prices.map(price => {
                    var _a;
                    return { header: price === null || price === void 0 ? void 0 : price.countryName, body: (_a = price === null || price === void 0 ? void 0 : price.warrantyPrice) === null || _a === void 0 ? void 0 : _a.formattedValue };
                }),
            },
            { label: this.locale.specialPrice, key: 'specialPrice' },
            { label: this.locale.wholesalesPrice, key: 'salesPrice' },
            { label: this.locale.pnc, key: 'pnc', value: (_d = this.partLookup) === null || _d === void 0 ? void 0 : _d.pnc },
            { label: this.locale.pncName.replace('$', localName), key: 'pnc', value: (_e = this.partLookup) === null || _e === void 0 ? void 0 : _e.pnc },
            { label: this.locale.binCode, key: 'binType', value: (_f = this.partLookup) === null || _f === void 0 ? void 0 : _f.binType },
            { label: this.locale.length, key: 'length', value: (_g = this.partLookup) === null || _g === void 0 ? void 0 : _g.length },
            { label: this.locale.width, key: 'width', value: (_h = this.partLookup) === null || _h === void 0 ? void 0 : _h.width },
            { label: this.locale.height, key: 'height', value: (_j = this.partLookup) === null || _j === void 0 ? void 0 : _j.height },
            { label: this.locale.netWeight, key: 'netWeight', value: (_k = this.partLookup) === null || _k === void 0 ? void 0 : _k.netWeight },
            { label: this.locale.grossWeight, key: 'grossWeight', value: (_l = this.partLookup) === null || _l === void 0 ? void 0 : _l.grossWeight },
            { label: this.locale.cubicMeasure, key: 'cubicMeasure', value: (_m = this.partLookup) === null || _m === void 0 ? void 0 : _m.cubicMeasure },
            { label: this.locale.hsCode, key: 'hsCode', value: (_o = this.partLookup) === null || _o === void 0 ? void 0 : _o.hsCode },
            { label: this.locale.uzHsCode, key: 'hsCode', value: (_p = this.partLookup) === null || _p === void 0 ? void 0 : _p.hsCode },
        ];
        const displayedManufacturerData = manufacturerData.filter(part => !hiddenFields.includes(part.key));
        return (index.h(index.Host, { translate: "no" }, index.h(vehicleInfoLayout.VehicleInfoLayout, { isError: this.isError, coreOnly: this.coreOnly, isLoading: this.isLoading, header: (_q = this.partLookup) === null || _q === void 0 ? void 0 : _q.partNumber, direction: this.locale.sharedLocales.direction, errorMessage: this.locale.sharedLocales.errors[this.errorMessage] || this.locale.sharedLocales.errors.wildCard }, index.h("flexible-container", null, index.h("div", { class: "flex p-[16px] [&>div]:grow overflow-auto gap-[16px] items-stretch justify-center md:justify-between flex-wrap" }, displayedManufacturerData.map(({ label, value, values }) => values ? (index.h(materialCard.MaterialCard, { title: label, minWidth: "250px" }, index.h(materialCard.MaterialCardChildren, { class: "flex flex-wrap gap-[8px] p-[2px]" }, values
            .filter(x => x.body)
            .map(x => (index.h("span", { class: "inline-flex items-center bg-red-50 text-red-800 font-medium px-3 text-[16px] py-1 me-1 mt-2 rounded-lg border border-red-300" }, x.header && index.h("span", { class: "font-semibold" }, x.header, ":"), index.h("span", { class: "ml-1" }, x.body))))))) : (index.h(materialCard.MaterialCard, { desc: (value === null || value === void 0 ? void 0 : value.toString()) || '', title: label, minWidth: "250px" }))))))));
    }
    get el() { return index.getElement(this); }
    static get watchers() { return {
        "language": ["changeLanguage"],
        "isDev": ["onIsDevChange"],
        "isLoading": ["onLoadingChange"]
    }; }
};
ManufacturerLookup.style = manufacturerLookupCss;

exports.dead_stock_lookup = DeadStockLookup;
exports.distributor_lookup = DistributorLookup;
exports.manufacturer_lookup = ManufacturerLookup;
